Closed mtsee closed 7 months ago
From https://www.via-la.com/licensing-2/aac/aac-faqs/:
Are there use fees for AAC? No. License fees are due on the sale of encoders and/or decoders only. There are no patent license fees due for the distribution of bit-streams encoded in AAC, whether such bit-streams are broadcast, streamed over a network, or provided on physical media.
This is in line with what WIkipedia states:
No licenses or payments are required for a user to stream or distribute content in AAC format.
So you should be totally fine using AAC for anything you want, unless it's selling an encoder/decoder. That said, adding MP3 codec support to this library does seem reasonable - I'll look into it.
Are you even able to produce an AudioEncoder using MP3? I'm in Chrome 120, and according to this, I tried out several configurations:
audioEncoder.configure({
codec: 'mp3', // or 'mp4a.69', or 'mp4a.6B'
sampleRate,
numberOfChannels,
bitrate: 128000,
});
I always get DOMException: Unsupported codec type.
. No reason to add MP3 support to the muxer if browsers can't even encode it.
I made a video editing tool in the browser, which is charged according to the AAC protocol, so I use MP3 encoding for the audio. The current solution is to use ffmpeg.wasm to synthesize the video and mp3. If mp4-muxer supports MP3 encoding, you can remove ffmpeg.wasm, or does the author have any good suggestions? I can try to implement the encoding business of mp3, thanks
I don't mind adding MP3 support to mp4-muxer, but if AudioEncoder can't even do it, there's little point. Keep me updated if you can manage the encoding business.
I'll close this issue for now as it seems stale. If you still need help with something, feel free to reopen it :)
It seems we can decode mp3/ogg via Web Audio API .decodeAudioData(), but just can not encode to mp3/ogg via Web Audio API? Thanks.
Yup, basically.
for anyone that's interested - I found this => https://github.com/salomvary/fdk-aac.js/blob/master/aac-enc.wasm - it seems to work well in my tests. Basically it will encode AAC from a wav file using wasm.
@weepy No need to use WASM for this anymore now with WebCodecs! Simply decode the WAV data using decodeAudioData
, then pipe it into an AudioDecoder
. AAC is not an issue, just MP3 doesn't work.
Currently only aac and opus are supported, but opus synthetic mp4 cannot play normally.