audiochnl
v0.0.10
Published
AudioChnl - One Audio object, multiple effects. Easy.
Downloads
4
Readme
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();