Can I use SoX to generate sound?

For the project I'm working on, I need to use the SoX tool to generate sound. If there is a way to use SoX to create specific notes / tones for a specific duration, let me know! I have done quite a bit of research on this subject to no avail.

Also, is there any way to make it output directly to your columns? I think something like redirecting to / dev / audio.

+6
source share
1 answer

You can synthesize sound effects with synth and -n . For example, the following command creates a 3 second sine wav at 500 Hz:

 sox -n -r 8000 output.wav synth 3 sine 500 

You can set the sampling rate using the -r option. The default value is 48 kHz.

You can play audio directly in / dev / audio. If you just need to play the file and not save it, you can use the play utility (provided by sox) as follows:

 play -n -c1 synth 3 sine 500 
+10
source

Source: https://habr.com/ru/post/970882/


All Articles