ZegoLiveApiAudioRecordDelegate Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | ZegoLiveRoomApi-Player.h |
– onAudioRecord:sampleRate:numOfChannels:bitDepth:type:
音频录制回调
- (void)onAudioRecord:(NSData *)audioData sampleRate:(int)sampleRate numOfChannels:(int)numOfChannels bitDepth:(int)bitDepth type:(unsigned int)type
Parameters
audioData |
SDK 返回的音频源数据 |
---|---|
sampleRate |
采样率,与 - enableSelectedAudioRecord: 参数中设置的值一致 |
numOfChannels |
通道数量,单通道 |
bitDepth |
位深度,16 bit |
type |
音源类型,请参考 enum ZegoAPIAudioRecordMask |
Discussion
- 1.开启音频录制(-enableSelectedAudioRecord:)并成功设置音频录制代理(-setAudioRecordDelegate:)对象后,SDK 会触发该回调,App 可通过此 API 获取 SDK 抛出的音频数据。用户可自行对数据进行处理,例如:存储等。
- 2.存储数据时注意取 sampleRate、numOfChannels、bitDepth 参数写包头信息。退出房间或停止录制后,不会再收到该回调。
Declared In
ZegoLiveRoomApi-Player.h
– onAudioRecord:sampleRate:numOfChannels:bitDepth:
音频录制回调
- (void)onAudioRecord:(NSData *)audioData sampleRate:(int)sampleRate numOfChannels:(int)numOfChannels bitDepth:(int)bitDepth
Discussion
Warning: Deprecated,请使用 onAudioRecord:sampleRate:numOfChannels:bitDepth:type:
Declared In
ZegoLiveRoomApi-Player.h