Quickly run the ApsaraVideo Real-time Communication (ARTC) sample project to try out real-time audio and video features.
Download the sample source code
Alibaba Cloud provides an open source sample project that demonstrates the ARTC SDK APIs and helps you understand and integrate SDK features. For more information, see the Windows sample project repository.
Prerequisites
Before you run the sample project, make sure your development environment meets the following requirements:
-
Development tool: Visual Studio 2015 or later. We recommend using the latest stable version.
-
Test device: A Windows PC running Windows 7 or later.
-
Network environment: Stable network connectivity.
-
Application setup: Obtain the AppID and AppKey of your ARTC application. For more information, see Create Application.
Procedure
Step 1: Get the sample project
Clone the ARTC sample project to your local machine:
git clone https://github.com/MediaBox-Demos/amdemos-artc
This repository contains sample projects for multiple native platforms using the ARTC SDK. The Windows platform sample is located in the Windows/ folder.
The sample project includes client-side code for generating test tokens.
The following file structure shows the Windows/ARTCExample project.
├── Windows // Root directory of the Windows project structure
│ ├── ARTCExample // Source code directory for the API example
│ ├── ARTCExampleDefine.h // Set AppId, AppKey, and other information
│ ├── include // ARTC SDK header files directory
│ ├── ... // Other files
│ ├── lib // ARTC SDK static library directory
│ ├── x64 // x64 version of ARTC libraries
│ ├── AliRTCSdk.lib // Symbol file
│ ├── ... // Other ARTC SDK files
│ ├── x86 // x86 version of ARTC libraries
│ ├── AliRTCSdk.lib // Symbol file
│ ├── ... // Other ARTC SDK files
│ ├── ARTCExample.sln // Demo project file
Step 2: Configure the sample project
-
After downloading the source code, open the
Windowsfolder. -
Download the Windows ARTC SDK from SDK download/integration. Place the static libraries in the lib folder and the header files in the include folder as shown above. After you compile the main project, place the DLL files in the project's output directory.
-
In the
Windowsfolder, open the project fileARTCExample.sln. -
Configure your ARTC AppID and AppKey. Open
Windows/ARTCExample/ARTCExampleDefine.hand enter the AppID and AppKey that you obtained from the console.
#define ARTC_APP_ID <ApsaraVideo Real-time Communication AppID>
#define ARTC_APP_KEY <ApsaraVideo Real-time Communication AppKey>
Step 3: Compile and run the sample project
-
Select the ARTCExample project and compile it.
-
Place the ARTC DLL files in the application binary output directory. By default, this directory is the
debug/releasefolder under thex64folder, which is one level above theARTCExamplefolder. -
After successful compilation, run the app to try the API example.