-
Notifications
You must be signed in to change notification settings - Fork 6
AudioCapture
shixuemei edited this page Nov 17, 2017
·
3 revisions
- UnionAUAudioCapture基于iOS的AudioUnit接口实现的音频采集和处理功能.
- 创建音频采集对象
- (id) initWithSampleRate:(double)sampleRate;
- 启动音频采集
- (BOOL)startCapture;
- 停止音频采集
- (void)stopCapture;
- 用户自定义音频采集后回调
@property(nonatomic, copy) void(^audioProcessingCallback)(CMSampleBufferRef sampleBuffer);
@property(nonatomic, copy) void(^pcmProcessingCallback)(uint8_t** pData, int len, const AudioStreamBasicDescription* fmt, CMTime timeInfo);
audioProcessingCallback与pcmProcessingCallback两者只能二选一
@property(nonatomic, assign) int reverbType;
- 取值及效果:
reverbType= 0;//关闭
reverbType =1;//录音棚
reverbType =2;//演唱会
reverbType =3;//KTV
reverbType =4;//小舞台
@property(nonatomic, assign) UnionAudioEffectType effectType;
取值范围请参见文档
UnionAudioEffectType_NONE = 0; //关闭
UnionAudioEffectType_MALE = 1; //大叔
UnionAudioEffectType_FEMALE = 2; //萝莉
UnionAudioEffectType_HEROIC = 3; //庄重
UnionAudioEffectType_ROBOT = 4; //机器人
- 是否播放采集的声音
@property(nonatomic, assign) BOOL bPlayCapturedAudio;
- 取值从0.0~1.0;
@property(nonatomic, assign) Float32 micVolume;
- 本模块是基于AudioUnit实现的低延时音频采集模块;
- 本模块能够对采集的语音添加混响效果(目前支持4类混响场景),用户可以在音频采集的过程自由切换混响场景;
- 本模块能够对采集的声音低延时播放,帮助主播选择音效(又称"耳返");
- 本模块采集的声音通过回调函数提供出来。
- 当使用本模块时,需要禁用UnionAVFCapture中的音频采集,即在创建UnionAVFCapture对象后,不需要调用addAudioInputsAndOutputs来添加音频采集模块。