Previous Up Next

28.2.1  Creating audio clips

The createwav command creates an audio object with specified parameters.

Examples

(See Section 28.2.14 for a description of playsnd and Section 28.2.7 for a description of soundsec.)

playsnd(createwav(channel_data=sin(2*pi*440*soundsec(2)),samplerate=48000))

Output: Two seconds of the 440 Hz sine wave at rate 48000.

t:=soundsec(3):; L,R:=sin(2*pi*440*t),sin(2*pi*445*t):; s:=createwav([L,R]):; playsnd(s)

Output: Three seconds of a vibrato effect on a sine wave (stereo).


Previous Up Next