• Stars
    star
    125
  • Rank 286,263 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 8 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Minimal audio decoders layer

audio-decode test stable

Decode audio data from supported format to AudioBuffer.

Supported formats:

  • wav
  • mp3
  • ogg vorbis
  • flac
  • opus
  • alac
  • aac
  • m4a
  • qoa

npm install audio-decode

import decodeAudio from 'audio-decode';
import buffer from 'audio-lena/mp3';

let audioBuffer = await decode(buffer);

buffer type can be: ArrayBuffer, Uint8Array or Buffer.

Decoder's code is lazy: first run loads decoder's sources and compiles module before decoding.

To get more granular control over individual decoders, use decoders:

import decode, {decoders} from 'audio-decode';

await decoders.mp3(); // load & compile decoder
const audioBuffer = await decoders.mp3(mp3buf); // decode

See also

  • wasm-audio-decoders – best in class compact & fast WASM audio decoders.
  • Web Audio Decoders – native decoders API, hope one day will be fixed or alternatively polyfilled.
  • decodeAudioData – default in-browser decoding method.
  • ffmpeg.wasm – ultimate encoding/decoding library (8.5Mb of code).

License

MIT  •  🕉

More Repositories

1

web-audio-api

Node.js implementation of Web audio API
JavaScript
826
star
2

audio

Class for high-level audio manipulations [NOT MAINTAINED]
JavaScript
237
star
3

audio-speaker

Output audio stream to speaker, browser/node-wise
JavaScript
104
star
4

web-audio-stream

Stream data to web audio
JavaScript
93
star
5

audio-buffer-utils

Utils for audio buffers
JavaScript
81
star
6

audio-loader

A simple but flexible AudioBuffer loader for Web Audio API
JavaScript
81
star
7

audio-shader

Process audio stream with webgl shader
GLSL
73
star
8

audio-buffer

AudioBuffer class for node/browser
JavaScript
72
star
9

audio-play

Play audio buffer in browser/node
JavaScript
60
star
10

a-weighting

👂 A-weighting and other noise weighting
JavaScript
39
star
11

pcm-convert

Convert pcm data from any to any format
JavaScript
32
star
12

audio-generator

Generate audio with a function
JavaScript
32
star
13

sample-rate

List of common sample rates
JavaScript
31
star
14

audio-context

A WebAudio Context singleton
JavaScript
30
star
15

audio-oscillator

Generate periodic oscillation into an array/audiobuffer
JavaScript
27
star
16

audio-type

Detect the audio type of a Buffer/Uint8Array
JavaScript
23
star
17

audio-buffer-from

Create audio-buffer from any source data
JavaScript
22
star
18

audio-biquad

Biquad filter audio stream
JavaScript
12
star
19

decibels

📢 Convert values to and from decibels.
JavaScript
12
star
20

audio-buffer-list

Sequence of AudioBuffers data structure
JavaScript
12
star
21

web-audio-write

Write data to web-audio
JavaScript
10
star
22

audio-format

Parse or stringify audio format
JavaScript
9
star
23

awesome-audiojs

A curated list of high-quality, small-scope audio JS modules.
9
star
24

audio-pcm-format

Audio stream format transformer
JavaScript
8
star
25

audio-buffer-remix

Upmix or downmix audio buffer channels
JavaScript
8
star
26

audio-lena

The Lena test audio
JavaScript
7
star
27

audio-through

Audio processor/generator constructor
JavaScript
6
star
28

docs

JavaScript
4
star
29

is-audio-buffer

if (object instanceof AudioBuffer) { ... }
JavaScript
2
star
30

contributing

Discussion and guidelines for contributing
2
star
31

audio-extensions

List of audio extensions
JavaScript
2
star
32

audio-source

Create stream from audio buffer or array buffer
JavaScript
1
star