ahdinosaur / read-audio

:microphone: Read raw audio input as a stream of ndsamples
http://livejs.github.io/read-audio/
10 stars 2 forks source link

Validate bufferSize option #9

Open binarykitchen opened 8 years ago

binarykitchen commented 8 years ago

It must be a power of two.

Something like this would be cool

var isPOT = require('is-power-of-two')

if (!isPOT(bufferSize))
    throw new Error('Audio buffer size must be a power of two.')