WARNING: This is an experimental library not tested for production.
This projects ports the Fraunhofer FDK AAC encoder to JavaScript using the Emscripten project. Works in modern browsers and in Node.js.
A very simple demo is available here.
fdk-aac.js
: use this from Node, Browserify, Webpackfdk-aac.umd.js
: use this directly from the browserSee the example command line utility and the example web worker.
fetch(url)
.then((response) => response.arrayBuffer())
.then((wav) => {
fdkAac(new Uint8Array(wav), function (err, aac) {
if (err) return console.error(err)
const file = new File([aac.buffer], 'test.aac', {type: 'audio/aac'})
const url = URL.createObjectURL(file)
// Do something with the file or the url, for example:
document.querySelector('audio').src = url
})
})
Thanks to ffmpeg.js for inspiration.
It's complicated. Fraunhofer FDK AAC has a non-free license. Talk to your lawyer before using it in any project.
Own library code licensed under MIT License.