Android build stutters on playing a sound.

Hi,

I recently built Fat Fredy tutorial project (http://www.cutemachine.com/corona-sdk-tutorial/a-complete-game-made-with-corona-sdk-tutorial-part-4/) and ran it on a friend’s Galaxy Tab 10" tablet which has Android 3.x on it. Everything is fine except when game wants to playback a sound, whole game pauses for like 0.1 second. The method tutorial uses for playing back sound is this:

powerUpSound = audio.loadSound(“powerup.wav”)
audio.play ( powerUpSound )

How can I overcome this?

p.s. I was not using my license to build this and used trial license.

Thanks. [import]uid: 206803 topic_id: 34339 reply_id: 334339[/import]

Load the sounds before you need to play them.
Load as early as possible, for example at the top of your main.lua

Otherwise, there will be a delay as the app loads and then plays the sound. [import]uid: 186251 topic_id: 34339 reply_id: 136490[/import]

That’s what he did, he preloads the files and just plays them at points but causes stutter.

EDIT:
I think that’s the way Corona says so:
http://developer.coronalabs.com/partner/audionotes

So what would be the problem? [import]uid: 206803 topic_id: 34339 reply_id: 136496[/import]

>Galaxy Tab 10" tablet which has Android 3.x

I hope it’s not a Galaxy or Tablet or Android 3.x issue.

I’ve not seen that problem on test builds for iPad 1 and Android phones using 2.x [import]uid: 186251 topic_id: 34339 reply_id: 136514[/import]

I just heard back from a friend of mine whom I sent that apk to and he said that he didn’t get any lag when playing back the sound. I donno if he tested on his Nexus 7 or his Xperia phone.

@sam3dus: Neither, Galaxy Tab is the brand of tablets that Samsung makes. [import]uid: 206803 topic_id: 34339 reply_id: 136517[/import]

*bump* [import]uid: 206803 topic_id: 34339 reply_id: 136579[/import]

Load the sounds before you need to play them.
Load as early as possible, for example at the top of your main.lua

Otherwise, there will be a delay as the app loads and then plays the sound. [import]uid: 186251 topic_id: 34339 reply_id: 136490[/import]

That’s what he did, he preloads the files and just plays them at points but causes stutter.

EDIT:
I think that’s the way Corona says so:
http://developer.coronalabs.com/partner/audionotes

So what would be the problem? [import]uid: 206803 topic_id: 34339 reply_id: 136496[/import]

>Galaxy Tab 10" tablet which has Android 3.x

I hope it’s not a Galaxy or Tablet or Android 3.x issue.

I’ve not seen that problem on test builds for iPad 1 and Android phones using 2.x [import]uid: 186251 topic_id: 34339 reply_id: 136514[/import]

I just heard back from a friend of mine whom I sent that apk to and he said that he didn’t get any lag when playing back the sound. I donno if he tested on his Nexus 7 or his Xperia phone.

@sam3dus: Neither, Galaxy Tab is the brand of tablets that Samsung makes. [import]uid: 206803 topic_id: 34339 reply_id: 136517[/import]

*bump* [import]uid: 206803 topic_id: 34339 reply_id: 136579[/import]