shithub: sox

Download patch

ref: 6cf572505aff67a109f3b2f890bb45298772eca4
parent: 5f6dd66a0bb9c925eb33b0395e8b646a269aa1ca
author: robs <robs>
date: Sat Jun 28 07:16:21 EDT 2008

add 2 raw format extensions somehow missed before

--- a/debian/libsox-fmt-base.install
+++ b/debian/libsox-fmt-base.install
@@ -7,6 +7,8 @@
 debian/tmp/usr/lib/sox/libsox_fmt_cvsd.so* usr/lib/sox/
 debian/tmp/usr/lib/sox/libsox_fmt_dat.so* usr/lib/sox/
 debian/tmp/usr/lib/sox/libsox_fmt_dvms.so* usr/lib/sox/
+debian/tmp/usr/lib/sox/libsox_fmt_f4.so* usr/lib/sox/
+debian/tmp/usr/lib/sox/libsox_fmt_f8.so* usr/lib/sox/
 debian/tmp/usr/lib/sox/libsox_fmt_gsm.so* usr/lib/sox/
 debian/tmp/usr/lib/sox/libsox_fmt_hcom.so* usr/lib/sox/
 debian/tmp/usr/lib/sox/libsox_fmt_htk.so* usr/lib/sox/
@@ -24,7 +26,6 @@
 debian/tmp/usr/lib/sox/libsox_fmt_s4.so* usr/lib/sox/
 debian/tmp/usr/lib/sox/libsox_fmt_sf.so* usr/lib/sox/
 debian/tmp/usr/lib/sox/libsox_fmt_smp.so* usr/lib/sox/
-debian/tmp/usr/lib/sox/libsox_fmt_sndrtool.so* usr/lib/sox/
 debian/tmp/usr/lib/sox/libsox_fmt_sounder.so* usr/lib/sox/
 debian/tmp/usr/lib/sox/libsox_fmt_soundtool.so* usr/lib/sox/
 debian/tmp/usr/lib/sox/libsox_fmt_sphere.so* usr/lib/sox/
@@ -40,9 +41,7 @@
 debian/tmp/usr/lib/sox/libsox_fmt_wav.so* usr/lib/sox/
 debian/tmp/usr/lib/sox/libsox_fmt_wve.so* usr/lib/sox/
 debian/tmp/usr/lib/sox/libsox_fmt_xa.so* usr/lib/sox/
-
 debian/tmp/usr/lib/sox/libsox_fmt_wavpack.so* usr/lib/sox/
-
 debian/tmp/usr/lib/sox/libsox_fmt_sndfile.so* usr/lib/sox/
 debian/tmp/usr/lib/sox/libsox_fmt_caf.so* usr/lib/sox/
 debian/tmp/usr/lib/sox/libsox_fmt_fap.so* usr/lib/sox/
--- a/soxformat.7
+++ b/soxformat.7
@@ -57,9 +57,15 @@
 .PP
 \&\fB.raw\fR (also with \fB\-t sndfile\fR),
 .br
-\&\fB.s1\fR, \fB.s2\fR, \fB.s3\fR, \fB.s4\fR, \fB.u1\fR, \fB.u2\fR, \fB.u3\fR, \fB.u4\fR,
+\&\fB.f4\fR, \fB.f8\fR,
 .br
-\&\fB.ul\fR, \fB.al\fR, \fB.lu\fR, \fB.la\fR, \fB.sb\fR, \fB.sw\fR, \fB.ub\fR, \fB.uw\fR
+\&\fB.s1\fR, \fB.s2\fR, \fB.s3\fR, \fB.s4\fR,
+.br
+\&\fB.u1\fR, \fB.u2\fR, \fB.u3\fR, \fB.u4\fR,
+.br
+\&\fB.ul\fR, \fB.al\fR, \fB.lu\fR, \fB.la\fR,
+.br
+\&\fB.sb\fR, \fB.sw\fR, \fB.ub\fR, \fB.uw\fR
 .if t .sp -.5
 .if n .sp -1
 .TP
@@ -67,19 +73,19 @@
 Raw (headerless) audio files.  For
 .BR raw ,
 the sample rate and the data encoding must be given using command-line
-format options; for all other types, the sample rate defaults to 8kHz (but
-may be overridden), and the data encoding is defined by the given suffix.
-Thus \fBs1\fR, \fBs2\fR, \fBs3\fR, and \fBs4\fR indicate files encoded
-as 1, 2, 3, and 4-byte signed integer PCM respectively; \fBu1\fR,
-\fBu2\fR, \fBu3\fR, and \fBu4\fR indicate files encoded as 1, 2, 3, and
-4-byte unsigned integer PCM respectively; \fBul\fR indicates `\(*m-law'
-(byte), \fBal\fR indicates `A-law' (byte), and \fBlu\fR and \fBla\fR are
-inverse bit order `\(*m-law' and inverse bit order `A-law' respectively.
-\fBsb\fR, \fBsw\fR, \fBub\fR, \fBuw\fR, and \fBsl\fR are
-aliases for
-\fBs1\fR, \fBs2\fR, \fBu1\fR, \fBu2\fR, and \fBs4\fR respectively.
-For all raw formats, the number of channels defaults to 1 (but
-may be overridden).
+format options; for the other listed types, the sample rate defaults to
+8kHz (but may be overridden), and the data encoding is defined by the
+given suffix.  Thus \fBf4\fR and \fBf8\fR indicate files encoded as 4
+and 8-byte (IEEE single and double precision) floating point PCM
+respectively; \fBs1\fR, \fBs2\fR, \fBs3\fR, and \fBs4\fR indicate as 1,
+2, 3, and 4-byte signed integer PCM respectively; \fBu1\fR, \fBu2\fR,
+\fBu3\fR, and \fBu4\fR indicate as 1, 2, 3, and 4-byte unsigned integer
+PCM respectively; \fBul\fR indicates `\(*m-law' (byte), \fBal\fR
+indicates `A-law' (byte), and \fBlu\fR and \fBla\fR are inverse bit
+order `\(*m-law' and inverse bit order `A-law' respectively.  \fBsb\fR,
+\fBsw\fR, \fBub\fR, \fBuw\fR, and \fBsl\fR are aliases for \fBs1\fR,
+\fBs2\fR, \fBu1\fR, \fBu2\fR, and \fBs4\fR respectively.  For all raw
+formats, the number of channels defaults to 1 (but may be overridden).
 .SP
 Headerless audio files on a SPARC computer are likely to be of format
 \fBul\fR;  on a Mac, they're likely to be \fBu1\fR but with a
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -31,17 +31,18 @@
   earwax          mcompand        polyphas        splice
 )
 set(formats_srcs
-  8svx            cvsd-fmt        ima-fmt         s2-fmt          u2-fmt
-  adpcm           dat             ima_rw          s3-fmt          u3-fmt
-  adpcms          dvms-fmt        la-fmt          s4-fmt          u4-fmt
-  aifc-fmt        g711            lpc10.c         sf              ul-fmt
-  aiff            g721            lu-fmt          skelform        voc
-  aiff-fmt        g723_24         maud            smp             vox
-  al-fmt          g723_40         nulfile         sounder         vox-fmt
-  au              g72x            prc             soundtool       wav
-  avr             gsm.c           raw             sphere          wve
-  cdr             hcom            raw-fmt         tx16w           xa
-  cvsd            htk             s1-fmt          u1-fmt
+  8svx            dat             ima-fmt         s3-fmt          u4-fmt
+  adpcm           dvms-fmt        ima_rw          s4-fmt          ul-fmt
+  adpcms          f4-fmt          la-fmt          sf              voc
+  aifc-fmt        f8-fmt          lpc10.c         skelform        vox
+  aiff            g711            lu-fmt          smp             vox-fmt
+  aiff-fmt        g721            maud            sounder         wav
+  al-fmt          g723_24         nulfile         soundtool       wve
+  au              g723_40         prc             sphere          xa
+  avr             g72x            raw             tx16w
+  cdr             gsm.c           raw-fmt         u1-fmt
+  cvsd            hcom            s1-fmt          u2-fmt
+  cvsd-fmt        htk             s2-fmt          u3-fmt
 )
 add_library(lib${PROJECT_NAME}
   effects                 ${formats_srcs}         ${optional_srcs}
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -48,11 +48,16 @@
 	  libsox_fmt_sphere.la libsox_fmt_txw.la libsox_fmt_voc.la	\
 	  libsox_fmt_vox.la libsox_fmt_ima.la libsox_fmt_wav.la		\
 	  libsox_fmt_wve.la libsox_fmt_xa.la libsox_fmt_nul.la \
-	  libsox_fmt_htk.la libsox_fmt_sounder.la libsox_fmt_soundtool.la
+	  libsox_fmt_htk.la libsox_fmt_sounder.la libsox_fmt_soundtool.la \
+	  libsox_fmt_f4.la libsox_fmt_f8.la
 
 # File formats
 libsox_fmt_raw_la_SOURCES = raw-fmt.c
 libsox_fmt_raw_la_LIBADD = libsox.la
+libsox_fmt_f4_la_SOURCES = f4-fmt.c
+libsox_fmt_f4_la_LIBADD = libsox.la
+libsox_fmt_f8_la_SOURCES = f8-fmt.c
+libsox_fmt_f8_la_LIBADD = libsox.la
 libsox_fmt_s1_la_SOURCES = s1-fmt.c
 libsox_fmt_s1_la_LIBADD = libsox.la
 libsox_fmt_s2_la_SOURCES = s2-fmt.c
@@ -256,7 +261,7 @@
     lu-fmt.c 8svx.c aiff-fmt.c aifc-fmt.c au.c avr.c cdr.c cvsd-fmt.c \
     dvms-fmt.c dat.c gsm.c hcom.c htk.c lpc10.c maud.c prc.c sf.c smp.c \
     sounder.c soundtool.c sphere.c tx16w.c voc.c vox-fmt.c ima-fmt.c adpcm.c adpcm.h \
-    ima_rw.c ima_rw.h wav.c wve.c xa.c nulfile.c
+    ima_rw.c ima_rw.h wav.c wve.c xa.c nulfile.c f4-fmt.c f8-fmt.c
 libsox_la_LIBADD = @GSM_LIBS@ @LIBGSM_LIBADD@
 libsox_la_LIBADD += ../lpc10/liblpc10.la
 
--- /dev/null
+++ b/src/f4-fmt.c
@@ -1,0 +1,21 @@
+/* libSoX file formats: raw         (c) 2007-8 SoX contributors
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at
+ * your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "sox_i.h"
+#include "raw.h"
+
+RAW_FORMAT(f4, 32, 0, FLOAT)
--- /dev/null
+++ b/src/f8-fmt.c
@@ -1,0 +1,21 @@
+/* libSoX file formats: raw         (c) 2007-8 SoX contributors
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at
+ * your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "sox_i.h"
+#include "raw.h"
+
+RAW_FORMAT(f8, 64, 0, FLOAT)
--- a/src/formats.h
+++ b/src/formats.h
@@ -26,6 +26,8 @@
   FORMAT(cvsd)
   FORMAT(dat)
   FORMAT(dvms)
+  FORMAT(f4)
+  FORMAT(f8)
   FORMAT(gsm)
   FORMAT(hcom)
   FORMAT(htk)