NIMMediaManager Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | NIMMediaManagerProtocol.h |
recordProgressUpdateTimeInterval
required method
录音进度更新间隔
@property (nonatomic, assign) NSTimeInterval recordProgressUpdateTimeInterval
Discussion
录音进度更新间隔
如果值大于0,则会按照相应间隔调用recordAudioProgress:回调,默认值为0.3
Declared In
NIMMediaManagerProtocol.h
– switchAudioOutputDevice:
required method
切换音频输出设备
- (BOOL)switchAudioOutputDevice:(NIMAudioOutputDevice)outputDevice
Parameters
outputDevice |
音频输出设备 |
---|
Return Value
是否切换成功
Discussion
切换音频输出设备
Declared In
NIMMediaManagerProtocol.h
– setNeedProximityMonitor:
required method
在播放声音的时候,如果手机贴近耳朵,是否需要自动切换成听筒播放
- (void)setNeedProximityMonitor:(BOOL)needProximityMonitor
Parameters
needProximityMonitor |
是否需要贴耳传感器监听 |
---|
Discussion
在播放声音的时候,如果手机贴近耳朵,是否需要自动切换成听筒播放
Declared In
NIMMediaManagerProtocol.h
– isPlaying
required method
是否正在播放音频
- (BOOL)isPlaying
Discussion
是否正在播放音频
Declared In
NIMMediaManagerProtocol.h
– play:
required method
播放音频文件
- (void)play:(NSString *)filepath
Parameters
filepath |
音频文件路径 |
---|
Discussion
播放音频文件
开始播放,NIMMediaManagerDelegate中的playAudio:didBeganWithError:回调会被触发,播放完成后, NIMMediaManagerDelegate中的playAudio:didCompletedWithError:回调会被触发
Declared In
NIMMediaManagerProtocol.h
– stopPlay
required method
停止播放音频
- (void)stopPlay
Discussion
停止播放音频
音频播放完成后NIMMediaManagerDelegate中的playAudio:didCompletedWithError:回调会被触发
Declared In
NIMMediaManagerProtocol.h
– seek:
required method
设置播放音频的起始时间
- (BOOL)seek:(NSTimeInterval)timestamp
Parameters
timestamp |
起始时间 |
---|
Declared In
NIMMediaManagerProtocol.h
– isRecording
required method
是否正在录音
- (BOOL)isRecording
Discussion
是否正在录音
Declared In
NIMMediaManagerProtocol.h
– recordForDuration:
required method
开始录制音频
- (void)recordForDuration:(NSTimeInterval)duration
Parameters
duration |
最长录音时间 |
---|
Discussion
开始录制音频
开始录音,NIMMediaManagerDelegate中的recordAudio:didBeganWithError:回调会被触发,录音完成后, NIMMediaManagerDelgate中的recordAudio:didCompletedWithError:回调会被触发 默认使用 aac 编码格式
Declared In
NIMMediaManagerProtocol.h
– record:duration:
required method
开始录音
- (void)record:(NIMAudioType)type duration:(NSTimeInterval)duration
Parameters
type |
音频类型 |
---|---|
duration |
最大时长 |
Discussion
开始录音
开始录音,NIMMediaManagerDelegate中的recordAudio:didBeganWithError:回调会被触发,录音完成后, NIMMediaManagerDelegate中的recordAudio:didCompletedWithError:回调会被触发
Declared In
NIMMediaManagerProtocol.h
– stopRecord
required method
停止录制音频
- (void)stopRecord
Discussion
停止录制音频
停止录音后NIMMediaManagerDelegate中的recordAudio:didCompletedWithError:回调会被触发
Declared In
NIMMediaManagerProtocol.h
– cancelRecord
required method
取消录制音频
- (void)cancelRecord
Discussion
取消录制音频
录音取消后,NIMMediaManagerDelegate中的recordAudioDidCancelled回调会被触发
Declared In
NIMMediaManagerProtocol.h
– recordPeakPower
required method
获取录音分贝
- (float)recordPeakPower
Discussion
获取录音分贝
Declared In
NIMMediaManagerProtocol.h
– recordAveragePower
required method
获取录音分贝
- (float)recordAveragePower
Discussion
获取录音分贝
Declared In
NIMMediaManagerProtocol.h
– transAudioToText:result:
required method
语音转文字
- (void)transAudioToText:(NIMAudioToTextOption *)option result:(NIMAudioToTextBlock)result
Parameters
option |
语音转文字选项 |
---|---|
result |
完成回调 |
Discussion
语音转文字
Declared In
NIMMediaManagerProtocol.h
– disableResetAudioSession:
required method
禁止在IM 录制、播放音频时设置AVAudioSession, 防止影响其他音视频效果
- (void)disableResetAudioSession:(BOOL)disabled
Parameters
disabled |
YES则禁止重置 |
---|
Discussion
禁止在IM 录制、播放音频时设置AVAudioSession, 防止影响其他音视频效果
Declared In
NIMMediaManagerProtocol.h
– setDeactivateAudioSessionAfterComplete:
required method
设置录制或者播放完成以后是否自动deactivate AVAudioSession
- (void)setDeactivateAudioSessionAfterComplete:(BOOL)deactivate
Parameters
deactivate |
是否deactivate,默认为YES |
---|
Discussion
设置录制或者播放完成以后是否自动deactivate AVAudioSession
Declared In
NIMMediaManagerProtocol.h
– addDelegate:
required method
添加多媒体委托
- (void)addDelegate:(id<NIMMediaManagerDelegate>)delegate
Parameters
delegate |
多媒体委托 |
---|
Discussion
添加多媒体委托
Declared In
NIMMediaManagerProtocol.h
– removeDelegate:
required method
移除多媒体委托
- (void)removeDelegate:(id<NIMMediaManagerDelegate>)delegate
Parameters
delegate |
多媒体委托 |
---|
Discussion
移除多媒体委托
Declared In
NIMMediaManagerProtocol.h