WebAudio / web-audio-api

The Web Audio API v1.0, developed by the W3C Audio WG
https://webaudio.github.io/web-audio-api/
Other
1.04k stars 165 forks source link

The audio track to use in `decodeAudioData` isn't specified #2375

Closed padenot closed 2 years ago

padenot commented 3 years ago

At least Firefox and Chrome both pick the first track, respectively:

https://searchfox.org/mozilla-central/source/dom/media/webaudio/MediaBufferDecoder.cpp#257 https://source.chromium.org/chromium/chromium/src/+/main:media/filters/audio_file_reader.cc;l=71;drc=570d2d089d1d822d8b29111ea92d7e2e12cce67b;bpv=1;bpt=1

guest271314 commented 3 years ago

Is this for media files that include multiple audio tracks, e.g., for different languages?

How would the user select which track to decode with decodeAudioData(), which does not provide a means to select a specific track in the media file to be decoded?

rtoy commented 3 years ago

I think the answer is that you can't select the track, and decodeAudioData won't be changed to allow for that. Use WebCodecs if you need this kind of control.

guest271314 commented 3 years ago

I think the answer is that you can't select the track, and decodeAudioData won't be changed to allow for that.

Then this issue is moot, no?

Since decodeAudioData won't be changed there is no reason to specify which audio track decodeAudioData uses, that will always be the first track, or whatever implementers decide.

Use WebCodecs if you need this kind of control.

WebCodecs offers no such functionality.

I would be hesitant to suggest WebCodecs as some form of all-encompassing API solution for media, codecs, and track solutions for requirements or bugs, especially if you have not tested the code yourself before recommending a given API is pecified or has the capability to solve specific issues, e.g.,

rtoy commented 3 years ago

I think what @padenot is saying is that we need to codify what track is used. We won't supply a way for the user to specify the track.

@padenot can provide more info about WebCodecs; I have not looked its capabilities.

hoch commented 2 years ago

7/22 Teleconf: write the spec text for the behavior which picks the first track.

hoch commented 2 years ago

Closed per #2376.