Writing wav files to disk

### 26.2.4 Writing wav files to disk

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

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

1 |  |  |  |  |  |  |  |  |  |

The sounds directory now contains the file sine.wav.