AudioEffectStore provides a complete set of audio effect management APIs, including voice changer effects, reverb effects, and ear monitor functionality. Through this class, anchors can adjust their voice effects in real-time during live streaming to enhance the experience.AudioEffectStore instance. The set effects will automatically become invalid after leaving the room, and need to be set again for the next room entry.Property | Type | Description |
audioChangerType | Voice changer state. | |
audioReverbType | Reverb state. | |
isEarMonitorOpened | Bool | Ear monitor enabled. |
earMonitorVolume | Int | Ear monitor volume, with a value range from 0 to 100.
If the volume is still too low after setting it to 100, you can set the volume to a maximum of 150, but a volume exceeding 100 may cause distortion, please operate with caution. |
Function | Description |
Get singleton instance. | |
Set voice changer effect. | |
Set reverb effect. | |
Enable/disable ear monitor. | |
Set ear monitor volume. | |
Reset to default state. |
public func setAudioChangerType(type: AudioChangerType) {fatalError("\\(#function) must be overridden by subclass")}
Parameter | Type | Description |
type | Voice changer effect type. |
public func setAudioReverbType(type: AudioReverbType) {fatalError("\\(#function) must be overridden by subclass")}
Parameter | Type | Description |
type | Reverb effect type. |
public func setVoiceEarMonitorEnable(enable: Bool) {fatalError("\\(#function) must be overridden by subclass")}
Parameter | Type | Description |
enable | Bool | Whether to enable ear monitor. |
public func setVoiceEarMonitorVolume(volume: Int) {fatalError("\\(#function) must be overridden by subclass")}
Parameter | Type | Description |
volume | Int | Ear monitor volume, with a value range from 0 to 100. (Range: Value range from 0 to 100, exceeding 100 may cause distortion) (Default: 100). |
public func reset() {fatalError("\\(#function) must be overridden by subclass")}
Enum Value | Value | Description |
none | 0 | Disable effect. |
child | 1 | Child. |
littleGirl | 2 | Little girl. |
man | 3 | Uncle. |
heavyMetal | 4 | Heavy metal. |
cold | 5 | Cold. |
foreigner | 6 | Foreign accent. |
trappedBeast | 7 | Trapped beast. |
fatso | 8 | Otaku. |
strongCurrent | 9 | Strong current. |
heavyMachinery | 10 | Heavy machinery. |
ethereal | 11 | Ethereal. |
Enum Value | Value | Description |
none | 0 | Disable effect. |
ktv | 1 | KTV. |
smallRoom | 2 | Small room. |
auditorium | 3 | Auditorium. |
deep | 4 | Deep. |
loud | 5 | Loud. |
metallic | 6 | Metallic. |
magnetic | 7 | Magnetic. |
Property | Type | Description |
audioChangerType | Voice changer state. | |
audioReverbType | Reverb state. | |
isEarMonitorOpened | Bool | Ear monitor enabled. |
earMonitorVolume | Int | Ear monitor volume, with a value range from 0 to 100.
If the volume is still too low after setting it to 100, you can set the volume to a maximum of 150, but a volume exceeding 100 may cause distortion, please operate with caution. |
// Get singleton instancelet store = AudioEffectStore.shared// Subscribe to state changesstore.state.subscribe { state inprint("Current voice changer: \\(state.audioChangerType)")print("Current reverb: \\(state.audioReverbType)")print("Ear monitor enabled: \\(state.isEarMonitorOpened)")}// Set voice changer effectstore.setAudioChangerType(type: .littleGirl)// Set reverb effectstore.setAudioReverbType(type: .ktv)// Enable ear monitorstore.setVoiceEarMonitorEnable(enable: true)store.setVoiceEarMonitorVolume(volume: 80)
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan