audio delay

im have problems in audio while playing in device cause it was very delay like half a second but simulator it was very ok…

is it the device that was slow or wat??

It’s probably the device having to load the sound before it plays, the simulator runs much faster in my experience (unless you have a super slow PC/Mac). 

What I do, is call 

local mySound = audio.loadSound( "mySound.wav" ) 

when I create my scene. So the sound file is already loaded, and when I want to play it I can then do

audio.play( mySound ) 

without a delay.

@alanplanpot

I already doing that since the 1st…is it posible that the audio that was use may be the problem?? im using .mp3 and wav file… <_<

This is a known issue on Android versions older than 4.1 using the OpenAL interface.  If you need time sensitive plays with short times on these older operating systems, you should use the media.* API’s istead of audio.*  You loose blending sounds, multiple channels, volume control, etc. that you get using audio.*.  Google fixed this in 4.1 and later.

It’s probably the device having to load the sound before it plays, the simulator runs much faster in my experience (unless you have a super slow PC/Mac). 

What I do, is call 

local mySound = audio.loadSound( "mySound.wav" )&nbsp;

when I create my scene. So the sound file is already loaded, and when I want to play it I can then do

audio.play( mySound )&nbsp;

without a delay.

@alanplanpot

I already doing that since the 1st…is it posible that the audio that was use may be the problem?? im using .mp3 and wav file… <_<

This is a known issue on Android versions older than 4.1 using the OpenAL interface.  If you need time sensitive plays with short times on these older operating systems, you should use the media.* API’s istead of audio.*  You loose blending sounds, multiple channels, volume control, etc. that you get using audio.*.  Google fixed this in 4.1 and later.