w3c / webcodecs

WebCodecs is a flexible web API for encoding and decoding audio and video.
https://w3c.github.io/webcodecs/
Other
1k stars 137 forks source link

Mandate support from/to any AudioSampleFormat #352

Open chcunningham opened 3 years ago

chcunningham commented 3 years ago

As of #349, we mandate support for converting from ANY format to f32-planar. This allows for consistent integration with WebAudio. Chrome does not currently support conversions to other formats and will throw a NotSupportedError if requested.

But @padenot raised the point that we could mandate support for other conversions. I'm open to it. @padenot, do you think folks will find it useful?

padenot commented 3 years ago

I think it's easy enough to do, and will be very useful once AudioBuffer will be able to store PCM of various bit-depth/format (https://github.com/WebAudio/web-audio-api-v2/issues/11).

alvestrand commented 3 years ago

is the set of sample formats a bounded set, or is it a set that will grow over time? If the latter, "any" is not possible to keep as a guarantee; if the former, it's a reasonable thing to require (and the spec should have text saying "this set will not grow").

padenot commented 3 years ago

It's a bounded set and already listed here: https://w3c.github.io/webcodecs/#enumdef-audiosampleformat

chcunningham commented 2 years ago

TPAC WebAudio folks were interested in to/from any bit depth and (de)interleave