Compile and run a sample project

Updated

Compile and run a project using Agora SDK

Agora provides Open-source sample projects on GitHub to demonstrate the implementation of basic and advanced Voice SDK features.

This page shows how to compile, configure, and run the Voice SDK Unity sample project.

Prerequisites

  • Unity Hub and Unity Editor 2018.4.0 or higher

  • A suitable operating system and compiler for your development platform:

    Development platformOperating system versionCompiler version
    AndroidAndroid 4.1 or laterAndroid Studio 4.1 or later
    iOSiOS 10.15 or laterXcode 9.0 or later
    macOSmacOS 10.15 or laterXcode 9.0 or later
    WindowsWindows 7 or laterMicrosoft Visual Studio 2017 or later
  • A microphone

  • A valid Agora account and project. Please refer to Agora account management for details.

  • Installed Git

Project setup

Get the sample project

Obtain the sample project using one of the following methods:

  • Go to the SDKs page, download the latest version of the Agora Voice SDK, and unzip it. You see a .unitypackage file.

    Open the .unitypackage file. An Import Unity Package window pops up. Click Import to import the SDK into your project. After the import is complete, you see the Agora-RTC-PLUGIN folder in the project panel.

  • Run the following command to clone the repository locally:

    git clone https://github.com/AgoraIO-Extensions/Agora-Unity-Quickstart.git
    cd Agora-Unity-Quickstart/API-Example-Unity

Configure the sample project

In Agora-RTC-PLUGIN/API-Example/AppIdInput.asset, fill in the App ID, temporary token, and channel name you obtained from the Agora Console.

Run the sample project

  1. The API-Example folder contains two folders, Basic and Advanced, that contain usage examples of basic and advanced use-cases of Agora SDK. Select the demo you want to run and click Play to compile.

  2. Choose video calls as an example. After successful compilation, you see your local video preview.

  3. To test various audio and video interaction use-cases, connect to the Agora web demo, or install and run the sample project on a second device. Make sure you use the same app ID on both devices. When you join the same channel from two devices, you can see and hear each other.