AlgoSim
Homepage | Screenshots | Gallery of Visualisation | User's Guide | Function Reference | Download | FAQ | Support | Bugs and Solutions | Donate

Reference: reduceSound

reduceSound(snd, n), where snd is a sound and n is a positive integer, returns the sound whose samples are every nth sample of snd, and whose sample rate is set to (1/n)th of the sample rate of snd. Hence, the returned sound has the same duration (in seconds) as snd, and is equal to the sound one would have obtained by recording the physical sound at a sampling rate equal to (1/n)th of the sample rate used to record snd.

reduceSound(snd, n) amounts to the same thing as

samples ≔ sndGetSamples(snd)
samples ≔ reduceMatrix(samples, n)
snd ≔ sndMatrixToSound(samples, sndGetSampleRate(snd) / n)

but is faster.