· software-development

Unix: Getting the sound from 'say' as a wav file

I spent a bit of time yesterday afternoon working out how to get the output from the Unix command ‘say’ to be played whenever our build breaks.

We’re using cctray on a Windows box for that purpose which means that we need to have the file in the ‘wav’ format.

Unfortunately ‘say’ doesn’t seem to be able to output a file in that format:


> say "WARNING! Drainage has occurred, please fix it. Drainage has occurred, please fix it." --output-file drain.wav

Opening output file failed: fmt?

So I first converted it into a ‘wmv’:


> say "WARNING! Drainage has occurred, please fix it. Drainage has occurred, please fix it." --output-file drain.wmv

And then converted it into a ‘wav’ via media.io.

Sadly media.io doesn’t seem to have an API so I can’t fully automate it.

If anyone knows a service that does have an API let me know!

  • LinkedIn
  • Tumblr
  • Reddit
  • Google+
  • Pinterest
  • Pocket