1

I'm using the web audio javascript API? If I loop through several popular audio formats, and then call document.getElementById('someAudioTag').canPlayType('audio/ogg'); for each format (in this case, ogg), do I get a list of audio formats that I can feed into decodeAudioData?

Is there a more straightforward method to get the list of supported formats via the web audio API?

dangerChihuahua007
  • 20,299
  • 35
  • 117
  • 206

2 Answers2

3

That's pretty much the only way, I think, aside from incorporating a table like this one (note that that's the formats supported by <audio> and <video> tags, which is not quite the same as supported by the Web Audio API; for example IE doesn't have Web Audio at all yet).

You're likely to get a result of "maybe" on a lot of formats, at least if you don't specify a codec (and I haven't figured out exactly how to specify a codec yet-- I hope someone else can chime in).

aldel
  • 6,489
  • 1
  • 27
  • 32
2

WebAudio does not provide any way to determine what formats are supported by decodeAudioData.

Raymond Toy
  • 5,490
  • 10
  • 13