0
votes

I want to use microphone in my game (point and click, game has music and sound effects, i use HTML5 Audio element) and if I add (only!) this line:

var audioCtx = new AudioContext ();

And launch my game in Chrome the sound (sometimes) is laggy and choppy.... It is not the end... After some time (not always) all sounds/music are muted i need to close and restart browser.

I tested my game on netbook (low-spec, CPU 2.1 Mhz, 4 GB RAM etc.). But on my Desktop PC (CPU 4,3 Mhz etc, 16 GB RAM etc.) - everything's okay.

What do you think ? Problem is memory ? Poor game optimization? Someone had similar experiences ?

I use OGG files (sounds/music).

1

1 Answers

0
votes

The (ogg) file length was too short (0.5 sec), I changed the file length (1 sec) and now it's OK. Maybe it's a problem with Chrome, sound card, or AudioContext because even Windows does not play audio.

Also, I use audioContext.suspend() (to pause), and audioContext.resume(), audioContext.stop() (to close).