BaseContext

Hierarchy

Properties

debug #

boolean

Set this debug flag to log all events that happen in this class.

disposed #

readonly boolean

Indicates if the instance was disposed. 'Disposing' an instance means that all of the Web Audio nodes that were created for the instance are disconnected and freed for garbage collection.

draw #

readonly Draw

name #

string

sampleRate #

readonly number

state #

readonly AudioContextState

transport #

readonly Transport

static version #

string

The version number semver

Methods

addAudioWorkletModule #

addAudioWorkletModule (
_url:string ,
_name:string
) => Promise<void >

clearInterval #

clearInterval (
_id:number
) => this

clearTimeout #

clearTimeout (
_id:number
) => this

createAnalyser #

createAnalyser ( ) => AnalyserNode

createAudioWorkletNode #

createAudioWorkletNode (
_name:string ,
_options?:Partial<AudioWorkletNodeOptions >
) => AudioWorkletNode

createBiquadFilter #

createBiquadFilter ( ) => BiquadFilterNode

createBuffer #

createBuffer (
_numberOfChannels:number ,
_length:number ,
_sampleRate:number
) => AudioBuffer

createBufferSource #

createBufferSource ( ) => AudioBufferSourceNode

createChannelMerger #

createChannelMerger (
_numberOfInputs?:number | undefined
) => ChannelMergerNode

createChannelSplitter #

createChannelSplitter (
_numberOfOutputs?:number | undefined
) => ChannelSplitterNode

createConstantSource #

createConstantSource ( ) => ConstantSourceNode

createConvolver #

createConvolver ( ) => ConvolverNode

createDelay #

createDelay (
_maxDelayTime?:number | undefined
) => DelayNode

createDynamicsCompressor #

createDynamicsCompressor ( ) => DynamicsCompressorNode

createGain #

createGain ( ) => GainNode

createIIRFilter #

createIIRFilter (
_feedForward:number [] | Float32Array ,
_feedback:number [] | Float32Array
) => IIRFilterNode

createMediaElementSource #

createMediaElementSource (
_element:HTMLMediaElement
) => MediaElementAudioSourceNode

createMediaStreamDestination #

createMediaStreamDestination ( ) => MediaStreamAudioDestinationNode

createMediaStreamSource #

createMediaStreamSource (
_stream:MediaStream
) => MediaStreamAudioSourceNode

createOscillator #

createOscillator ( ) => OscillatorNode

createPanner #

createPanner ( ) => PannerNode

createPeriodicWave #

createPeriodicWave (
_real:number [] | Float32Array ,
_imag:number [] | Float32Array ,
_constraints?:PeriodicWaveConstraints | undefined
) => PeriodicWave

createStereoPanner #

createStereoPanner ( ) => StereoPannerNode

createWaveShaper #

createWaveShaper ( ) => WaveShaperNode

decodeAudioData #

decodeAudioData (
_audioData:ArrayBuffer
) => Promise<AudioBuffer >

dispose #

Clean up

dispose ( ) => this

emit #

Invoke all of the callbacks bound to the event with any arguments passed in.

emit (
event:any ,

The name of the event.

...args:any []

The arguments to pass to the functions listening.

) => this

getConstant #

getConstant (
_val:number
) => AudioBufferSourceNode

static getDefaults #

Returns all of the default options belonging to the class.

getDefaults ( ) => BaseToneOptions

static mixin #

Add Emitter functions (on/off/emit) to the object

mixin (
constr:any
) => void

off #

Remove the event listener.

off (
event:"statechange" | "tick" ,

The event to stop listening to.

callback?:undefined | (args) => void

The callback which was bound to the event with Emitter.on.If no callback is given, all callbacks events are removed.

) => this

on #

Bind a callback to a specific event.

on (
event:"statechange" | "tick" ,

The name of the event to listen for.

callback:(args) => void

The callback to invoke when the event is emitted

) => this

once #

Bind a callback which is only invoked once

once (
event:"statechange" | "tick" ,

The name of the event to listen for.

callback:(args) => void

The callback to invoke when the event is emitted

) => this

resume #

resume ( ) => Promise<void >

setInterval #

setInterval (
_fn:(args) => void ,
_interval:Seconds
) => number

setTimeout #

setTimeout (
_fn:(args) => void ,
_timeout:Seconds
) => number

toJSON #

toJSON ( ) => Record<string , any >

toString #

Convert the class to a string


const osc = new Tone.Oscillator();
console.log(osc.toString());
toString ( ) => string