Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Rapid-fire sounds

Author
Message
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 16th Jan 2017 12:34
Hi all,

Just wondering... If I play the same sound file (from a wav, loaded in with LoadSound) rapidly, in quick succession, it sounds just fine. But if I try and play various sounds in rapid succession (but not so rapid that more than 5 are playing at any one time) I get quite a bit of audio distortion and "clicks" on-device.

Assuming that the rapid-play of overlapping sounds is a necessity to what I'm doing, is there a way to better manage my sound instances to minimize or avoid this anomaly altogether?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 16th Jan 2017 17:51
I've not tried it myself but it could be the device mixer not handling short sounds very well. If this is on Android then try making all your sound files at least 200ms in length, even if some of it is silence, and see if it makes any difference.
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 17th Jan 2017 00:43
Interesting. I hadn't actually considered it might be device specific. I'll give this a shot and see how it goes! Thank you!
haliop_New
User Banned
Posted: 17th Jan 2017 12:26
CumQuat ? have you tried it ?
does it work ?
I suffer from the same problem myself.
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 17th Jan 2017 13:46
Alrighty, so I finally found time to test this out and I thought I'd try one last thing... Switching back to MP3 music, rather than using OGG.

Doing so completely fixed the issue with the WAV sounds for some reason...
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 17th Jan 2017 14:38
Interesting, the OGG system uses the sound subsystem to play music, it decodes the OGG into WAV in chunks plays it like a sound, so it will be mixed with the sound effects. Whereas MP3 uses the device hardware decoder so it should put less pressure on the system. M4A should have the same effect as MP3 as it also uses the hardware decoder, but has less license issues, so I'd recommend M4A instead.
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 18th Jan 2017 05:04
Good advice, thanks Paul!
haliop_New
User Banned
Posted: 18th Jan 2017 09:19
wait so you used
playsound with an MP3 file ?
I thought that cant be done...
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 18th Jan 2017 13:03
No I used MP3 files for my music in the game rather than OGG files (and their relevant commands) and the issue with PlaySound fixed itself.
haliop_New
User Banned
Posted: 19th Jan 2017 11:15
Aha i see thanks for the info.

Login to post a reply

Server time is: 2024-03-29 08:33:35
Your offset time is: 2024-03-29 08:33:35