sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* better sndio support in SoX
@ 2016-09-15 11:29 Jan Stary
  2016-09-20 19:39 ` Eric Wong
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Stary @ 2016-09-15 11:29 UTC (permalink / raw)
  To: sox-devel

[-- Attachment #1: Type: text/plain, Size: 374 bytes --]

Hi Eric,

recently, Alex Ratchov (of OpenBSD's sndio) has added a diff
to src/sndio.c that enables a finer setting of the desired
parameters of the underlying audio (namely, bit width).

Currently, the diff (attached) exists as a patch to the OpenBSD
port of SoX (which I maintain). Would you please consider
incorporating this change into SoX directly?

	Thank you

		Jan


[-- Attachment #2: patch-src_sndio_c --]
[-- Type: text/plain, Size: 871 bytes --]

$OpenBSD$
--- src/sndio.c.orig	Mon Jan 30 04:01:44 2012
+++ src/sndio.c	Tue Feb  9 23:23:00 2016
@@ -113,8 +113,6 @@ static int startany(sox_format_t *ft, unsigned mode)
     else
       reqpar.rchan = ft->signal.channels;
   }
-  if (ft->signal.precision > 0)
-    reqpar.bits = ft->signal.precision;
   switch (ft->encoding.encoding) {
   case SOX_ENCODING_SIGN2:
     reqpar.sig = 1;
@@ -127,6 +125,12 @@ static int startany(sox_format_t *ft, unsigned mode)
   }
   if (ft->encoding.bits_per_sample > 0)
     reqpar.bits = ft->encoding.bits_per_sample;
+  else if (ft->signal.precision > 0)
+    reqpar.bits = ft->signal.precision;
+  else
+    reqpar.bits = SOX_DEFAULT_PRECISION;
+  reqpar.bps = (reqpar.bits + 7) / 8;
+  reqpar.msb = 1;
   if (ft->encoding.reverse_bytes != sox_option_default) {
     reqpar.le = SIO_LE_NATIVE;
     if (ft->encoding.reverse_bytes)

[-- Attachment #3: Type: text/plain, Size: 79 bytes --]

------------------------------------------------------------------------------

[-- Attachment #4: Type: text/plain, Size: 158 bytes --]

_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-09-21 12:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-15 11:29 better sndio support in SoX Jan Stary
2016-09-20 19:39 ` Eric Wong
2016-09-20 20:06   ` Måns Rullgård
2016-09-20 21:36   ` Jan Stary
2016-09-20 22:24     ` Eric Wong
2016-09-21  5:45       ` Jan Stary
2016-09-21  6:58         ` Eric Wong
2016-09-21  7:19           ` Jan Stary
2016-09-21 11:42             ` Alexandre Ratchov
2016-09-21 11:19         ` Måns Rullgård
2016-09-21 11:42           ` Alexandre Ratchov

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).