From: SourceForge.net <no...@so...> - 2011-10-10 20:46:18
|
Bugs item #3187663, was opened at 2011-02-21 03:21 Message generated for change (Settings changed) made by uklauer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110706&aid=3187663&group_id=10706 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed Resolution: None Priority: 5 Private: No Submitted By: William John Poser (billposer) Assigned to: Nobody/Anonymous (nobody) Summary: data format not specified when generating from scratch Initial Comment: When generating sound from scratch, where there is no input file to copy, if the desired output format is specified only via the extension, e.g. : "sox -n -r 48000 silence100.wav trim 0.0 0.100" linear PCM format is silently chosen but the sound format code in the format chunk is not set to a reasonable value. (sndfile-info reports it as 0x00130004.) Many programs handle the resulting files without any problem, but problems arise with those that check the format code. For example, the Monkey's Audio compressor identifies such files as ill-formed and declines to compress them. The code is correctly set if the -b and -e flags are used, e.g. sox -n -r 48000 -b 16 -e signed-integer silence100.wav trim 0.0 0.100. ---------------------------------------------------------------------- Comment By: William John Poser (billposer) Date: 2011-03-05 23:29 Message: Well, uklauer's explanation is helpful, but I have to question the default of 32 bits, which seems to fall afoul of the principle of least surprise. Surely 16 bits and non-extended WAV are far more common and what most people would expect. ---------------------------------------------------------------------- Comment By: Ulrich Klauer (uklauer) Date: 2011-02-22 22:54 Message: When you don't specify a target bit depth, the default is 32. This causes an Extensible WAV to be created instead of a "regular" (old) WAV file. According to http://www.mega-nerd.com/libsndfile/api.html, their internal format code 0x130004 stands for SF_FORMAT_WAVEX | SF_FORMAT_PCM_32, which seems to be correct. The format code in the WAV file itself is 0xFFFE (WAVE_FORMAT_EXTENSIBLE); the data format is stored down in the subformat field, and is PCM. So that seems to be OK. As to why Monkey's Audio cannot handle it, I currently see two possibilities: a) Monkey's Audio generally doesn't accept Extensible WAVs, or files with 32-bit samples. (I don't know.) b) It may have to do with the channel mask. You don't mention the SoX version you are using, but the latest release still created not-really-valid channel masks for Extensible WAVs. (sndfile-format complains like this: "Channel Mask : 0x0 (should not be zero)") This was fixed a few weeks ago by David Bryant. To test for b), please try compressing this test file: http://www.chirlu.de/temp/silence.wav I created it using your first SoX invocation, but with a recent CVS build of SoX. It contains a valid channel mask. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110706&aid=3187663&group_id=10706 |