Skip to content

WaiChungWong/jw-audio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

A class which controls and manages the audio context.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published