jw-audio

0.1.5 • Public • Published

jw-audio

A class which controls and manages the audio context.

NPM version build status node version npm download

Demo

Install

NPM

Props

Prop Description
destination the destination node of the audio context.

Methods

Method Parameters Description
createMediaSource url: string creates a media element source from a given url. The returned source node allows playback controls such as play, pause, set playback time, etc...
createBufferSource url: string creates a buffer source from a given url.
createLiveSource creates a live stream source by requesting user audio media.
createGain creates a gain node.
createAnalyser creates an analyser node.
createOscillator creates an oscillator node.
getFrequencyData analyser: analyser node generates an array of frequency data from a given analyser node.

Usage

import * as Audio from "jw-audio";
 
/** Retrieves the destination node from the audio context. */
let destination = Audio.destination;
 
/** Creates a media source from a url. */
let source = await Audio.createMediaSource("<url>");
 
/** Create an analyser node from the audio context. */
let analyser = Audio.createAnalyser();
 
/** Create an gain node from the audio context. */
let gain = Audio.createGain();
 
/** Create an live stream source node from the audio context. */
let liveSource = await Audio.createLiveSource();
 
/** Generates an array of frequency data from a given analyser node. */
let frequencyData = Audio.getFrequencyData(analyser);

Readme

Keywords

Package Sidebar

Install

npm i jw-audio

Weekly Downloads

1

Version

0.1.5

License

MIT

Unpacked Size

1.62 MB

Total Files

36

Last publish

Collaborators

  • johnwong