The currently stable media-sound/sox-12.17.9 loses the last sample when processing 2-channel 16-bit pcm .wav soundfiles with a odd number of samples Problem seems to be fixed in unstable media-sound/sox-14.0.0 as well as the previous unstable, media-sound/sox-13.0.0 Reproducible: Always Steps to Reproduce: >>> echo "UklGRjAAAABXQVZFZm10IBAAAAABAAIARKwAABCxAgAEABAAZGF0YQwAAAABEA/wAiAO4AMwDdA=" | base64 -d >test.wav >>> md5sum test.wav bc073b230966e3e3c05a085d2e5ebf00 test.wav >>> hexdump -C test.wav 00000000 52 49 46 46 30 00 00 00 57 41 56 45 66 6d 74 20 |RIFF0...WAVEfmt | 00000010 10 00 00 00 01 00 02 00 44 ac 00 00 10 b1 02 00 |........D.......| 00000020 04 00 10 00 64 61 74 61 0c 00 00 00 01 10 0f f0 |....data........| 00000030 02 20 0e e0 03 30 0d d0 |. ...0..| 00000038 # Commentary: The data is at the end, 3 sample-frames times 2 channels # is 6 16-bit samples, in little-endian format: # 1001, F00F, 2002, E00E, 3003, D00D >>> equery list sox [ Searching for package 'sox' in all categories among: ] * installed packages [I--] [ ] media-sound/sox-12.17.9 (0) # Commentary: use sox to convert the file to raw 16-bit form >>> sox -t .wav test.wav -t .raw -c 2 -s -w test.raw >>> hexdump -C test.raw 00000000 01 10 0f f0 02 20 0e e0 |..... ..| 00000008 # Commentary: Notice the last sample of each channel has been dropped Actual Results: 00000000 01 10 0f f0 02 20 0e e0 |..... ..| The last sample of each channel has been lost Expected Results: 00000000 01 10 0f f0 02 20 0e e0 03 30 0d d0 |..... ...0..| Converted all the samples. Try the same steps with unstable sox to show it works: >>> equery list sox [ Searching for package 'sox' in all categories among: ] * installed packages [I--] [ ~] media-sound/sox-14.0.0 (0) >>> sox -t .wav test.wav -t .raw -c 2 -s -w test.raw >>> hexdump -C test.raw 00000000 01 10 0f f0 02 20 0e e0 03 30 0d d0 |..... ...0..| 0000000c If for some reason it is decided not to stabilize the 14.* or 13.* versions, the following patch to wav.c also works: sox-12.17.9 >>> diff -c src/wav-orig.c src/wav.c *** src/wav-orig.c 2007-11-22 22:34:29.206250390 -0800 --- src/wav.c 2007-11-22 22:35:49.148905833 -0800 *************** *** 1150,1156 **** /* Only return buffers that contain a totally playable * amount of audio. */ ! done -= (done % (ft->info.channels * ft->info.size)); if (done/ft->info.channels > wav->numSamples) wav->numSamples = 0; else --- 1150,1156 ---- /* Only return buffers that contain a totally playable * amount of audio. */ ! done -= (done % ft->info.channels); if (done/ft->info.channels > wav->numSamples) wav->numSamples = 0; else ===== This change is supported by looking at the corresponding lines of the 14.0.0, where it appears the same thing was done.
Moving on, marking 14.0.0 stable. amd64 stable
x86 stable
ppc64 stable
ppc stable
Stable for HPPA.
alpha/sparc stable
Closing, Bug 192235 for mips re-keywording.