Thanks for your quick fix. The delay’s definitely better, but using the new audio API I still get worse performance on Android than using the old media API. From my spectations the loading of sounds with audio.loadSound takes longer and audio.play also has a negative impact on the game’s performance.
At the beginning of my screen I load all my event sounds:
local sound1 = audio.loadSound(…)
…
And if I use the new audio API it takes longer to open the level. Using media.newEventSound I have no loading delay, at all.
In my level, I show an image on screen and play back a sound if a certain event happens. Simple thing.
media.playEventSound(mySound)
image1.alpha = 1
or
audio.play(mySound)
image1.alpha = 1
With media.playEventSound the sound is played back and the image appears instantly. With audio.play and build 306 the audio is played back with a shorter delay than before, but the image appears delayed in comparison to media.playEventSound. As if the internal corona audio call would work like this:
function audio.play(soundfile)
system.playback(soundfile)
timer.performWithDelay(500,
function(event)
--go on with the stuff that follows after the audio call
return
end
)
end
So using the new audio API is still relatively unreliable for me on Android (tested with 2.2 and 2.3) and the old API works pretty perfectly. [import]uid: 11219 topic_id: 6861 reply_id: 25249[/import]