Go to TogaWare.com Home Page. GNU/Linux Desktop Survival Guide
by Graham Williams
Duck Duck Go


  $ sox -t ossdsp -w -s -r 44100 -c 2 /dev/dsp recording.wav

Creating sounds with play and saving the sound to file with sox:

$ play -n synth 1 sin 234
$ play -n synth 1 sin 234 sin 345
$ sox -n sample.mp3 synth 1 sin 234 sin 345
$ play -n -c1 synth sin %-12 sin %-9 sin %-5 sin %-2 fade h 0.1 1 0.1

Here's a guessing game one liner, asking you to guess the frequency, courtesy of the Twitter account for Command Line Magic.

$ f=$(($RANDOM%5900+100));play -qn synth sin $f trim 0 0.75 vol .1;read -p "Hz(100-6000)? " g;printf "Hz=$f; Off by %d\n" $((f-g))

Copyright © 1995-2020 Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
Brought to you by Togaware and the author of open source software including Rattle and wajig.
Also the author of Data Mining with Rattle and Essentials of Data Science.