qq_32013343
Xinghan Chen
2016-02-26 05:24
采纳率: 100%
浏览 2.0k
已采纳

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

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
    西瓜入归未有时 2016-02-26 09:15
    已采纳

    检查delegate
    转为NSData传出来

    点赞 评论
  • sun2728
    西瓜入归未有时 2016-02-26 09:16

    检查delegate

    转为NSData传出来

    点赞 评论
  • dd90702
    青欢 2016-02-27 09:14

    将AVCaptureSession 设置成全局变量试试

    点赞 评论

相关推荐