iPhone/iPad Audio Unit 2012/05/19


1. 使用Audio Unit采集声音 (耗时2:30小时)

* 似乎不推荐

There are two other main design patterns for audio units hosting. To record or analyze audio, create an input-only app with a render callback function. The callback function is invoked by your application, and it in turn invokes the render method of the Remote I/O unit’s input element. However, in most cases, a better choice for an app like this is to use an input audio queue object (of type AudioQueueRef instantiated using the AudioQueueNewInputfunction), as explained in Audio Queue Services Programming Guide. Using an audio queue object provides a great deal more flexibility because its render callback function is not on a realtime thread.


Q:似乎若真要做,似乎意思是没有call back把captured audio传过来,需要自己实现类似机制?


* 设置input element的output scope,render callback function:没有用!

    // for output ? call back render 

  AURenderCallbackStruct callback_struct;

callback_struct.inputProc = renderCallback;

callback_struct.inputProcRefCon =self;

ASSERT_OK(AudioUnitSetProperty(audioUnit, 

                                   kAudioUnitProperty_SetRenderCallback,//

                                  //kAudioOutputUnitProperty_SetInputCallback,

                                   kAudioUnitScope_Output,// output callback handler 

                                  1, // for input bus ( bus/element 1) 

                                   &callback_struct, 

                                  sizeof(callback_struct)));


注:callback未被执行!

* 另一种可能性:

在output element的input scope callback中去拿到这个数据???

与此同时,disable output element的output scope?



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值