John Hoffman
John Hoffman

Reputation: 18607

How do I create an audio buffer out of an audio tag?

Can I somehow use a loaded audio tag to create an audio buffer?

I know that the web audio API has a decodeAudioData method that can be used to create an audio buffer, but it does not accept an audio tag.

How can I take an audio tag and use it to create an audio buffer that can be played by a source node?

Upvotes: 1

Views: 334

Answers (1)

GrandonBroseph
GrandonBroseph

Reputation: 163

Sadly, it doesn't look like the audio tag can be loaded into a buffer. The only way so far to create an AudioBuffer is through XMLHttpRequest or creating an empty buffer.

Upvotes: 2

Related Questions