KSYAudioFilter Class Reference
Inherits from | NSObject |
---|---|
Declared in | KSYAudioFilter.h |
speed
速率,默认值是1.0
@property (nonatomic, assign) float speed
Discussion
取值范围从0.5 - 2.0
如果配置速率不在有效范围,则设置不生效
Declared In
KSYAudioFilter.h
– processAudioSampleBuffer:
输入音频PCM
- (void)processAudioSampleBuffer:(CMSampleBufferRef)inSampleBuffer
Parameters
sampleBuffer |
音频数据 |
---|
Declared In
KSYAudioFilter.h
– processAudioData:nbSample:withFormat:timeinfo:
输入音频PCM
- (void)processAudioData:(uint8_t **)pData nbSample:(int)nbSample withFormat:(const AudioStreamBasicDescription *)fmt timeinfo:(CMTime)pts
Parameters
pData |
数据地址 |
---|---|
nbSample |
采样点个数 |
fmt |
输入数据的音频格式 |
pts |
输入数据的时间戳 |
Declared In
KSYAudioFilter.h
audioProcessingCallback
音频处理回调接口
@property (nonatomic, copy) void ( ^ ) ( CMSampleBufferRef sampleBuffer ) audioProcessingCallback
Discussion
sampleBuffer 经过filter处理后的音频数据
请注意本函数的执行时间,如果太长可能导致不可预知的问题
请参考 CMSampleBufferRef
与pcmProcessingCallback两者只能二选一, 设置 audioProcessingCallback 会清空 pcmProcessingCallback
Declared In
KSYAudioFilter.h
pcmProcessingCallback
音频处理回调接口
@property (nonatomic, copy) void ( ^ ) ( uint8_t **pData , int nbSample , CMTime pts ) pcmProcessingCallback
Discussion
pData 为数据指针 (双通道时, 数据为交织格式), 仅pData[0] 有效
nbSample 为数据长度, 单位为sample (bytes / sizeof(sample)/channels)
请注意本函数的执行时间,如果太长可能导致不可预知的问题
与audioProcessingCallback两者只能二选一, 设置 pcmProcessingCallback 会清空audioProcessingCallback
Declared In
KSYAudioFilter.h