simple-sounds | Simple usage of Web Audio API to play sounds in the browser | Audio Utils library
kandi X-RAY | simple-sounds Summary
kandi X-RAY | simple-sounds Summary
Simple usage of Web Audio API to play sounds in the browser.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of simple-sounds
simple-sounds Key Features
simple-sounds Examples and Code Snippets
Community Discussions
Trending Discussions on simple-sounds
QUESTION
I'm trying to create a C++ program with Waveform Audio library that would be playing AudioFrames (raw audio data, each frame consists of about 1920 bytes) provided by another program (right now I'm just simulating that by reading file as AudioFrames). Modifying code from this thread I was able to make SoundPlayer class that does the job, but the output I get is extremely choppy. It's gets better with bigger frame sizes, but even with frames as big as 96000 bytes the audio still glitches every second or so (and I need the frames too be much smaller than that).
How can I fix this issue?
Here is the test file I'm using. And here is the code itself:
...ANSWER
Answered 2018-Aug-28 at 11:10You should read the data from disk while the sound plays, not in between buffers!
If you can't read the whole file at once, you should change your Play
function so that it doesn't just call WaitForSingleObject
. Using it makes your code block and wait until the sound stops playing.
What you need instead is to start playing, then go back to your reading loop, prepare the next buffer, and then wait for the music to end, like so (in SoundPlayer
):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install simple-sounds
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