0.1.5 • Published 5 years ago

jw-audio v0.1.5

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

jw-audio

A class which controls and manages the audio context.

NPM version build status node version npm download

Demo

Install

NPM

Props

PropDescription
destinationthe destination node of the audio context.

Methods

MethodParametersDescription
createMediaSourceurl: stringcreates a media element source from a given url. The returned source node allows playback controls such as play, pause, set playback time, etc...
createBufferSourceurl: stringcreates a buffer source from a given url.
createLiveSourcecreates a live stream source by requesting user audio media.
createGaincreates a gain node.
createAnalysercreates an analyser node.
createOscillatorcreates an oscillator node.
getFrequencyDataanalyser: analyser nodegenerates 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);
0.1.5

5 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago