Routines for sound.
Save and load WAV sound files. Analyze frequencies.
function soundsec (n:number, rate=22050) n seconds of parameter t with rate/sec ticks.
function savewave (filename:string, v:real vector, rate=22050, bits=16) Save a vector of sound data in WAV format. Return the length of the sample in seconds. If rate=0, the default sampling rate is taken. bits may be 8 or 16.
function loadwave (filename:string, rate=22050) Read a WAV file.
function analyzesound (w:real vector, fmin=10, fmax=1500, rate=22050, points=8192) Make a frequency plot of the signal w with sampling rate. The data must be at least points long. The maximal frequency plotted will be fmax, the minimal fmin.
function mapsound (w:real vector, dt=0.1, fmin=100, fmax=1500, simpl=1, rate=22050) Plots a sound map for a sound. It does FFT at time increments dt. rate is the sampling rate. simpl points are collected for speed reasons.
function playwave (s, rate=22050) play either a file with name s, or a vector of sound s. See:
soundsec (Sounds)