Skip to main content

Voicemod Voice Changer

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 framework package into your Frameworks folder and add the package to your project.

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.

func initializeAgoraEngine() {
...
...
self.agoraKit.enableExtension(
withVendor: "Voicemod", extension: "VoicemodExtension", enabled: true)
}
Copy

iOS (Objective-C):

- (void)initializeAgoraEngine {
...
...
[self.agoraKit enableExtensionWithVendor:@"Voicemod"
extension:@"VoicemodExtension"
enabled:YES];
}
Copy

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.

iOS (Swift):

self.agoraKit.enableExtension(withVendor: "Voicemod", extension: "VoicemodExtension", enabled: false)
Copy

iOS (Objective-C):

[self.agoraKit enableExtensionWithVendor:@"Voicemod" extension:@"VoicemodExtension" enabled:NO];
Copy

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.

  • Swift

    func initVoicemodSession() {
    let userData = [
    "apiKey": <your API key>,
    "apiSecret": <your API secret>]
    do {
    let jsonData = try JSONSerialization.data(withJSONObject: userData, options: [.prettyPrinted])
    let jsonString = String(data: jsonData, encoding: .utf8)!
    self.agoraKit.setExtensionPropertyWithVendor("Voicemod", extension: "VoicemodExtension", key: "vcmd_user_data", value: jsonString)
    }

    catch {
    print("JSON serialization failed")
    }

    }
    Copy
  • Objective-C:

    - (void)initVoicemodSession:(NSString *)userId {
    NSDictionary *userData =
    @{@"apiKey" : @"<your API key>", @"apiSecret" : @"<your API secret>"};
    NSError *error;
    NSData *jsonData =
    [NSJSONSerialization dataWithJSONObject:userData
    options:NSJSONWritingPrettyPrinted
    error:&error];
    NSString *jsonString = [[NSString alloc] initWithData:jsonData
    encoding:NSUTF8StringEncoding];
    [self.agoraKit setExtensionPropertyWithVendor:@"Voicemod"
    extension:@"VoicemodExtension"
    key:@"vcmd_user_data"
    value:jsonString];
    }
    Copy

Enable a voice

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

Disable voices

let voiceJson = "null"
self.agoraKit.setExtensionPropertyWithVendor("Voicemod", extension: "VoicemodExtension", key: "vcmd_voice", value: voiceJson)
Copy

iOS (Objective-C):

NSString* voice = @"null";
[self.agoraKit setExtensionPropertyWithVendor:@"Voicemod" extension:@"VoicemodExtension" key:@"vcmd_voice" value:voice];
Copy

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.

vundefined