Previous Up Next

5.26.3  Writing WAV files to disk: writewav

writewav takes two arguments, a string containing a file name and an audio clip object, and writes the clip to disk as a WAV file with the specified name. It returns 1 on success and 0 on failure.

For example, input:

s:=createwav(sin(2*pi*440*soundsec(1))):;
writewav("sounds/sine.wav",s)

Output:

1

Previous Up Next