Writing wav files to disk: writewav

### 15.1.3 Writing wav files to disk: writewav

The writewav command writes wav files to disk.

- writewav takes two arguments:
  - filename, a string containing a file name.
  - A, an audio clip object.
- writewav(filename,A) writes the clip A as a wav file named filename.
  It returns 1 on success and 0 on failure.

#### Example

Input:

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

Output:

1

The sounds directory will contain the file sine.wav.