logo
Live Streaming
On this page

AI Voice Changer

2024-01-02

Feature Introduction

The "Conan's Voice Changer Bowtie" in real-time calls perfectly reproduces the timbre and rhythm of the target character while preserving the user's speech rate, emotion, and intonation. Switch timbres at will, with ultra-low latency allowing users to enjoy social chat, live streaming, game voice, and other scenarios freely.

Warning
  • The "AI Voice Changer" feature is a paid feature. If you need to apply for experience or consult official pricing, please contact ZEGO business personnel.
  • This feature is supported from version 3.10.0. The current official website SDK does not include this feature. If necessary, please contact ZEGO technical support for special packaging.
  • Currently, this feature does not support simultaneous use with "Custom Audio Processing".

Feature Advantages

  • Ultra-high sound quality, ultra-low latency.
  • Vivid and realistic, perfectly reproducing the timbre and rhythm of the target character while preserving the user's speech rate, emotion, and intonation.
  • Massive timbres for flexible selection, supports timbre customization.

Effect Demonstration

Original VoiceTarget TimbreAfter AI Voice Changer
Young Male
Adult Male
Young Female
Adult Female

Applicable Scenarios

This feature can be used in the following real-time scenarios to achieve user timbre transformation.

  • Social chat
  • Game voice
  • Audio and video live streaming
  • Virtual human

Prerequisites

Before implementing the AI voice changer feature, please ensure:

Usage Steps

Developers can complete the related settings of AI voice changer according to the following steps:

1 Enable permission

Please confirm that you have contacted ZEGO technical support for special packaging and enabled the AI voice changer permission.

2 Initialize and login room

For the specific process of initializing and logging in to the room, please refer to "Create Engine" and "Login Room" in the implementation video call documentation.

3 Initialize AI voice changer engine instance

  1. Call the createAIVoiceChanger interface to create an AI voice changer engine instance.

    Currently only supports creating one instance at the same time. Creating again before calling the destroyAIVoiceChanger interface to destroy the instance will return nil.

    // Create AI voice changer engine instance
    self.aiVoiceChanger = [[ZegoExpressEngine sharedEngine] createAIVoiceChanger];
  2. Call the ZegoAIVoiceChanger.setEventHandler interface to set the AI voice changer engine event callback.

    // Set AI voice changer engine event callback
    [self.aiVoiceChanger setEventHandler:self];
  3. Call the ZegoAIVoiceChanger.initEngine interface to initialize the AI voice changer engine instance.

    Warning

    The ZegoAIVoiceChanger.initEngine interface must be called before the startPublishingStream interface to take effect.

    // Initialize AI voice changer engine
    [self.aiVoiceChanger initEngine];

4 Update AI voice changer engine model

Call the ZegoAIVoiceChanger.update interface to update the AI voice changer engine model. The AI voice changer engine model file is large, and the first update will take a long time. Please wait patiently.

// Update AI voice changer engine model
[self.aiVoiceChanger update];

5 Get timbre list

Call the ZegoAIVoiceChanger.getSpeakerList interface to get the available timbre list.

The available timbre list will be returned through the ZegoAIVoiceChangerEventHandler.onGetSpeakerList callback interface.

// Get available timbre list
[self.aiVoiceChanger getSpeakerList];

6 Set target timbre

Call the ZegoAIVoiceChanger.setSpeaker interface to set the timbre. The selection of timbre can be obtained through 5 Get Timbre List.

Setting the timbre ID to 0 means using the original voice.

// Set timbre
int speakerID = 0; // Timbre ID
[self.aiVoiceChanger setSpeaker:speakerID];

7 Destroy AI voice changer engine instance

After using the feature, call the destroyAIVoiceChanger interface to destroy the AI voice changer engine instance and release resources such as the microphone.

// Destroy AI voice changer engine instance
[[ZegoExpressEngine sharedEngine] destroyAIVoiceChanger:self.aiVoiceChanger];

FAQ

  1. When compiling the project, if an error similar to "Undefined symbol" appears, how should I handle it?

    Undefined symbol:
    _$s10ObjectiveC8ObjCBoolVMn

    When the above error occurs, you can add a blank file ending with .swift in your project directory and recompile.

Previous

Custom Audio Processing

Next

Get the Raw Audio Data