Skip to content

salomvary/fdk-aac.js

Repository files navigation

Port of Fraunhofer FDK AAC with Emscripten

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.

Demo

A very simple demo is available here.

Builds

  • fdk-aac.js: use this from Node, Browserify, Webpack
  • fdk-aac.umd.js: use this directly from the browser

Usage

See 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
        })
    })

Credits

Thanks to ffmpeg.js for inspiration.

License

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.

About

Port of Fraunhofer FDK AAC with Emscripten

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published