$cordovaMedia does not work for recording audio

I am trying to record audio using ngCordova plugin. I’m testing it on iOS simulator.

The code looks as below.

var src = "audio.mp3";
var media = $cordovaMedia.newMedia(src);
media.startRecord();

The first two line runs without any problem, when my app is trying to run “media.startRecord();” line, the system gives the error like below.

5     951571   log      exeption nativeEvalAndFetch : TypeError: undefined is not an object (evaluating 'q.reject')
6     951572   log      exeption nativeEvalAndFetch : TypeError: undefined is not an object (evaluating 'q.reject')

Is there anyone knowing what this error means? We googled for a long time, but there was no clear answer for this issue.

Our possible guess is 1) because it runs on simulator, 2) we needed to set any permission setting for microphone (we did not do anything on permission, no related documentation so far).

Looking forward to your help.

Thanks in advance for your help.

  • Jeungmin.

Hey ohtangza. I am have a similar issue using this plugin. Have you been able to resolve it?

As I remember, I eventually make it work.

But my memory is blurred for now.

My suggestions are those.

  1. Make sure that your device ready. There is callback like onDeviceReady().

  2. Try to run on actual device. For some codes, if I remember correctly, simulator and actual device work in different way.

Sorry for not accurate reply for this question.

Jeungmin.

Same issue, how to solve this?