diff -C 2 -N work:sox/sox6pl8/Makefile.ami work:sox/Makefile.ami *** work:sox/sox6pl8/Makefile.ami Wed Feb 3 21:50:06 1993 --- work:sox/Makefile.ami Tue Mar 16 00:56:27 1993 *************** *** 7,13 **** ## Choose the version you wish to compile with: ## -f Makefile.ami (for basic version) ! ## -f Makefile.ami CPU=030 (for 68030 version) ## -f Makefile.ami FPU=881 (for 68881 FPU version) ! ## -f Makefile.ami CPU=030 FPU=881 (for 030/881 version) ## ## Note: This makefile does not work with SAS's 'smake' utility, because --- 7,13 ---- ## Choose the version you wish to compile with: ## -f Makefile.ami (for basic version) ! ## -f Makefile.ami CPU=020 (for 68020 version) ## -f Makefile.ami FPU=881 (for 68881 FPU version) ! ## -f Makefile.ami CPU=020 FPU=881 (for 020/881 version) ## ## Note: This makefile does not work with SAS's 'smake' utility, because *************** *** 18,22 **** FSRC= raw.c voc.c au.c sf.c aiff.c hcom.c 8svx.c sndrtool.c wav.c smp.c auto.c ! ESRC= copy.c avg.c pred.c stat.c vibro.c echo.c rate.c band.c lowp.c reverse.c PSRC= sox.c --- 18,23 ---- FSRC= raw.c voc.c au.c sf.c aiff.c hcom.c 8svx.c sndrtool.c wav.c smp.c auto.c ! ESRC= copy.c avg.c pred.c stat.c vibro.c echo.c rate.c band.c lowp.c \ ! highp.c reverse.c PSRC= sox.c *************** *** 40,44 **** FOBJ= raw.o voc.o au.o sf.o aiff.o hcom.o 8svx.o sndrtool.o wav.o \ smp.o auto.o ! EOBJ= copy.o avg.o pred.o stat.o vibro.o echo.o rate.o band.o lowp.o reverse.o ##SOUNDLIB is defined below --- 41,46 ---- FOBJ= raw.o voc.o au.o sf.o aiff.o hcom.o 8svx.o sndrtool.o wav.o \ smp.o auto.o ! EOBJ= copy.o avg.o pred.o stat.o vibro.o echo.o rate.o band.o lowp.o \ ! highp.o reverse.o ##SOUNDLIB is defined below *************** *** 49,53 **** ## ## ! ## Amiga vars for SAS 6.1. ## Lots of funky stuff here. Unnecessary, but keeps it neat. ## Also matches unix makefile more closely. --- 51,55 ---- ## ## ! ## Amiga vars for SAS 6.2. ## Lots of funky stuff here. Unnecessary, but keeps it neat. ## Also matches unix makefile more closely. *************** *** 62,66 **** MATH881 = MATH=68881 CPUF = ! CPUF030 = CPU=68030 MATHLIB = lib:scm.lib MATHLIB881 = lib:scm881.lib --- 64,68 ---- MATH881 = MATH=68881 CPUF = ! CPUF020 = CPU=68020 MATHLIB = lib:scm.lib MATHLIB881 = lib:scm881.lib *************** *** 67,71 **** DEFS = DEFS881 = DEF=AMIGA_MC68881 ! DEFS030 = DEF=AMIGA_MC68030 ## SOX = sox$(CPU)$(FPU) --- 69,73 ---- DEFS = DEFS881 = DEF=AMIGA_MC68881 ! DEFS020 = DEF=AMIGA_MC68020 ## SOX = sox$(CPU)$(FPU) *************** *** 93,107 **** #CFLAGS += $(O) MATH=68881 DEF=AMIGA DEF=AMIGA_MC68881 ## ! ## 68030, no FPU ! #SOX = sox030 ! #SOUNDLIB= libst030.lib #MATHLIB = lib:scm.lib ! #CFLAGS += $(O) CPU=68030 DEF=AMIGA ## ! ## 68030, 68881 FPU ! #SOX = sox030881 ! #SOUNDLIB= libst030881.lib #MATHLIB = lib:scm881.lib lib:scm.lib ! #CFLAGS += $(O) MATH=68881 CPU=68030 DEF=AMIGA DEF=AMIGA_MC68881 ## --- 95,109 ---- #CFLAGS += $(O) MATH=68881 DEF=AMIGA DEF=AMIGA_MC68881 ## ! ## 68020, no FPU ! #SOX = sox020 ! #SOUNDLIB= libst020.lib #MATHLIB = lib:scm.lib ! #CFLAGS += $(O) CPU=68020 DEF=AMIGA ## ! ## 68020, 68881 FPU ! #SOX = sox020881 ! #SOUNDLIB= libst020881.lib #MATHLIB = lib:scm881.lib lib:scm.lib ! #CFLAGS += $(O) MATH=68881 CPU=68020 DEF=AMIGA DEF=AMIGA_MC68881 ## *************** *** 118,125 **** sox.o: sox.c st.h ! sox.txt: sox.man $(RM) sox.txt ! nroff -man sox.man > sox.txt ! nroff -man st.man > st.txt clean: --- 120,127 ---- sox.o: sox.c st.h ! sox.txt: sox.man st.man $(RM) sox.txt ! nroff -man sox.man | col > sox.txt ! nroff -man st.man | col > st.txt clean: diff -C 2 -N work:sox/sox6pl8/Makefile.unx work:sox/Makefile.unx *** work:sox/sox6pl8/Makefile.unx Wed Feb 3 21:50:30 1993 --- work:sox/Makefile.unx Mon Mar 15 19:52:21 1993 *************** *** 5,9 **** FSRC= raw.c voc.c au.c sf.c aiff.c hcom.c 8svx.c sndrtool.c wav.c \ smp.c sbdsp.c auto.c ! ESRC= copy.c avg.c pred.c stat.c vibro.c echo.c rate.c band.c lowp.c reverse.c PSRC= sox.c --- 5,10 ---- FSRC= raw.c voc.c au.c sf.c aiff.c hcom.c 8svx.c sndrtool.c wav.c \ smp.c sbdsp.c auto.c ! ESRC= copy.c avg.c pred.c stat.c vibro.c echo.c rate.c band.c lowp.c \ ! highp.c reverse.c PSRC= sox.c *************** *** 12,16 **** HEADERS = st.h libst.h sfheader.h patchlvl.h ! TESTS = tests.sh monkey.au monkey.voc MISC = README INSTALL TODO sox.man sox.txt st.man Makefile.unx \ --- 13,17 ---- HEADERS = st.h libst.h sfheader.h patchlvl.h ! TESTS = tests.sh testall.sh monkey.au monkey.voc MISC = README INSTALL TODO sox.man sox.txt st.man Makefile.unx \ *************** *** 28,32 **** FOBJ= raw.o voc.o au.o sf.o aiff.o hcom.o 8svx.o sndrtool.o wav.o \ smp.o sbdsp.o auto.o ! EOBJ= copy.o avg.o pred.o stat.o vibro.o echo.o rate.o band.o lowp.o reverse.o SOUNDLIB = libst.a --- 29,34 ---- FOBJ= raw.o voc.o au.o sf.o aiff.o hcom.o 8svx.o sndrtool.o wav.o \ smp.o sbdsp.o auto.o ! EOBJ= copy.o avg.o pred.o stat.o vibro.o echo.o rate.o band.o lowp.o \ ! highp.o reverse.o SOUNDLIB = libst.a *************** *** 63,71 **** O=-g # optimization flags ! CFLAGS = $O -DSYSV -DBLASTER ! CC = gcc -fpcc-struct-return ! CC = cc ! AR = ar r ! RANLIB = ar ts # AT&T System V --- 65,73 ---- O=-g # optimization flags ! # CFLAGS = $O -DSYSV -DBLASTER -Di386 ! # CC = cc ! # CC = gcc -fpcc-struct-return -ansi -Dunix ! # AR = ar r ! # RANLIB = ar ts # AT&T System V *************** *** 73,77 **** # CFLAGS = $O -DSYSV # Gcc is better, of course, if you have it ! # CC = gcc -fpcc-struct-return # CC = cc # AR = ar r --- 75,79 ---- # CFLAGS = $O -DSYSV # Gcc is better, of course, if you have it ! # CC = gcc -ansi -Dunix -fpcc-struct-return # CC = cc # AR = ar r *************** *** 82,85 **** --- 84,88 ---- # CFLAGS = $O + # CC = gcc -ansi -Dunix # CC = cc # AR = ar r *************** *** 89,93 **** # CFLAGS = $O -I/usr/src/sys -DSBLAST ! # CC = /usr/local/bin/gcc # AR = ar r # RANLIB = ranlib --- 92,96 ---- # CFLAGS = $O -I/usr/src/sys -DSBLAST ! # CC = /usr/local/bin/gcc -ansi -Dunix # AR = ar r # RANLIB = ranlib *************** *** 107,113 **** $(LIBOBJS): st.h ! sox.txt: sox.man rm -f sox.txt nroff -man sox.man | col > sox.txt clean: --- 110,117 ---- $(LIBOBJS): st.h ! sox.txt: sox.man st.man rm -f sox.txt nroff -man sox.man | col > sox.txt + nroff -man st.man | col > st.txt clean: diff -C 2 -N work:sox/sox6pl8/README work:sox/README *** work:sox/sox6pl8/README Wed Feb 3 21:50:18 1993 --- work:sox/README Mon Mar 15 19:54:06 1993 *************** *** 132,135 **** --- 132,137 ---- Ken Kubo ken@hmcvax.claremont.edu VMS port, VOC stereo support + Frank Gadegast + Microsoft C 7.0 port Matthew Stier of Sun East contributed a version for diff -C 2 -N work:sox/sox6pl8/amiga.h work:sox/amiga.h *** work:sox/sox6pl8/amiga.h Wed Feb 3 21:50:08 1993 --- work:sox/amiga.h Tue Mar 16 00:57:05 1993 *************** *** 14,18 **** #define AmiVerChars1 {'$', 'V', 'E', 'R', ':', ' ', 'S', 'o', 'u', 'n', 'd', ' ', 'E', 'x', 'c', 'h', 'a', 'n', 'g', 'e', ' ', ! #define AmiVerChars2 '6', '8', '0', '3', '0', #define AmiVerChars3 '/', #define AmiVerChars4 '6', '8', '8', '8', '1', --- 14,18 ---- #define AmiVerChars1 {'$', 'V', 'E', 'R', ':', ' ', 'S', 'o', 'u', 'n', 'd', ' ', 'E', 'x', 'c', 'h', 'a', 'n', 'g', 'e', ' ', ! #define AmiVerChars2 '6', '8', '0', '2', '0', #define AmiVerChars3 '/', #define AmiVerChars4 '6', '8', '8', '8', '1', *************** *** 19,33 **** #define AmiVerChars5 ' ', 'P', 'a', 't', 'c', 'h', 'l', 'e', 'v', 'e', 'l', ' ', '0'+PATCHLEVEL, '\0'} #ifdef AMIGA_MC68881 ! #ifdef AMIGA_MC68030 #define AmiVerChars AmiVerChars1 AmiVerChars2 AmiVerChars3 AmiVerChars4 AmiVerChars5 #else #define AmiVerChars AmiVerChars1 AmiVerChars4 AmiVerChars5 ! #endif /* AMIGA_MC68030 */ #else ! #ifdef AMIGA_MC68030 #define AmiVerChars AmiVerChars1 AmiVerChars2 AmiVerChars5 #else #define AmiVerChars AmiVerChars1 AmiVerChars5 ! #endif /* AMIGA_MC68030 */ #endif /*AMIGA_MC68881*/ --- 19,33 ---- #define AmiVerChars5 ' ', 'P', 'a', 't', 'c', 'h', 'l', 'e', 'v', 'e', 'l', ' ', '0'+PATCHLEVEL, '\0'} #ifdef AMIGA_MC68881 ! #ifdef AMIGA_MC68020 #define AmiVerChars AmiVerChars1 AmiVerChars2 AmiVerChars3 AmiVerChars4 AmiVerChars5 #else #define AmiVerChars AmiVerChars1 AmiVerChars4 AmiVerChars5 ! #endif /* AMIGA_MC68020 */ #else ! #ifdef AMIGA_MC68020 #define AmiVerChars AmiVerChars1 AmiVerChars2 AmiVerChars5 #else #define AmiVerChars AmiVerChars1 AmiVerChars5 ! #endif /* AMIGA_MC68020 */ #endif /*AMIGA_MC68881*/ diff -C 2 -N work:sox/sox6pl8/echo.c work:sox/echo.c *** work:sox/sox6pl8/echo.c Wed Feb 3 21:52:22 1993 --- work:sox/echo.c Mon Mar 15 19:52:23 1993 *************** *** 28,32 **** */ ! #ifdef __STDC__ #include /* Harmless, and prototypes atof() etc. --dgc */ #endif --- 28,32 ---- */ ! #ifdef AMIGA #include /* Harmless, and prototypes atof() etc. --dgc */ #endif diff -C 2 -N work:sox/sox6pl8/getopt.c work:sox/getopt.c *** work:sox/sox6pl8/getopt.c Wed Feb 3 21:50:44 1993 --- work:sox/getopt.c Mon Mar 15 19:52:24 1993 *************** *** 46,49 **** --- 46,55 ---- #include + #ifdef SYSV + #include + #define index strchr + #else + #include + #endif #include "st.h" diff -C 2 -N work:sox/sox6pl8/handlers.c work:sox/handlers.c *** work:sox/sox6pl8/handlers.c Wed Feb 3 21:50:42 1993 --- work:sox/handlers.c Mon Mar 15 19:52:25 1993 *************** *** 216,219 **** --- 216,220 ---- extern band_getopts(), band_start(), band_flow(), band_stop(); extern lowp_getopts(), lowp_start(), lowp_flow(), lowp_stop(); + extern highp_getopts(), highp_start(), highp_flow(), highp_stop(); extern echo_getopts(), echo_start(), echo_flow(), echo_drain(), echo_stop(); extern rate_getopts(), rate_start(), rate_flow(), rate_stop(); *************** *** 247,250 **** --- 248,253 ---- {"lowp", 0, lowp_getopts, lowp_start, lowp_flow, null_drain, lowp_stop}, + {"highp", 0, + highp_getopts, highp_start, highp_flow, null_drain, highp_stop}, {"rate", EFF_RATE, rate_getopts, rate_start, rate_flow, null_drain, nothing}, diff -C 2 -N work:sox/sox6pl8/hcom.c work:sox/hcom.c *** work:sox/sox6pl8/hcom.c Wed Feb 3 21:50:36 1993 --- work:sox/hcom.c Mon Mar 15 19:52:26 1993 *************** *** 19,23 **** #ifdef __STDC__ - #include /* #include --- 19,22 ---- *************** *** 24,27 **** --- 23,27 ---- */ #else + #include IMPORT char *malloc(), *realloc(); #endif diff -C 2 -N work:sox/sox6pl8/highp.c work:sox/highp.c *** work:sox/sox6pl8/highp.c --- work:sox/highp.c Mon Mar 15 19:52:27 1993 *************** *** 0 **** --- 1,102 ---- + + /* + * July 5, 1991 + * Copyright 1991 Lance Norskog And Sundry Contributors + * This source code is freely redistributable and may be used for + * any purpose. This copyright notice must be maintained. + * Lance Norskog And Sundry Contributors are not responsible for + * the consequences of using this software. + */ + + /* + * Sound Tools High-Pass effect file. + * + * Algorithm: 1nd order filter. + * From Fugue source code: + * + * output[N] = B * (output[N-1] - input[N-1] + input[N]) + * + * A = 2.0 * pi * center + * B = exp(-A / frequency) + */ + + #include + #include "st.h" + + /* Private data for Highpass effect */ + typedef struct highpstuff { + float center; + double A, B; + double in1; + } *highp_t; + + /* + * Process options + */ + highp_getopts(effp, n, argv) + eff_t effp; + int n; + char **argv; + { + highp_t highp = (highp_t) effp->priv; + + if ((n < 1) || !sscanf(argv[0], "%f", &highp->center)) + fail("Usage: highp center"); + } + + /* + * Prepare processing. + */ + highp_start(effp) + eff_t effp; + { + highp_t highp = (highp_t) effp->priv; + if (highp->center > effp->ininfo.rate*2) + fail("Highpass: center must be < minimum data rate*2\n"); + + highp->A = (M_PI * 2.0 * highp->center) / effp->ininfo.rate; + highp->B = exp(-highp->A / effp->ininfo.rate); + highp->in1 = 0.0; + } + + /* + * Processed signed long samples from ibuf to obuf. + * Return number of samples processed. + */ + + highp_flow(effp, ibuf, obuf, isamp, osamp) + eff_t effp; + long *ibuf, *obuf; + int *isamp, *osamp; + { + highp_t highp = (highp_t) effp->priv; + int len, done; + double d; + long l; + + len = ((*isamp > *osamp) ? *osamp : *isamp); + + /* yeah yeah yeah registers & integer arithmetic yeah yeah yeah */ + for(done = 0; done < len; done++) { + l = *ibuf++; + d = (highp->B * ((d - highp->in1) + l)) / 65536; + d *= 0.8; + if (d > 32767) + d = 32767; + if (d < - 32767) + d = - 32767; + highp->in1 = l; + *obuf++ = d * 65536; + } + } + + /* + * Do anything required when you stop reading samples. + * Don't close input file! + */ + highp_stop(effp) + eff_t effp; + { + /* nothing to do */ + } + diff -C 2 -N work:sox/sox6pl8/patchlvl.h work:sox/patchlvl.h *** work:sox/sox6pl8/patchlvl.h Wed Feb 3 21:50:32 1993 --- work:sox/patchlvl.h Mon Mar 15 19:52:28 1993 *************** *** 1 **** ! #define PATCHLEVEL 7 --- 1 ---- ! #define PATCHLEVEL 9 diff -C 2 -N work:sox/sox6pl8/reverse.c work:sox/reverse.c *** work:sox/sox6pl8/reverse.c Wed Feb 3 21:50:42 1993 --- work:sox/reverse.c Mon Mar 15 19:52:29 1993 *************** *** 13,18 **** */ - #include "st.h" #include IMPORT FILE *tmpfile(); --- 13,18 ---- */ #include + #include "st.h" IMPORT FILE *tmpfile(); diff -C 2 -N work:sox/sox6pl8/sbdsp.c work:sox/sbdsp.c *** work:sox/sox6pl8/sbdsp.c Wed Feb 3 21:52:18 1993 --- work:sox/sbdsp.c Mon Mar 15 19:52:30 1993 *************** *** 1,2 **** --- 1,5 ---- + + char ansi_c_is_very_stupid_and_needs_a_variable_here; + #if defined(BLASTER) || defined(SBLAST) /* diff -C 2 -N work:sox/sox6pl8/smp.c work:sox/smp.c *** work:sox/sox6pl8/smp.c Wed Feb 3 21:52:18 1993 --- work:sox/smp.c Mon Mar 15 19:52:31 1993 *************** *** 16,20 **** --- 16,22 ---- #include "st.h" + #ifndef __STDC__ #include + #endif #define NAMELEN 30 /* Size of Samplevision name */ diff -C 2 -N work:sox/sox6pl8/sox.man work:sox/sox.man *** work:sox/sox6pl8/sox.man Wed Feb 3 21:50:20 1993 --- work:sox/sox.man Tue Mar 16 04:47:00 1993 *************** *** 63,66 **** --- 63,70 ---- .br band \fB[ \fI-n \fB] \fIcenter \fB[ \fIwidth\fB ] + .br + highp \fIcenter\fB + .br + reverse .SH DESCRIPTION .I Sox *************** *** 378,382 **** .I center frequency and settling around it. ! .P .I Sox enforces certain effects. --- 382,395 ---- .I center frequency and settling around it. ! .TP 30 ! highp \fIcenter ! Apply a high-pass filter. See the ! .B lowp ! effect for more info. ! .TP 30 ! reverse ! Reverse the sample sequence in a soundfile, so ! that the sound plays "backwards". ! .PP .I Sox enforces certain effects. *************** *** 403,414 **** .SH SEE ALSO .SH NOTICES ! The echoplex effect is: ! Copyright (C) 1989 by Jef Poskanzer. ! ! Permission to use, copy, modify, and distribute this software and its ! documentation for any purpose and without fee is hereby granted, provided ! that the above copyright notice appear in all copies and that both that ! copyright notice and this permission notice appear in supporting ! documentation. This software is provided "as is" without express or ! implied warranty. --- 416,425 ---- .SH SEE ALSO .SH NOTICES ! The echoplex effect is Copyright (C) 1989 by Jef Poskanzer. + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation. This software is provided "as is" without express or + implied warranty. diff -C 2 -N work:sox/sox6pl8/st.h work:sox/st.h *** work:sox/sox6pl8/st.h Wed Feb 3 21:50:30 1993 --- work:sox/st.h Mon Mar 15 19:52:32 1993 *************** *** 7,10 **** --- 7,11 ---- * the consequences of using this software. */ + #ifdef VAXC #define IMPORT globalref *************** *** 165,169 **** IMPORT void report(P2(char *, ...)), fail(P2(char *, ...)); ! #if defined(SYSV) || defined(DOS) #define bcopy(from, to, len) memcpy(to, from, len) #define index strchr --- 166,170 ---- IMPORT void report(P2(char *, ...)), fail(P2(char *, ...)); ! #if defined(SYSV) || defined(DOS) || defined(__STDC__) #define bcopy(from, to, len) memcpy(to, from, len) #define index strchr *************** *** 215,219 **** --- 216,222 ---- extern errno; extern char *sys_errlist[]; + #if defined(i386) || !defined(__STDC__) #define strerror(errno) sys_errlist[errno] + #endif #endif diff -C 2 -N work:sox/sox6pl8/wav.c work:sox/wav.c *** work:sox/sox6pl8/wav.c Wed Feb 3 21:50:38 1993 --- work:sox/wav.c Mon Mar 15 19:52:34 1993 *************** *** 9,14 **** */ - /* TODO: FIX 16 bits samples to be signed instead of unsigned */ - /* * Windows 3.0 .wav format driver --- 9,12 ---- *************** *** 15,18 **** --- 13,24 ---- */ + /* + * Fixed by various contributors: + * 1) Little-endian handling + * 2) Skip other kinds of file data + * 3) Handle 16-bit formats correctly + * 4) Not go into infinite loop + */ + #include "st.h" *************** *** 38,41 **** --- 44,53 ---- char magic[4]; long len; + int littlendian = 1; + char *endptr; + char c; + + endptr = (char *) &littlendian; + if (!*endptr) ft->swap = 1; /* If you need to seek around the input file. */ *************** *** 55,59 **** fread(magic, 4, 1, ft->fp); if (strncmp("fmt ", magic, 4)) ! fail("Missing fmt spec"); len = rllong(ft); --- 67,80 ---- fread(magic, 4, 1, ft->fp); if (strncmp("fmt ", magic, 4)) ! if (strncmp("LIST", magic, 4)) ! fail("Missing fmt spec"); ! else { ! for (len = rllong(ft);len--;len>0) ! fread(&c,1,1,ft->fp); ! fread(magic, 4, 1, ft->fp); ! if (strncmp("fmt ", magic, 4)) ! fail("Missing fmt spec"); ! } ! len = rllong(ft); *************** *** 60,64 **** switch (rlshort(ft)) { ! case 1: ft->info.style = UNSIGNED; break; default: fail("Don't understand format"); } --- 81,85 ---- switch (rlshort(ft)) { ! case 1: break; default: fail("Don't understand format"); } *************** *** 69,79 **** switch (rlshort(ft)) { ! case 8: ft->info.size = BYTE; break; ! case 16: ft->info.size = WORD; break; ! case 32: ft->info.size = LONG; break; default: fail("Don't understand size"); } len -= 16; ! while (len) getc(ft->fp); fread(magic, 4, 1, ft->fp); --- 90,100 ---- switch (rlshort(ft)) { ! case 8: ft->info.size = BYTE; ft->info.style = UNSIGNED; break; ! case 16: ft->info.size = WORD; ft->info.style = SIGN2; break; ! case 32: ft->info.size = LONG; ft->info.style = SIGN2; break; default: fail("Don't understand size"); } len -= 16; ! while (--len >= 0) getc(ft->fp); fread(magic, 4, 1, ft->fp); *************** *** 118,122 **** { wav_t wav = (wav_t) ft->priv; ! int littlendian = 0; char *endptr; --- 139,143 ---- { wav_t wav = (wav_t) ft->priv; ! int littlendian = 1; char *endptr; *************** *** 125,130 **** endptr = (char *) &littlendian; ! *endptr = 1; ! if (!littlendian) ft->swap = 1; wav->samples = 0; --- 146,150 ---- endptr = (char *) &littlendian; ! if (!*endptr) ft->swap = 1; wav->samples = 0;