I think this is important. Throw errors if any of these options have invalid values. For example
if (!isPOT(opts.buffer))
throw new Error('Audio buffer size must be a power of two.')
else if (!opts.volume || opts.volume > 1)
throw new Error('Audio volume must be between zero and one.')
of course, also validate the others wherever possible.
I think this is important. Throw errors if any of these options have invalid values. For example
of course, also validate the others wherever possible.