Complete question: Why is it more suitable to use a MediaElementAudioSourceNode
rather than an AudioBuffer
for longer sounds?
Objects of these types are designed to hold small audio snippets, typically less than 45 s. For longer sounds, objects implementing the MediaElementAudioSourceNode are more suitable.
This interface represents a memory-resident audio asset (for one-shot sounds and other short audio clips). Its format is non-interleaved 32-bit linear floating-point PCM values with a normal range of [−1,1][−1,1], but values are not limited to this range. It can contain one or more channels. Typically, it would be expected that the length of the PCM data would be fairly short (usually somewhat less than a minute). For longer sounds, such as music soundtracks, streaming should be used with the audio element and MediaElementAudioSourceNode.
- What are the benefits of using a
MediaElementAudioSourceNode
over of anAudioBuffer
? - Are there any disadvantages when using a
MediaElementAudioSourceNode
for short clips?