[Resolved] Testing Audio Recording Functionality For A Voice Notes App?

I’m in the process of building a simple voice notes application in an attempt to learn Corona. One thing I noticed in the Simple Audio Recorder sample code was that there is no support for recording audio in the simulator.

Is there a way I can test my application functionality without actually recording any audio?

Basically, I want to be able to test that my audio file is:

a) being recorded
b) being saved into the Documents Directory

Thanks,
Mike
[import]uid: 14700 topic_id: 27895 reply_id: 327895[/import]

Hi Mike,

If you’re on a Mac you can record audio in the simulator using the SimpleAudioRecorder sample I believe, although I’m unsure on PC.

Is there a reason you can’t test on your device? I built that sample for my iPad recently using build 836 and it recorded fine. [import]uid: 52491 topic_id: 27895 reply_id: 112949[/import]

(slaps forehead) I didn’t actually hit record to try it. I just assumed that it wouldn’t work in the simulator because when you open up the project it pops up an alert saying “recording is not supported in the simulator.”

That’ll learn me! Thanks for the response, sorry I wasted your time.

  • Mike [import]uid: 14700 topic_id: 27895 reply_id: 112982[/import]

That’s interesting, I didn’t get that warning myself - what version of Corona are you on? Are you on a Mac? – Either way it works for me.

Not a waste of time at all, am just happy it looks like you wont have to build.

Peach :slight_smile: [import]uid: 52491 topic_id: 27895 reply_id: 113014[/import]

I’m running the latest public build on a Mac.

The alert is down at the bottom of the main.lua file in the SimpleAudioRecorder project:

[code]
– Show alert if running in simulator environment
– Recording is not supported on Simulator
local isSimulator = “simulator” == system.getInfo(“environment”)

local onComplete
if isSimulator then
local alert = native.showAlert( “Alert”, “Recording not supported in the Simulator.”, { “OK” }, onComplete )
end
[/code] [import]uid: 14700 topic_id: 27895 reply_id: 113076[/import]

Is that the sample from 840, which is latest public build? I don’t see that alert in the sample code I’m looking at from that one. [import]uid: 52491 topic_id: 27895 reply_id: 113157[/import]

Ah… that’s where the mix up is coming from. I’m not using the sample project packaged with the build. The project I’m using was downloaded from the website a couple weeks ago.

  • Mike [import]uid: 14700 topic_id: 27895 reply_id: 113216[/import]

Yup, that would do it :wink: [import]uid: 52491 topic_id: 27895 reply_id: 113312[/import]