Previous Up Next

13.1.1  Reading a wav file: readwav

The readwav command takes as argument a sound file stored in WAV format (file extension: .wav), given as a string.

readwav returns a vector consisting of:

The result of readwav is typically stored in a variable.
For example, if sound.wav is a sound file for a one-second sound in CD quality on a 16-bit channel:
Input:

s := readwav("sound.wav")

then:

s[0]

Output:

[1,16,44100,88200]

Input:

size(s)

Output:

2

which is the number of channels plus 1.
Input:

size(s[1])

Output:

44100

Previous Up Next