We create WAV files from a TTS engine (NeoSpeech) on a Windows 2k3 server and execute Sox 14.3 (and 12.17.x) to convert them to headless-uLAW files. 99% of the time the conversion works just fine and an 8-bit 8KHz PCM wav file is converted to an 8-bit 8KHz mono headerless uLAW file.
However once in a while the SoX generates a 16-bit 48KHz PCM file despite the command-line param that explicitly expects the output in uLAW.
If the initial errant 8-bit 8kHz PCM is converted, using SoX, to 16kHz and then converted back to a uLAW the resultant file is perfectly formed.
A careful review of the fields in the PCM data struct, and the WaveFormatEx header, of the errant WAV file, is identical to any other PCM file (except the 4-byte size field) that is sent to SoX as input and generates the well-formed output uLAW file.
If anyone can explain why this happens we would be really grateful.
Log in to post a comment.