## Generate a simple sound file at 440 Hz
s <- synth(cf=440, f= 8000, d=1, output="Wave")
savewav(s, file="mysound.wav")
## Plays the file
sox("mysound.wav", exe="play")
## Slows down the audio tempo (but not its pitch)
sox("mysound.wav myslowsound.wav tempo 0.5")
## Cuts the file
sox("myslowsound.wav myslowcuttedsound.wav trim 0.25, 0.75")
## Deletes example files
file.remove("mysound.wav", "myslowsound.wav", "myslowcuttedsound.wav")
Run the code above in your browser using DataLab