Audio Problems

Hi, I'm back to working on the rhythm game mentioned all the way in my very first post, hoping the new builds have the problem fixed. This is getting very frustrating.

Check out the code below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local counter = 10
local function endcheck(event)
        print(event.time)
end
local ppptime = 0
local sound1ID = media.newEventSound( "sound1.mp3" ) 
local function playBeep(event)
        if counter == 0 then
                media.playEventSound( sound1ID, endcheck )
                print(event.time - ppptime)
                ppptime = event.time
                print(sound1ID)
                counter = 10
        end
        counter = counter - 1
end
Runtime:addEventListener("enterFrame", playBeep)

By the way, the endcheck completion listener is never accessed.

If your target device is Android then there's unfortunately nothing that can be done from a Corona standpoint. Audio lag is an Android problem.

I created a small WAV with a short beep and tested your code (first snippet) on my iPad and it works well.

I also tested on my Android device (Galaxy Player, Android 2.2) and I get sound to play, but the timing is not steady.

The problem now is that it's not working in the simulator for me, which is really frustrating.

For me it's OK on the simulator as well. I'm on a Mac, OSX Lion, Corona 2011.715.

views:1622 update:2012/1/3 13:02:13
corona forums © 2003-2011