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 Unreal Engine sample project.

Prerequisites

  • Unreal Engine 4.27 or higher

  • Prepare your development environment according to your target platform and engine version:

    Dev environment requirementsOther requirements
    Android-
    iOSA valid Apple developer signature.
    macOSA valid Apple developer signature.
    Windows32-bit Windows only supports Unreal Engine 4 and below. To use Unreal Engine with 32-bit Windows, uncomment the code relating to Win32 in the AgoraPluginLibrary.Build.cs file.
  • Two physical devices for testing

  • A microphone

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

  • Installed Git

Project setup

Get the sample project

  1. Run the following command to clone the repository locally:

    git clone git@github.com:AgoraIO-Extensions/Agora-Unreal-RTC-SDK.git
  2. The C++ API usage examples are located in /Agora-Unreal-SDK-CPP-Example. These include:

    DescriptionPath
    Basic API examples/Agora-Unreal-SDK-CPP-Example/Content/API-Example/Basic
    Advanced API examples/Agora-Unreal-SDK-CPP-Example/Content/API-Example/Advance

Configure the sample project

Refer to the following steps to integrate the SDK:

  1. Go to SDKs to download the latest version of the Agora Voice SDK and unzip it.
  2. In /Agora-Unreal-SDK-CPP-Example, create a folder named Plugins.
  3. Copy AgoraPlugin from the SDK folder to Plugins.

Run the sample project

In the Unreal Editor, you can compile and run the sample project at the main level or any sublevel.

Main Level

  1. In the C++ API example folder, double-click AgoraExample.uproject to open the project.

  2. Double-click MainLevel, then click Compile and Run the sample project. On Windows, you see the following interface:

  3. Fill in the text box with the App ID and temporary token you obtained from the Agora Console, and the channel name you used to generate the token.

  4. Click the button on the left to navigate from the main level to the sub-levels of the API example to experience the selected demo. Choose BasicVideoCallScene as an example, click JoinChannel to join the channel. You see yourself in the local view.

  5. 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.

Sub Level

  1. In the C++ API example folder, double-click AgoraExample.uproject to open the project.

  2. Choose BasicVideoCallScene as an example, double-click the sub-level in the Content Browser, and then click the BP_AgoraActor blueprint in the World Outliner panel. Fill in the App ID, temporary token, and channel name of your project in the Details panel.

  3. Click Compile and run the sample project at the sublevel. You see the following interface:

  4. Click JoinChannel to join the channel. You see yourself in the local view.

  5. 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.