最終更新:2013-01-13 (日) 10:16:05 (4121d)
AudioBufferSourceNode
Top / AudioBufferSourceNode
AudioBufferから音を生成する
This interface represents an audio source from an in-memory audio asset in an AudioBuffer.
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioBufferSourceNode
作成
インターフェイス
interface AudioBufferSourceNode : AudioSourceNode { const unsigned short UNSCHEDULED_STATE = 0; const unsigned short SCHEDULED_STATE = 1; const unsigned short PLAYING_STATE = 2; const unsigned short FINISHED_STATE = 3; readonly attribute unsigned short playbackState; attribute AudioBuffer? buffer; attribute AudioParam playbackRate; attribute boolean loop; attribute double loopStart; attribute double loopEnd; void start(double when, optional double offset = 0, optional double duration); void stop(double when); };
属性
- playbackState - 再生状態, initialized to UNSCHEDULED_STATE.
- buffer - 再生するオーディオを表す。
- playbackRate - オーディオストリームをレンダリングする速度。デフォルトのplaybackRate.valueは1.0。
- loop - オーディオデータをループで再生するかどうかを示す。デフォルトはfalse
- loopStart - An optional value in seconds where looping should begin if the loop attribute is true. Its default value is 0, and it may usefully be set to any value between 0 and the duration of the buffer.
- loopEnd - An optional value in seconds where looping should end if the loop attribute is true. Its default value is 0, and it may usefully be set to any value between 0 and the duration of the buffer.
メソッド
AudioBufferSourceNode.start?(double when, optional double offset = 0, optional double duration)
- 正確な時間で再生するように音をスケジュールを組む
- when : サウンドが再生を開始してからの時間(秒単位)を表す。この時間はAudioContext.currentTimeに呼応します。この値がゼロを経過したり、値がcurrentTimeより小さい場合、サウンドはすぐに再生を開始する。
- offset : 再生開始位置のバッファ(秒単位)のオフセットを示す。
- duration : 再生する部分(秒単位)の持続時間について説明する。
AudioBufferSourceNode.stop?(double when)
- Schedules a sound to stop playback at an exact time.
Deprecated
- AudioBufferSourceNode.noteOn?(in float when) has been changed to start()
- AudioBufferSourceNode.noteGrainOn?(in float when, in float grainOffset, in float grainDuration) has been changed to start()
- AudioBufferSourceNode.noteOff?(in float when) has been changed to stop()