Volume and Audio Recording

Hi, how are you?

I am trying to do a system that grabs the volume from the MIC and when it is bigger than a X value, it records, when it is smaller than that X value it plays the recorded sound.

I tried using startTuner(), but it crashes if you setup a filePath for media.newRecording(filePath) , also you cant run 2 recording objects at same time in Android.

Anyone had the same problem? I just bought Corona and now i am running bad with this bug…

Sounds simple, but never works in the real Android device.

My build is 2012.820 and Android 2.3

This is an example that crashes:

if “simulator” == system.getInfo(“environment”) then
dataFileName = dataFileName … “.ogg”
else
local platformName = system.getInfo( “platformName” )
if “iPhone OS” == platformName then
dataFileName = dataFileName … “.aif”
elseif “Android” == platformName then
dataFileName = dataFileName … “.3gp”
else
print("Unknown OS " … platformName )
end
end
local filePath = system.pathForFile( dataFileName, system.DocumentsDirectory )

– Create an object to access audio input features
local r = media.newRecording(filePath)
r:startTuner()
r:startRecording()

Thanks [import]uid: 151200 topic_id: 26775 reply_id: 326775[/import]

Anyone? [import]uid: 151200 topic_id: 26775 reply_id: 108775[/import]

i have a similar problem, if the recorded audio is very small and you stop the recording fast, it looks it crashes, because the creation of the file is no finished i think…
I dont know how to detect the file is created to stop the recording.
I need to record one second at least [import]uid: 113117 topic_id: 26775 reply_id: 109149[/import]