Error on say when output format is wave
Asked Answered
B

1

22

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?

Bowes answered 15/3, 2012 at 22:30 Comment(0)
V
42

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"
Volvox answered 16/3, 2012 at 4:51 Comment(3)
By the way you can use say -o hi.wav --data-format=LEF32@32000 "hello" to increase the sample rate and final quality.Orlandoorlanta
@DariusMorawiec 32000 is better than 8000, but the native sample rate of most macOS voices is either 22050 Hz or 11025, so anything beyond 22050 will just get you upsampled audio.Parse
10x. BSR the inference doesn't work for ".wav" on Ventura. Seems never worked.Wack

© 2022 - 2024 — McMap. All rights reserved.