audio.AudioContext

AudioContext

package js-html-audio

extends EventTarget

extended by OfflineAudioContext

Available on js

An AudioContext can be a target of events, therefore it implements the EventTarget interface.

Documentation AudioContext by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Constructor

new (audioChannelType:AudioChannel)

new ()

Throws:

null DOMError

Variables

read only currentTime:Float

Returns a double representing an ever-increasing hardware time in seconds used for scheduling. It starts at 0.

read only destination:AudioDestinationNode

Returns an AudioDestinationNode representing the final destination of all audio in the context. It can be thought of as the audio-rendering device.

read only listener:AudioListener

Returns the AudioListener object, used for 3D spatialization.

onstatechange:Function

An event handler that runs when an event of type statechange has fired. This occurs when the AudioContext's state changes, due to the calling of one of the state change methods (AudioContext.suspend, AudioContext.resume, or AudioContext.close).

read only sampleRate:Float

Returns a float representing the sample rate (in samples per second) used by all nodes in this context. The sample-rate of an AudioContext cannot be changed.

read only state:AudioContextState

Returns the current state of the AudioContext.

Methods

close ():Promise<Void>

Throws:

null DOMError

createAnalyser ():AnalyserNode

Throws:

null DOMError

createBiquadFilter ():BiquadFilterNode

Throws:

null DOMError

createBuffer (numberOfChannels:Int, length:Int, sampleRate:Float):AudioBuffer

Throws:

null DOMError

createBufferSource ():AudioBufferSourceNode

Throws:

null DOMError

createChannelMerger (numberOfInputs:Int = 6):ChannelMergerNode

Throws:

null DOMError

createChannelSplitter (numberOfOutputs:Int = 6):ChannelSplitterNode

Throws:

null DOMError

createConvolver ():ConvolverNode

Throws:

null DOMError

createDelay (maxDelayTime:Float = 1.0):DelayNode

Throws:

null DOMError

createDynamicsCompressor ():DynamicsCompressorNode

Throws:

null DOMError

createGain ():GainNode

Throws:

null DOMError

createMediaElementSource (mediaElement:MediaElement):MediaElementAudioSourceNode

Throws:

null DOMError

createMediaStreamDestination ():MediaStreamAudioDestinationNode

Throws:

null DOMError

createMediaStreamSource (mediaStream:MediaStream):MediaStreamAudioSourceNode

Throws:

null DOMError

createOscillator ():OscillatorNode

Throws:

null DOMError

createPanner ():PannerNode

Throws:

null DOMError

createPeriodicWave (real:Float32Array, imag:Float32Array):PeriodicWave

Throws:

null DOMError

createScriptProcessor (bufferSize:Int = 0, numberOfInputChannels:Int = 2, numberOfOutputChannels:Int = 2):ScriptProcessorNode

Throws:

null DOMError

createStereoPanner ():StereoPannerNode

Throws:

null DOMError

createWaveShaper ():WaveShaperNode

Throws:

null DOMError

decodeAudioData (audioData:ArrayBuffer, ?successCallback:AudioBuffer ‑> Void, ?errorCallback:Void ‑> Void):Promise<AudioBuffer>

Throws:

null DOMError

resume ():Promise<Void>

Throws:

null DOMError

suspend ():Promise<Void>

Throws:

null DOMError

© 2005–2016 Haxe Foundation
Licensed under a MIT license.
http://api.haxe.org/js/html/audio/AudioContext.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部