Writing a wav file: writewav

### 14.1.2 Writing a wav file: writewav

The writewav command writes sound data to a WAV file.

The writewav command takes two arguments; the name of a file and the sound data. The sound data can either be in the same format as that returned by the readwav command or (for a mono sound) a list of the digital data of the sound which will us the default parameters (16 bits, 44100 Hz).

writewav writes the sound to the named file.

Input:

writewav("la.wav",2^14*sin(2*pi*440*soundsec(1)))

The file la.wav will then contain a sound of frequency 440 Hz sampled 44100 times per second.