Documentation
ExpressVideoSDK Video Call
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • Video Call
  • Upgrade using advanced features
  • Distincitve features
  • AI voice changer

AI voice changer

Last updated:2024-09-05 18:43

Overview

The AI voice changer changes a user's voice as needed while retaining the original speed, emotion, and pitch, guaranteeing user experience with its ultra-low latency in real-time communication scenarios, such as social media voice chat, live streaming, and in-game voice chat.

  • The AI voice changer is a paid feature. For more information about free trials or official billing, contact ZEGOCLOUD business staff.
  • This feature is available for ZEGO Express SDK 3.10.0 or later and is unavailable for the SDK on the official website. If you need to use it, contact ZEGOCLOUD technical support for dedicated package building.
  • This feature cannot work with the "Customize how the audio processes" feature.

Advantages

  • Boasts premium sound quality and ultra-low latency.
  • Delivers natural-sounding outputs by changing the voice while retaining the original speed, emotion, and pitch.
  • Offers massive timbres that can be flexibly selected and customized.
### Effect demonstration
Original sound After AI voice change After AI voice change
Your browser does not support the audio tag.
Young men
Your browser does not support the audio tag.
Your browser does not support the audio tag.
Adult male 1
Your browser does not support the audio tag.
Your browser does not support the audio tag.

Effect demonstration

Original voice After AI voice change
您的浏览器不支持 audio 标签。
Adult male 1
您的浏览器不支持 audio 标签。
Adult male 2
您的浏览器不支持 audio 标签。
Adult female 1
您的浏览器不支持 audio 标签。
Adult female 2
您的浏览器不支持 audio 标签。

Applicable scenarios

This feature is applicable to the following real-time scenarios.

  • Social media voice chat
  • In-game voice chat
  • Live audio and video streaming
  • Virtual avatar

Prerequisites

Before you implement the AI voice changer feature, ensure that the following conditions are met:

  • A project has been created in ZEGOCLOUD Console and applied for a valid AppID and AppSign. For details, please refer to Console - How to view project information .
  • ZEGO Express SDK has been integrated into the project to implement basic real-time audio and video functions. For details, please refer to Integrate the SDK and Implement a basic video call.

Procedure

Below are steps for configuring the AI voice changer.

1. Grant permission

Ensure that you have contacted ZEGO technical support to build a package for the AI voice changer and granted permission for this feature.

2. Initialize the ZEGO Express SDK and log in to a room

Initialize the ZEGO Express SDK and log in to a room. For more information, see 3.1 Create a ZegoExpressEngine instance and 3.2 Log in to a room in the "Implementation steps" section of the "Implement a basic video call" topic in the "Video Call" documentation.

3. Initialize the AI voice changer instance

  1. To create an AI voice changer instance, call the createAIVoiceChanger operation.

    You can create only one instance at a time. If you create a second instance before calling the destroyAIVoiceChanger operation to destroy the existing one, null will be returned.

    // Create an AI voice changer instance.
    aiVoiceChanger = ZegoExpressEngine.getEngine().createAIVoiceChanger();
  2. To set event callbacks for the AI voice changer, call the ZegoAIVoiceChanger.setEventHandler operation.

    // Set event callbacks for the AI voice changer.
    aiVoiceChanger.setEventHandler(new IZegoAIVoiceChangerEventHandler() {
        @Override
        public void onInit(ZegoAIVoiceChanger aiVoiceChanger, int errorCode) {
            super.onInit(aiVoiceChanger, errorCode);
        }
    
        @Override
        public void onUpdate(ZegoAIVoiceChanger aiVoiceChanger, int errorCode) {
            super.onUpdate(aiVoiceChanger, errorCode);
        }
    
        @Override
        public void onGetSpeakerList(ZegoAIVoiceChanger aiVoiceChanger, int errorCode, ArrayList<ZegoAIVoiceChangerSpeakerInfo> speakerList) {
            super.onGetSpeakerList(aiVoiceChanger, errorCode, speakerList);
        }
    });
  3. To initialize the AI voice changer instance, call the ZegoAIVoiceChanger.initEngine operation.

    The ZegoAIVoiceChanger.initEngine operation must be called before you call the startPublishingStream operation.

    // Initialize the AI voice changer instance.
    aiVoiceChanger.initEngine();

4. Update the AI voice changer instance

To update the AI voice changer instance, call the ZegoAIVoiceChanger.update operation. The first update will take a long time due to the large size of the instance file.

// Update the AI voice changer instance.
aiVoiceChanger.update();

5. Obtain the list of timbres

To obtain the list of available timbres, call the ZegoAIVoiceChanger.getSpeakerList operation.

The list will be returned in the IZegoAIVoiceChangerEventHandler.onGetSpeakerList callback.

// Obtain the list of available timbres.
aiVoiceChanger.getSpeakerList();

6. Specify a timbre

Call the ZegoAIVoiceChanger.setSpeaker operation to specify a timbre from the list obtained in 5. Obtain the list of timbres.

If the timbre ID is set to 0, the original voice is used.

// Specify a timbre.
int speakerID = 0; // The timbre ID.
aiVoiceChanger.setSpeaker(speakerID);

7. Destroy the AI voice changer instance

Call the destroyAIVoiceChanger operation to destroy the AI voice changer instance and release resources, such as the microphone.

// Destroy the AI voice changer instance.
ZegoExpressEngine.getEngine().destroyAIVoiceChanger(aiVoiceChanger);

FAQs

  1. What should I do if the following error occurs when building the .apk package?

    java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics;

    The error is due to the missing kotlin-stdlib dependency. You can add it to the build.gradle file and build the .apk package again.

    dependencies {
        implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.30'
    }
Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code