opus-stream-decoder | Instantly decode Ogg Opus audio streams in chunks | Binary Executable Format library
kandi X-RAY | opus-stream-decoder Summary
kandi X-RAY | opus-stream-decoder Summary
OpusStreamDecoder is an Emscripten JavaScript WebAssembly (Wasm) library for immediately decoding Ogg Opus audio streams (URLs or files) in chunks without waiting for the complete file to download, copy, or read. libopusfile is the underlying C library used for decoding. OpusStreamDecoder provides a lightweight JavaScript API for decoding Opus audio streams at near-native speeds.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Opstream decoder .
- Opens an OpusAudio stream .
- Update global cache
- Get a function that is used to define a function call to its function .
- call c function in C constructor
- Convert a string value to a string
- Wrap a function in a wrapper function that returns the result of the function call .
- Converts a UTF8Array to a String .
- Converts a UTF8 buffer to a UTF8 string .
- Convert a string to UTF8Array .
opus-stream-decoder Key Features
opus-stream-decoder Examples and Code Snippets
Community Discussions
Trending Discussions on opus-stream-decoder
QUESTION
I'm trying to use the library https://github.com/AnthumChris/opus-stream-decoder/
I have a stream of OPUS encoded sound (2ch, 48kHz) from a high quality microphone (but I play a music in loop on it to test this). I know it works because I can hear it if I use:
websocat --binary ws://third-i.local/api/sound - | mpv -
(It's opening the websocket and streaming its output to mpv (mplayer)).
But when I play in the browser all I hear is very small parts of the sound every second or so. But the sound itself sounds good (I believe it is a very small part of the music).
Here is the JS code I wrote to listen in the browser:
...ANSWER
Answered 2020-Nov-15 at 10:07The problem of scheduling is due to the fact that you create the AudioContext at the same time that you create the WebSocket, thus adding the connection time to the AudioContext
's scheduling.
In other words, when you create the AudioContext
the scheduling is started immediately but since the AudioContext is created when the WebSocket is created (which only starts connecting), the scheduling is off by the amount of time it takes to the WebSocket to connect to the upstream and receive the first bytes.
This is your code fixed:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install opus-stream-decoder
Emscripten Installation Instructions
The Emscripten module builds in a few seconds, but most of the work will be spent configuring the dependencies libopus, libogg, and libopusfile. You may see the warnings (not errors) below, which don't prevent the build from succeeding. It is not known whether these warnings adversly affect runtime use.
Don't have the functions lrint() and lrintf ()
Replacing these functions with a standard C cast
implicit conversion from 'unsigned int' to 'float'
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page