Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete decoders pack #70

Open
dy opened this issue Jan 30, 2023 · 3 comments
Open

Complete decoders pack #70

dy opened this issue Jan 30, 2023 · 3 comments

Comments

@dy
Copy link

dy commented Jan 30, 2023

Hi @eshaz.
That comes to be very unique in class bundle, but it seems there's some more quite standard decoders out there, I'm curious if you would consider adding:

  • wav
  • webm
  • aiff, aac
  • m4a
@guest271314
Copy link

For WAV you can, in general, start at byte 44, see https://github.com/guest271314/AudioWorkletStream.

@guest271314
Copy link

@dy For completeness encoding to Opus packets output by WebCodecs AudioEncoder - without a container - and playing back at Media Source Extensions or converting to WAV and playing back at HTMLMediaElement. The last time I tested (before adding support for embedding Media Session API metadata) the resulting single file was less total file size than Opus in WebM produced by MediaRecorder https://github.com/guest271314/WebCodecsOpusRecorder.

@eshaz
Copy link
Owner

eshaz commented Feb 3, 2023

@dy Thanks for the additional suggestion.

  • wav, aiff
    • I've had a few others suggest this as well. These formats really aren't codecs, but are container formats that encapsulate raw (i.e. uncompressed) PCM data. However, it might be useful to have a WASM based converter for wav, aiff, and potentially other PCM formats that parses the information in these formats (i.e. sample rate, bit depth, channels) and outputs the audio as Float32Arrays. The conversion between whatever integer type is in these formats and float could be sped up significantly using WASM SIMD instructions.
  • aac
    • This is an audio codec, and I might add this one someday. This codec is widely used, but I would encourage anyone developing a new application with compressed audio to use Opus, which is open source and much better in terms of compression ratio and quality.
  • webm, m4a
    • These are container formats that can encapsulate many different codecs. I think for now I'm just going to support raw codecs and the Ogg container format in this library. If you have webm or m4a files, there might be other demuxers out there that can pull out the audio frames, which can then be decoded with this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants