AudioChnl
One Audio object, multiple effects. Easy.
What is an AudioChnl?
It's an extension of the Chnl module: This module is made for playing, pausing, stopping and manipulating Audio-objects.
If you are not familiar with the Chnl module, Just have a look at it.
Usage
Creating an AudioChnl
The constructor requires 2 arguments:
- Your AudioContext
- Your Audio-object
const audioCtx = new AudioContext();
const audio = new Audio('song.mp3');
const audioChnl = new AudioChnl(audioCtx, audioObj);
Methods
.start()
.stop()
.pause()
Example
const audioCtx = new AudioContext();
const audio = new Audio('song.mp3');
const audioChnl = new AudioChnl(audioCtx, audioObj);
audioChnl.start();