Error on say when output format is wave

simbara picture simbara · Mar 15, 2012 · Viewed 7k times · Source

I am trying to create wave files using mac's say command, however, I get the following error:

$ say "hello" -o hi.wav

Opening output file failed: fmt?

although,

$ say --file-format=?

WAVE WAVE (.wav) [lpcm,ulaw,alaw]

Is there some way I can get say to output a wave file?

Answer

Gordon Davisson picture Gordon Davisson · Mar 16, 2012

It infers the file format from the file extension, but you need to specify the data format:

say -o hi.wav --data-format=LEF32@22050 "hello"