製品アップデート情報
Tencent Cloudオーディオビデオ端末SDKの再生アップグレードおよび承認チェック追加に関するお知らせ
TRTCアプリケーションのサブスクリプションパッケージサービスのリリースに関する説明について
AudioEffectStore and DeviceStore modules from the AtomicXCore framework. These modules enable features such as microphone volume control, ear monitoring, and a variety of voice changing and reverb effects.
AudioEffectStore and DeviceStore, you can implement the following core features:Core Concept | Type | Core Responsibility & Description |
AudioChangerType | enum | Enumerates available voice changing effects, such as "child", "man", etc. |
AudioReverbType | enum | Enumerates available reverb effects, such as "ktv", "hall", etc. |
AudioEffectState | struct | Represents the current state of the audio effect module, typically used for UI rendering. Includes voice changing effect state, reverb state, ear monitoring enabled state, and ear monitor volume. |
AudioEffectStore | class | Singleton data management class for audio effects. Use it to invoke audio effect APIs. After calling an API, the corresponding state property is automatically updated. Subscribe to this reactive state to receive and monitor updates. |
DeviceState | struct | Represents the current state of the device module, typically used for UI rendering. Core properties include camera and microphone status. |
DeviceStore | class | Singleton data management class for device operations. Use it to control the camera and microphone. After calling an API, the corresponding state property is automatically updated. Subscribe to this reactive state to receive and monitor updates. |
AudioEffectStore and DeviceStore are singleton objects. Access their instances via the shared property anywhere in your project. For a complete implementation example, see AudioEffectView.swift in the TUILiveKit open-source UI demo project.import UIKitimport AtomicXCoreimport Combinelet audioEffectStore = AudioEffectStore.sharedlet deviceStore = DeviceStore.shared
UISwitch control to enable or disable in-ear monitoring.UISlider control to adjust the volume. Map the UISlider value to the range [0, 150] and call setVoiceEarMonitorVolume(_:).// 1. Enable ear monitoringaudioEffectStore.setVoiceEarMonitorEnable(enable: true)// 2. Adjust ear monitor volumeaudioEffectStore.setVoiceEarMonitorVolume(volume: 80)// 3. Disable ear monitoringaudioEffectStore.setVoiceEarMonitorEnable(enable: false)// 4. Listen for state changesaudioEffectStore.state.subscribe(StatePublisherSelector(keyPath: \\AudioEffectState.earMonitorVolume)).removeDuplicates().sink { currentVolume inprint("Ear monitor volume: \\(currentVolume)")valueLabel.text = "\\(currentVolume)" // Update UILabel to display the value}.store(in: &cancellables)
Parameter Name | Type | Description |
enable | Bool | Whether to enable ear monitoring. - true: Enable - false: Disable |
Parameter Name | Type | Description |
volume | Int | Ear monitor volume. - Value range: [0, 150] - Default: 100 |
setCaptureVolume(volume:) method of DeviceStore with the desired value.UISlider control to adjust the volume. Map the UISlider value to the range [0, 150] and call setCaptureVolume(volume:).// 1. Adjust capture volumedeviceStore.setCaptureVolume(volume: 80)// 2. Listen for state changesdeviceStore.state.subscribe(StatePublisherSelector(keyPath: \\DeviceState.captureVolume)).removeDuplicates().sink { captureVolume inprint("Capture volume: \\(captureVolume)")valueLabel.text = "\\(captureVolume)" // Update UILabel to display the value}.store(in: &cancellables)
Parameter Name | Type | Description |
volume | Int | Microphone (capture) volume. - Value range: [0, 150] - Default: 100 |
setAudioChangerType(type:) method and pass the desired enum value.// Set voice changer effect to "child"audioEffectStore.setAudioChangerType(type: .child)// Disable voice changer effectaudioEffectStore.setAudioChangerType(type: .none)
Parameter Name | Type | Description |
type | AudioChangerType | Voice changer effect enumeration. |
setAudioReverbType(type:) method and pass the desired enum value.// Set reverb effect to "KTV"audioEffectStore.setAudioReverbType(type: .ktv)// Disable reverb effectaudioEffectStore.setAudioReverbType(type: .none)
Parameter Name | Type | Description |
type | AudioReverbType | Reverb effect enumeration. |
reset() method.class YourMainViewController: UIViewController {func reset() {AudioEffectStore.shared.reset()DeviceStore.shared.reset()}}
Store/Component | Description | API Reference |
DeviceStore | Controls audio/video devices: microphone (on/off, volume), camera (on/off, switch, quality), screen sharing, and real-time device status monitoring. | |
AudioEffectStore | Audio effects: voice changing (child/male), reverb (KTV, etc.), ear monitoring adjustment, and real-time effect switching. |
AudioEffectStore and DeviceStore settings are globally effective. You can call relevant APIs (such as setting voice changing effects, reverb, or ear monitoring) at any time before or after entering a live room. Settings take effect immediately and persist.DeviceStore.setCaptureVolume(). Controls the volume your audience hears.AudioEffectStore.setVoiceEarMonitorVolume(). It only determines the volume level you hear in your in-ear monitor and does not affect the audience.AudioEffectStore and DeviceStore are singletons, audio effect and device settings are globally applied. If you previously set audio effects and did not reset them, those settings persist. Call the reset() method at the appropriate time to clear them.AudioChangerType and AudioReverbType can be enabled simultaneously. For example, you can set both AudioChangerType.LITTLE_GIRLand AudioReverbType.KTV at the same time.フィードバック