I'm trying to capture audio, using the method in this question; with AVCaptureSession and AVCaptureAudioDataOutput. This seems to work fine with 1 inconvenience: it doesn't work in the simulator. Both AVAudioRecorder, and the good old SpeakHere demo app, work fine in the simulator, using the internal microphone on my MacBook Pro.
Problem is that [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio]
gives null
in the simulator, so subsequent code fails with the message (when it tries to add null
as input to the AVCaptureSession):
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** Can't add <AVCaptureDeviceInput: 0x9138b40 [(null)]> because the device does not support AVCaptureSessionPresetHigh. Use -[AVCaptureDevice supportsAVCaptureSessionPreset:].'
Is there an easy way to get this to work in the simulator?