# Integrate an extension (/en/realtime-media/voice/build/customize-audio-processing/use-an-extension/flutter)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

Extensions are add-ons designed to rapidly extend the functionality of your app. [Extensions Marketplace](https://www.agora.io/en/agora-extensions-marketplace/) is home to extensions that make your app more fun. Extensions provide features such as Audio effects and voice changing, Face filters and background removal, and Live transcription and captioning.

    In the Agora Extensions Marketplace:

    * Vendors create and publish extensions to provide functionality such as audio and video processing.
    * App developers use extensions to quickly implement fun and interactive functionality.

    This page shows you how to integrate an extension from Agora Extensions Marketplace into your app. There can be specific guidance for each extension.

    ## Understand the tech [#understand-the-tech-6]

    An extension accesses voice and video data when it is captured from the user's local device, modifies it, then plays the updated data to local and remote video channels.

    **Extension call workflow**

    ![img](https://assets-docs.agora.io/images/video-sdk/extension-callflow.svg)

    A typical transmission pipeline consists of a chain of procedures, including capture, pre-processing, encoding, transmitting, decoding, post-processing, and play. Audio or video extensions are inserted into either the pre-processing or post-processing procedure, in order to modify the voice or video data in the transmission pipeline.

    ## Prerequisites [#prerequisites-6]

    To test the code used in this page you need to have:

    * An Agora [account](../../manage-agora-account.md) and [project](../../manage-agora-account.md).

    * A computer with Internet access.
      Ensure that no firewall is blocking your network communication.

    * Implemented the [SDK quickstart](../index.mdx).

    - [Flutter](https://docs.flutter.dev/get-started/install) 2.0.0 or higher

    - Dart 2.15.1 or higher

    - [Android Studio](https://developer.android.com/studio), IntelliJ, VS Code, or any other IDE that supports Flutter, see [Set up an editor](https://docs.flutter.dev/get-started/editor).

    - If your target platform is iOS:
      * Xcode on macOS (latest version recommended)
      * A physical iOS device
      * iOS version 12.0 or later

    - If your target platform is Android:
      * Android Studio on macOS or Windows (latest version recommended)
      * An Android emulator or a physical Android device.

    - If you are developing a desktop application for Windows, macOS or Linux, make sure your development device meets the [Flutter desktop development requirements](https://docs.flutter.dev/development/platform-integration/desktop).

    ## Project setup [#project-setup-6]

    In order to integrate an extension into your project:

    1. **Activate an extension**

       1. Log in to [Agora Console](https://console.agora.io/v2).
       2. In the left navigation panel, click **Extension Marketplace**, then click the extension you want to activate.

       You are now on the extension detail page.

       3. Select a pricing plan and click **Buy and Activate**.
          * If you have already created an Agora project:

            The **Projects** section appears and lists all of your projects.
          * If you have not created an Agora project:

            [Create a new project](../../manage-agora-account.md), the project appears in the **Projects** section.

       4. Under **Projects** on the extension detail page, find the project in which you want to use the extension, then turn on the switch in the **Action** column.

    2. **Get the apiKey and apiSecret for the extension**

       If required for the extension, to get the extension apiKey and apiSecret, in the **Projects** extension detail page, click **View** in the **Secret** column.

    3. Open your Flutter project

       Load the [SDK quickstart](../index.mdx) Voice Calling project you created previously.

    4. Get the extension

       Visit the [Agora Extensions Marketplace](https://www.agora.io/en/agora-extensions-marketplace/) and follow the procedure to download and install the desired extension.

    You are now ready to integrate the extension in your app.

    ## Integrate the extension into your project [#integrate-the-extension-into-your-project-6]

    This section presents the framework code you add to your Flutter project to integrate an extension.

    1. **Load the extension provider**

       You call `loadExtensionProvider` during Agora Engine initialization to specify the extension library path. To do this, add the following code to the `setupVideoSDKEngine` method after you initialize the engine with `agoraEngine.initialize`:

       ```dart
       agoraEngine.loadExtensionProvider("<extensionLibraryPath>");
       ```

    2. **Enable the extension**

       To enable the extension, add the following code to the `setupVideoSDKEngine` method before `await agoraEngine.enableVideo();`:

       ```dart
       // Extensions marketplace hosts both third-party extensions as well as those developed by Agora. To use an Agora extensions, you do not need to call addExtension or enableExtension.
       agoraEngine.enableExtension(
         provider: "<The name of the extension provider>",
         extension: "<extensionName>",
         type: MediaSourceType.unknownMediaSource,
         enable: true
       );
       ```

       If the extension uses the second camera to capture video, set the type parameter to `secondaryCameraSource`.

       To enable multiple extensions, call `enableExtension` for each extension. The calls to `enableExtension` determines the order of each extension in the transmission pipeline. For example, if you enable extension A before extension B, extension A processes data from Video SDK before extension B.

    3. **Set extension properties**

       To customize the extension for your particular app, set suitable values for the extension properties. Refer to the extension documentation for a list of available property names and allowable values. To set a property, add the following code to the `setupVideoSDKEngine` method after `agoraEngine.enableExtension`:

       ```dart
       agoraEngine.setExtensionProperty(
         provider: "<providerName>",
         extension: "<extensionName>",
         key: "<keyName>",
         value: "<keyValue>");
       ```

    ## Test your implementation [#test-your-implementation-6]

    To ensure that you have integrated the extension in your app:

    1. Set the variables and properties in the framework code to values suitable for your chosen extension.

    2. In your IDE, open `/lib/main.dart` and update `appId`, `channelName` and `token` with the values from Agora Console.

    3. Connect a test device to your development device.

    4. In your IDE, click **Run app** or execute the `flutter run` command in the terminal. A moment later, you see the project installed on your device.

       If this is the first time you run the app, grant camera and microphone permissions.

    5. Join the same channel from another test device or the [Agora web demo](https://webdemo.agora.io/basicVideoCall/index.html).

    6. Experience the features of your new extension.

    ## Reference [#reference-6]

    This section contains content that completes the information on this page, or points you to documentation that explains other aspects to this product.

    ### API reference [#api-reference-4]

    * [`enableExtension`](https://api-ref.agora.io/en/voice-sdk/flutter/6.x/API/class_irtcengine.html#api_irtcengine_enableextension)

    * [`loadExtensionProvider`](https://api-ref.agora.io/en/voice-sdk/flutter/6.x/API/class_irtcengine.html#api_irtcengine_loadextensionprovider)

    * [`setExtensionProperty`](https://api-ref.agora.io/en/voice-sdk/flutter/6.x/API/class_irtcengine.html#api_irtcengine_setextensionproperty)

    * [`onExtensionStarted`](https://api-ref.agora.io/en/voice-sdk/flutter/6.x/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onextensionstarted)

    * [`onExtensionStopped`](https://api-ref.agora.io/en/voice-sdk/flutter/6.x/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onextensionstopped)

    * [`onExtensionError`](https://api-ref.agora.io/en/voice-sdk/flutter/6.x/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onextensionerror)

    
  
      
  
      
  
