Skip to content

mohayonao/web-audio-utils

Repository files navigation

WEB AUDIO UTILS

Build Status NPM Version License

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

About

Utility functions for Web Audio API

Resources

Stars

Watchers

Forks

Packages

No packages published