I want to record the output of Google Text to speech to a mp3 file. I need a command that I can use in Terminal. I read sox
can record audio, however don't know how to set up it to record the output audio of my computer. I also prefer to automatically stop recording if the audio output was silent for at least 3 seconds... Any other tool for this purpose is acceptable.
First you need to extract the name of output device:
To do this, you can install the following modules:
And run:
The output could be like this:
After you found the name, you can run the following command to record the output to an mp3 file:
Or using
sox
you can do the following, however I found the first solution more robust:However, if you want to automatically start and stop recording you can run:
Or using
parec
:It begins recording when a sounds sent to the speaker and stops if nothing is received after 3 seconds. for more information about sox refer to sox man page in linux