Aside of stuff like "it's alpha"? Is it something browser-side that can't be fixed or do you think audio choppiness can be eradicated?
The web audio api can easily provide flawless dynamically generated audio, otherwise it would be a terrible standard with no real point. Whatever the issue is it can be fixed.
I've never experienced choppy audio playback ... maybe it's a matter of cpu performance.
pico-8 uses per-frame deterministic emulation.
This means that another "frame-worth" of audio is being generated on each frame together with drawing imagery on screen.
If the frame takes longer-than-needed to process, the browser will "run out" of audio to play before, resulting in a "chop" (silence before the frame).
Aside of not making the emulator lag, you can't do much about this.
Maybe it would be good if webplayer would "render" all sounds upon cartridge's boot? That way it could play sound flawlessly.
Unfortunately there's no way in javascript (asm.js) to guarantee the mixing callback is called in time to avoid starving the audio stream, so the best things to do is just to use a large buffer, request a high event rate, and try to keep maximum mainloop execution time down.
I didn't realise the sound was choppy on some systems -- is there anyone else having this issue? If so, please take the time to comment with your system specs and browser version.
The code I'm using went through a number of iterations of QA at Mozilla while I was doing a demo of Voxatron for the Firefox default page, so I fear it can't be improved much for now! But it would be great to get some more data on the problem, even if anecdotal.
@darkhog -- is the choppy sound constantly bad? or just an occasional skipped 1/10th of a second?
pre-mixing sounds is a possibility, but sounds gets pretty large with music, and I don't want to lose the ability to dynamically generate audio during cart execution.
"@darkhog -- is the choppy sound constantly bad? or just an occasional skipped 1/10th of a second?"
Sometimes it's skip, sometimes it is consistently bad. My specs:
Intel Core2Quad Q9450 @2.66GHz
8GB RAM
GeForce GTX660
Windows 7 Ultimate x64
Firefox 40.0.3
One thing to note is that I usually have quite few tabs open in FF. Like 10-20
For me, I've noticed that it's a little choppy in Chrome, but always fine in FireFox.
With that said, it was choppy in FireFox until I installed the latest Realtek audio drivers.
[Please log in to post a comment]