capture audio

Jan 7, 2013 at 8:52 PM

I am writing an app which will make use of the microphone and I'm basing some of my code on a sample from dev.windows and from the mediacapture in codeshow. The codeshow example however, breaks when I hit the "capture audio" button, and i get this error:

0x800a138f - JavaScript runtime error: Unable to get property 'id' of undefined or null reference

in line:

captureInitSettings.audioDeviceId = devices[MY_HEADPHONES_ID].id;

Does anyone know what the solution to that is? it might help me with my app

Thank you.

Apr 7 at 7:48 PM
same problem with me on my project.
Coordinator
Apr 7 at 8:06 PM
In that example, I'm referring specifically to my headset which I believe was at ID=1. It's a zero-based array, so 1 is the second audio recording device on the system. If you simply change MY_HEADPHONES_ID to 0, then it will likely work, but to be correct, you need to implement the code to enumerate the audio recording devices on the system and let you user choose which one to record from.
Marked as answer by codefoster on 4/17/2014 at 3:12 PM