RTC Room Engine
SDK 实现音效设置的相关功能。setAllMusicVolume
接口并传入一个 Int 值,来设置背景音乐的音量。setAllMusicVolume
设置背景音乐音量的示例:import RTCRoomEngineimport TXLiteAVSDK_Professionallet audioEffectManager = TUIRoomEngine.sharedInstance().getTRTCCloud().getAudioEffectManager()let volume = 60audioEffectManager.setAllMusicVolume(volume)
TXAudioEffectManager audioEffectManager = TUIRoomEngine.sharedInstance().getTRTCCloud().getAudioEffectManager();int volume = 60;audioEffectManager.setAllMusicVolume(volume);
setVoiceVolume
接口并传入一个 Int 值,来设置背景音乐的音量。setVoiceVolume
设置语音音量为60的示例:import RTCRoomEngineimport TXLiteAVSDK_Professionallet audioEffectManager = TUIRoomEngine.sharedInstance().getTRTCCloud().getAudioEffectManager()let volume = 60audioEffectManager.setVoiceVolume(volume)
TXAudioEffectManager audioEffectManager = TUIRoomEngine.sharedInstance().getTRTCCloud().getAudioEffectManager();int volume = 60;audioEffectManager.setVoiceCaptureVolume(volume);
enableVoiceEarMonitor
接口并传入一个 Bool 值,来设置是否开启耳返。enableVoiceEarMonitor
接口开启耳返的示例:import RTCRoomEngineimport TXLiteAVSDK_Professionallet audioEffectManager = TUIRoomEngine.sharedInstance().getTRTCCloud().getAudioEffectManager()let enable = trueaudioEffectManager.enableVoiceEarMonitor(enable)
TXAudioEffectManager audioEffectManager = TUIRoomEngine.sharedInstance().getTRTCCloud().getAudioEffectManager();boolean enable = true;audioEffectManager.enableVoiceEarMonitor(enable);
setVoiceEarMonitorVolume
接口并传入一个 Int 值,来设置耳返的音量。setVoiceEarMonitorVolume
设置耳返音量为60的示例:import RTCRoomEngineimport TXLiteAVSDK_Professionallet audioEffectManager = TUIRoomEngine.sharedInstance().getTRTCCloud().getAudioEffectManager()let volume = 60audioEffectManager.setVoiceEarMonitorVolume
(volume)
TXAudioEffectManager audioEffectManager = TUIRoomEngine.sharedInstance().getTRTCCloud().getAudioEffectManager();int volume = 60;audioEffectManager.setVoiceEarMonitorVolume(volume);
setVoiceChangerType
接口并传入一个TXVoiceChangeType
值,来设置人声的变声效果。TXVoiceChangeType
为一个枚举,包含以下类型:枚举 | 取值 | 描述 |
TXVoiceChangeType_0 | 0 | 关闭 |
TXVoiceChangeType_1 | 1 | 熊孩子 |
TXVoiceChangeType_2 | 2 | 萝莉 |
TXVoiceChangeType_3 | 3 | 大叔 |
TXVoiceChangeType_4 | 4 | 重金属 |
TXVoiceChangeType_5 | 5 | 感冒 |
TXVoiceChangeType_6 | 6 | 外语腔 |
TXVoiceChangeType_7 | 7 | 困兽 |
TXVoiceChangeType_8 | 8 | 肥宅 |
TXVoiceChangeType_9 | 9 | 强电流 |
TXVoiceChangeType_10 | 10 | 重机械 |
TXVoiceChangeType_11 | 11 | 空灵 |
setVoiceChangerType
接口设置人声变声效果为 熊孩子 的示例:import RTCRoomEngineimport TXLiteAVSDK_Professionallet audioEffectManager = TUIRoomEngine.sharedInstance().getTRTCCloud().getAudioEffectManager()let type: TXVoiceChangeType = ._1audioEffectManager.setVoiceChangerType
(type)
TXAudioEffectManager audioEffectManager = TUIRoomEngine.sharedInstance().getTRTCCloud().getAudioEffectManager();TXAudioEffectManager.TXVoiceChangerType type = TXAudioEffectManager.TXVoiceChangerType.TXLiveVoiceChangerType_1;audioEffectManager.setVoiceChangerType(type);
setVoiceReverbType
接口并传入一个TXVoiceReverbType
值,来设置混响效果。TXVoiceReverbType
为一个枚举,包含以下类型:枚举 | 取值 | 描述 |
TXVoiceReverbType_0 | 0 | 关闭特效 |
TXVoiceReverbType_1 | 1 | KTV |
TXVoiceReverbType_2 | 2 | 小房间 |
TXVoiceReverbType_3 | 3 | 大会堂 |
TXVoiceReverbType_4 | 4 | 低沉 |
TXVoiceReverbType_5 | 5 | 洪亮 |
TXVoiceReverbType_6 | 6 | 金属声 |
TXVoiceReverbType_7 | 7 | 磁性 |
TXVoiceReverbType_8 | 8 | 空灵 |
TXVoiceReverbType_9 | 9 | 录音棚 |
TXVoiceReverbType_10 | 10 | 悠扬 |
TXVoiceReverbType_11 | 11 | 录音棚2 |
setVoiceReverbType
接口设置混响效果为 KTV 的示例:import RTCRoomEngineimport TXLiteAVSDK_Professionallet audioEffectManager = TUIRoomEngine.sharedInstance().getTRTCCloud().getAudioEffectManager()let type: TXVoiceReverbType = ._1audioEffectManager.setVoiceReverbType
(type)
TXAudioEffectManager audioEffectManager = TUIRoomEngine.sharedInstance().getTRTCCloud().getAudioEffectManager();TXAudioEffectManager.TXVoiceReverbType type = TXAudioEffectManager.TXVoiceReverbType.TXLiveVoiceReverbType_1;audioEffectManager.setVoiceReverbType(type);
本页内容是否解决了您的问题?