Awesome
WEB AUDIO UTILS
Utility functions for Web Audio API
Installation
Node.js
npm install @mohayonao/web-audio-utils
API
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[]
License
MIT