Hi folks, I’m using the official Corona SDK’s API (media.newRecording) in my game.
The fact is that the action associated to the microphone works, but with a delay of about one second only on iOS, instead of Android, where it performs the task as soon as the microphone detect some noise.
The code I used is:
local r = media.newRecording() r:startRecording() r:startTuner() function soundDetector( event ) local v = r:getTunerVolume() if v == 0 then return end v = 20 \* 0.301 \* math.log(v) m = v\*10 if(m\>= -100)then backGround.y = backGround.y - 10 end end Runtime:addEventListener( "enterFrame", soundDetector )
How can I fix that?
Thank you!