最終更新:2015-03-14 (土) 14:38:55 (1315d)  

AudioContext はてなブックマークを見る
Top / AudioContext

https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioContext-section

WebKitでの実装

インターフェイス

callback DecodeSuccessCallback = void (AudioBuffer decodedData);
callback DecodeErrorCallback = void ();

[Constructor]
interface AudioContext {

    readonly attribute AudioDestinationNode destination;
    readonly attribute float sampleRate;
    readonly attribute double currentTime;
    readonly attribute AudioListener listener;
    readonly attribute unsigned long activeSourceCount;

    AudioBuffer createBuffer(unsigned long numberOfChannels, unsigned long length, float sampleRate);

    AudioBuffer createBuffer(ArrayBuffer buffer, boolean mixToMono);

    void decodeAudioData(ArrayBuffer audioData,
                         DecodeSuccessCallback successCallback,
                         optional DecodeErrorCallback errorCallback);


    // AudioNode creation 
    AudioBufferSourceNode createBufferSource();

    MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement);

    MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream);

    ScriptProcessorNode createScriptProcessor(unsigned long bufferSize,
                                              optional unsigned long numberOfInputChannels = 2,
                                              optional unsigned long numberOfOutputChannels = 2);

    AnalyserNode createAnalyser();
    GainNode createGain();
    DelayNode createDelay(optional double maxDelayTime = 1.0);
    BiquadFilterNode createBiquadFilter();
    WaveShaperNode createWaveShaper();
    PannerNode createPanner();
    ConvolverNode createConvolver();

    ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs = 6);
    ChannelMergerNode createChannelMerger(optional unsigned long numberOfInputs = 6);

    DynamicsCompressorNode createDynamicsCompressor();

    OscillatorNode createOscillator();
    WaveTable createWaveTable(Float32Array real, Float32Array imag);

};

プロパティ

  • readonly
    プロパティ説明
    AudioDestinationNodedestination?
    floatsampleRate?サンプリングレート?
    floatcurrentTime?AudioContextが生成されてからの時間
    AudioListener?listener?
    unsigned longactiveSourceCount?

関数