Red Hat Bugzilla – Bug 470558
Sox corrupts BE files
Last modified: 2015-02-01 17:48:26 EST
Description of problem:
Can not convert file from LE to BE properly. Resulting file has unrecognized format - xmms refuses to play it, aplay says:
Unsigned 8 bit, Rate 8000 Hz, Mono (really it is Stereo 96000 24bit BE)
and plays garbage.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Can you provide an example command line your using?
This may have been fixed in upstream SoX 14.1.0. The changelog refers to 24bit endian fix on big-endian systems.
o Fix 24-bit read/write on big-endian systems. (robs)
The related changeset fix contains many fixes and mentions some issues with endian flags on any platform; which is probably what your seeing.
The fix doesn't look easy to port back to 14.0.1.
Playing WAVE '24LE_96Khz_Stereo.wav' : Signed 24 bit Little Endian in 3bytes, Rate 96000 Hz, Stereo
sox 24LE_96Khz_Stereo.wav -c2 -r96000 -B -3 test.wav
Playing raw data 'test.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
OK, thanks for command line. As best I know, this is not a bug anywhere then. It is lack of a feature in aplay.
"Big endian" WAV files have a different header (start with RIFX instead of RIFF) and not all applications support them because they are rare.
It looks like aplay simply doesn't support RIFX files and confuses it for raw audio data. Probably, it would act the same way if you tried to play a text file.
I created a file with your above command line and verified that Audacity and SoX could both correctly read and play them.
I can confirm that sox plays that file correctly, but Audacity says file format is not recognized.
OK, I created both 16-bit and 24-bit Big Endian WAV files (RIFX) using SoX and verified that "aplay" can not play either. So its verified that aplay simply can not play any type of RIFX files. No bugs there.
Next, I tried loading both the 16-bit BE and 24-bit BE into audacity again. The 16-bit files loaded fine but the 24-bit file gave an error message and will not load them.
The headers of 16-bit vs. 24-bit WAV files are almost identical except for the part that says bit-width. So I suspect if SoX is creating correct 16-bits then its creating correct 24-bits.
I think Audacity uses libsndfile so I quickly browsed both source code in related areas. Its looks like libsndfile probably supports 24-bit RIFX files as I couldn't find any code to specifically deny it.
But it looks like Audacity has no options to create a 24-bit RIFX file so I could not find a way to create one and compare to SoX. At this time, I think its simply that no other program exists to support 24-bit RIFX files except for SoX.
24-bit files are not very common and RIFX are extremely uncommon. So putting them together makes it hard to find applications to test with.
I still think no bug exists in SoX at this time; especially with Fedora 10 version of SoX.
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '9'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 9's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 9 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
The process we are following is described here:
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.