AudioBufferSourceNode Class
A source that plays an AudioBuffer (https://webaudio.github.io/web-audio-api/#AudioBufferSourceNode), with a playback rate, a detune, a loop, and sub-sample accurate start and stop times (the samples are linearly interpolated).
public sealed class AudioBufferSourceNode : AudioScheduledSourceNode- Inheritance
AudioScheduledSourceNodeAudioBufferSourceNode
Constructors
| Name | Description |
|---|---|
| AudioBufferSourceNode(BaseAudioContext, AudioBufferSourceOptions?) | Creates a buffer source. |
AudioBufferSourceNode(BaseAudioContext, AudioBufferSourceOptions?)
AudioBufferSourceNode.csCreates a buffer source.
public AudioBufferSourceNode(BaseAudioContext context, AudioBufferSourceOptions? options = null)Properties
| Name | Description |
|---|---|
| Buffer | Gets or sets the buffer to play. A buffer can only be set once. |
| Detune | Gets the detune of the playback in cents (k-rate). |
| Loop | Gets or sets a value indicating whether the region from AudioBufferSourceNode.LoopStart to AudioBufferSourceNode.LoopEnd is played in a loop. |
| LoopEnd | Gets or sets the playhead position in seconds where the loop ends (exclusive); 0 for the end of the buffer. |
| LoopStart | Gets or sets the playhead position in seconds where the loop starts. |
| PlaybackRate | Gets the speed of the playback (k-rate). |
Buffer
AudioBufferSourceNode.csGets or sets the buffer to play. A buffer can only be set once.
public AudioBuffer? Buffer { get; set; }Detune
AudioBufferSourceNode.csGets the detune of the playback in cents (k-rate).
public AudioParam Detune { get; }Property value
See also
Gets or sets a value indicating whether the region from AudioBufferSourceNode.LoopStart to AudioBufferSourceNode.LoopEnd is played in a loop.
public bool Loop { get; set; }LoopEnd
AudioBufferSourceNode.csGets or sets the playhead position in seconds where the loop ends (exclusive); 0 for the end of the buffer.
public double LoopEnd { get; set; }Property value
See also
LoopStart
AudioBufferSourceNode.csGets or sets the playhead position in seconds where the loop starts.
public double LoopStart { get; set; }Property value
See also
PlaybackRate
AudioBufferSourceNode.csGets the speed of the playback (k-rate).
public AudioParam PlaybackRate { get; }Methods
| Name | Description |
|---|---|
| Start(double, double?, double?) | Schedules the start of the playback at a time, from a position of the buffer, for a duration of buffer content. |
Start(double, double?, double?)
AudioBufferSourceNode.csSchedules the start of the playback at a time, from a position of the buffer, for a duration of buffer content.
Parameters
whendouble- The time of the context when the playback starts.
offsetdouble?- The playhead position in seconds where the playback starts.
durationdouble?- The duration in seconds of buffer content to play (including the loop iterations), or null to play until the end.
Exceptions
DomException- The source was already started (an
InvalidStateError).