1
我的代碼工作正常在iOS6的但不是在iOS的7,請指導錄音在iOS7通過AudioQueueStart功能
UInt32 enableMetering = 0;
status = AudioQueueSetProperty(recordState.queue, kAudioQueueProperty_EnableLevelMetering, &enableMetering,sizeof(enableMetering));
if (status) {fprintf(stderr, "Could not enable metering\n"); return NO;}
// this line giving error
**status = AudioQueueStart(recordState.queue, NULL);**
if (status) {fprintf(stderr, "Could not start Audio Queue\n"); return NO;}
recordState.currentPacket = 0;
recordState.recording = YES;
return YES;
錯誤是
Could not start Audio Queue
Error starting recording
請指導...
添加以下代碼的應用程序didFinishLaunchingWithOptions: AVAudioSession * audioSession = [AVAudioSession sharedInstance] [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil]; [audioSession setActive:YES error:nil]; – Kalaichelvan