Skip to main content

Voicemod

This guide is provided by Voicemod. Agora is planning a documentation upgrade program for all extensions on the marketplace. Please stay tuned.

Integrate Voicemod extension

You download the libraries and example code from the Agora dashboard.

Place the aar file into the libs folder of your project and link to the file, e.g., in build.gradle file:


_4
dependencies {
_4
implementation(name: 'voicemod-audio-filter-extension', ext: 'aar')
_4
...
_4
}

Enable the extension

Please note: There is currently no callback that notifies the app when the extension has been enabled, and enabling the extension can take up to a few seconds.


_10
public void initializeAgoraEngine() {
_10
RtcEngineConfig config = new RtcEngineConfig();
_10
...
_10
config.addExtension("VoicemodExtension");
_10
...
_10
...
_10
mRtcEngine = RtcEngine.create(config);
_10
...
_10
mRtcEngine.enableExtension("Voicemod", "VoicemodExtension", true);
_10
}

Disable the extension

Don’t forget to disable the extension when your app closes! You will eventually be charged for usage, so it’s important that your app disables the extension when exiting the app.


_1
mRtcEngine.enableExtension("Voicemod", "VoicemodExtension", false);

Initialize Voicemod

To start the extension, set your project’s API key and API secret

Please note: A request to initialise the Voicemod extension will fail unless the extension has been successfully enabled.


_7
public void initVoicemodSession(String userId) {
_7
String userData = "{" +
_7
"apiKey": "your API key"," +
_7
"apiSecret": "your API secret" +
_7
"}";
_7
mRtcEngine.setExtensionProperty("Voicemod", "VoicemodExtension", "vcmd_user_data", userData);
_7
}

Enable a voice

Please note: A request to set the voice will fail unless the Voicemod extension has been successfully initialized.


_2
String voice = "\"titan\"";
_2
mRtcEngine.setExtensionProperty("Voicemod", "VoicemodExtension", "vcmd_voice", voice);

  • Swift:


    _2
    let voiceJson = String(format: "\"%@\"", vcmdVoices[row])
    _2
    self.agoraKit.setExtensionPropertyWithVendor("Voicemod", extension: "VoicemodExtension", key: "vcmd_voice", value: voiceJson)

  • Objective-C:


    _5
    NSString* voice = [NSString stringWithFormat:@"\"%@\"", @"titan"];
    _5
    [self.agoraKit setExtensionPropertyWithVendor:@"Voicemod"
    _5
    extension:@"VoicemodExtension"
    _5
    key:@"vcmd_voice"
    _5
    value:voice];

Disable voices


_2
String voice = "null";
_2
mRtcEngine.setExtensionProperty("Voicemod", "VoicemodExtension", "vcmd_voice", voice);

Reference

Voicemod Properties

You can configure and control the Voicemod extension using the following properties.

Before you can use the extension, you must provide your API key and API secret by setting the vcmd_user_data property.

With the exception of vcmd_user_data and vcmd_version, the extension must be initialised for Voicemod property accessors to work.

Property KeyProperty ValueAccessDescription
vcmd_user_dataobject: { apiKey: “project api key”, apiSecret: “project api secret” }setSet API key, API secret
vcmd_versionstring: “MAJOR.MINOR.PATCH”getGet Voicemod plugin version
vcmd_voicestringget, setSet or get the current voice (“null” for no voice)
vcmd_presetsarray of strings: [“magic-chords”, “baby”, “cave”, “titan”, “robot”, “lost-soul”]getGet list of existing voices
vcmd_background_soundsbooleansetToggle background sounds
vcmd_mutebooleanget, setToggle mute audio samples, get current setting

FAQ

How do I add the extension to my Agora Marketplace App?

To use the extension, download the file(s) corresponding to your operating system(s) from our releases repository, and follow the instructions in the documentation page.

How large is the extension?

The extension currently uses 14MB of storage space for Android and 32MB for iOS.

What pricing plans are available?

The extension is free for all until 31st December 2021, and will be charged at $1/1000 minutes after that.

What are Voicemod’s Terms and Conditions?

Please read our End User License Agreement.

Can I get more voices?

We will be releasing an extended voice pack soon. Stay tuned!

Can I use other Voicemod features such as Soundboard?

We don’t currently support the use of Soundboard within an Agora Marketplace app, but we’re working on it. Stay tuned for v2 of our extension.