Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jfrancos/oggmented
decodeAudioData(oggVorbisBuffer) in any browser
https://github.com/jfrancos/oggmented
Last synced: about 2 months ago
JSON representation
decodeAudioData(oggVorbisBuffer) in any browser
- Host: GitHub
- URL: https://github.com/jfrancos/oggmented
- Owner: jfrancos
- Created: 2020-03-15T01:08:24.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T19:13:19.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T05:05:13.194Z (2 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/oggmented
- Size: 1.51 MB
- Stars: 6
- Watchers: 1
- Forks: 3
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# oggmented
oggmented `extends` AudioContext and overrides `decodeAudioData` to use an Emscripten transpiling of libogg-1.3.4 and libvorbis-1.3.6 when it encounters ogg vorbis data.This allows you to [`decodeAudioData`](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/decodeAudioData) ogg vorbis buffers correctly in any browser. This is especially useful in Safari and iOS browsers, which don't `decodeAudioData(oggVorbisBuffer)` [at all](https://caniuse.com/#search=vorbis).
In addition, [Blink](https://en.wikipedia.org/wiki/Blink_(browser_engine)) (Brave, Opera, Chrome) uses ffmpeg, which has [a bug that slightly bloats the end of decoded vorbis audio](https://trac.ffmpeg.org/ticket/6367), resulting in clicks when `audioContext.createBufferSource().loop === true`. Using this package fixes that (assuming of course that the waveform begins and ends at the same place etc).
# Installation
`npm install oggmented`# Usage
Use it like you would regular AudioContext:
```
import oggmentedAudioContext from 'oggmented'const audioCtx = new oggmentedAudioContext()
// instead of
// const audioCtx = new (window.AudioContext || window.webkitAudioContext)()
```## License
MIT © [jfrancos](https://github.com/jfrancos)