I know how to play a tone for a specific amount of time using SOX.

play -n synth 5 sin 347

I know how to save a tone using SOX.

sox -n note.mp3 synth 5 sin 347

Question is : How can I save a longer tone (hours) without the sound actually playing and not actually having to wait hours for the file to generate?


Answer: @derobert pointed out the "sox" and "play" command are part of the same package but does different thing. The 3600 below is the time interval in seconds.

sox -n note.mp3 synth 3600 sin 347

The above code will generate an hour long tone without playing it.

play -n note.mp3 synth 3600 sin 347

The above code will play the tone for an hour AND save it to note.mp3

Thanks to @derobert, I should have tried this first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.