Utility functions for Web Audio API
Node.js
npm install @mohayonao/web-audio-utils
activateCustomAudioNode(): void
activateMobileAutoPlay([ audioContext, callback ]): AudioContext
activateWebAudioAPI([ AudioContext, callback ]): AudioContext
createAudioBufferFromArray(array: Float32Array[], [ audioContext ]): AudioBuffer
createPeriodicWave(wave: object, [ audioContext ]): PeriodicWave
wave: { real: Float32Array, imag: Float32Array}
- this function is for wave-tables.
fetchAudioBuffer(path: string, [ audioContext ]): Promise<AudioBuffer>
- fetch && decode
getAudioContext(): AudioContext
- return an AudioContext as singleton
splitAudioBuffer(audioBuffer: AudioBuffer, n: number): AudioBuffer[]
MIT