Audio and latency

27 views
Skip to first unread message

KevODwyer

unread,
Jan 6, 2012, 2:23:41 AM1/6/12
to gwt-voices
I have added sound emulation to my JavaScript port of dosbox. Having
trouble dialling in the parameters to hopefully reduce latency
see DOS mod sound system playing a .s3m file at
retropcdemos.appspot.com
The demo is using AudioElement only because I found gwt-voices a bit
unstable when using the deprecated
setPreferredSoundType(Html5Sound.class) method. Is there another/
better way?

Currently I am generating a wav file (<20/sec) containing 1024 bytes
of mono 16 bit samples (mixed at 11025 Hz) which is base 64 encoded
and sent to a bank of 5 AudioElements. The output is choppy. I am
not sure if web browsers prefers data in a particular form ie. mono/
stereo/bits per sample/sample size/frequency. Also the format of the
data: is uncompressed wav the best method? Appreciate your thoughts
on this.

That said the sound blaster emulation probably doesn't sound that much
worse then it did on my original pc+sb 1 sound card+tinny speakers
back in the day.

Fred Sauer

unread,
Jan 6, 2012, 5:53:49 PM1/6/12
to gwt-v...@googlegroups.com
I recommend using the Web Audio API as the (original) HTML5 Audio API was never designed around low latency. The whole state machine for audio playback (in the HTML5 case) is intertwined with the networking stack.




--
You received this message because you are subscribed to the Google Groups "gwt-voices" group.
To post to this group, send email to gwt-v...@googlegroups.com.
To unsubscribe from this group, send email to gwt-voices+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gwt-voices?hl=en.




--
Fred Sauer
fr...@allen-sauer.com
Reply all
Reply to author
Forward
0 new messages