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!
About the author
I'm currently working on short form content at ClickHouse. I publish short 5 minute videos showing how to solve data problems on YouTube @LearnDataWithMark. I previously worked on graph analytics at Neo4j, where I also co-authored the O'Reilly Graph Algorithms Book with Amy Hodler.