2 qq 32013343 qq_32013343 于 2016.02.26 13:24 提问

iOS 麦克风 audio数据的获取不走协议方法 10C

AVCaptureSession *session = [[AVCaptureSession alloc] init];

                AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio];

                NSError *error;

                AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error];

                [session addInput:input];

                AVCaptureAudioDataOutput *outPut = [[AVCaptureAudioDataOutput alloc] init];

                //dispatch_queue_t AudioDataOutputQueue = dispatch_queue_create("AudioDataOutputQueue", DISPATCH_QUEUE_SERIAL);
                //NSOperationQueue *queue = [[NSOperationQueue alloc] init];

                dispatch_queue_t AudioDataOutputQueue = dispatch_queue_create("audioDataOutPutQueue", DISPATCH_QUEUE_SERIAL);

                [outPut setSampleBufferDelegate:self queue:AudioDataOutputQueue];

                [session addOutput:outPut];

                [session startRunning];


                                    不走-(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection的方法,哪位大神帮忙解答一下

3个回答

sun2728
sun2728   2016.02.26 17:15

检查delegate
转为NSData传出来

sun2728
sun2728   2016.02.26 17:16

检查delegate

转为NSData传出来

dd90702
dd90702   2016.02.27 17:14

将AVCaptureSession 设置成全局变量试试

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!