iPhone/iPad Audio Unit 2012/05/19
2012-05-19 12:52
471 查看
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
using the
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?
* 似乎不推荐
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
AudioQueueRefinstantiated
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?
相关文章推荐
- iPhone/iPad搞定Audio Unit声音 2012/05/15
- iphone/iPad 搞定Audio Unit 2012/05/13
- iPhone/iPad 2012/05/14 take care of Audio Unit
- UC故事+iPhone/iPad Audio Unit 2012/05/17
- iPhone/iPad Audio Unit声音播放
- UC故事与iPhone/iPad Audio Unit 2012/05/16
- iPhone/iPad开发札记2012/03/11 -2 Audio Unit
- iPhone/iPad开发扎记 2012/02/11 - 玩转iOS Audio Service
- iPhone/iPad Unit Test in xcode 4.3
- 用Chrome浏览器模拟手机,android,iphone,ipad访问网站
- iPhone的xib与iPad的xib相互转换
- App Icons on iPad and iPhone
- 在 iPad和 iPhone的浏览器上查看网页源代码
- 体验应用程序在Mac/iPhone/iPad之间的Handoff
- iTunes如何备份及恢复iPhone/iPad数据
- mac iphone ipad 截图六方法汇总
- AudioServicesPlaySystemSound 系统声音提示 iOS iPad
- iOS Audio Unit 之 Mixer Units
- Playing Video on the iPhone and iPad