其他语言版本: 简体中文
The API Example Windows Sample App is an open-source demo that show common API usage.
This demo is written in C++
- VS 2013(or higher), default is vs2017
- Windows 7(or higher)
To build and run the sample application, get an App ID:
-
Create a developer account at agora.io. Once you finish the signup process, you will be redirected to the Dashboard.
-
Navigate in the Dashboard tree on the left to Projects > Project List.
-
Save the App ID from the Dashboard for later use.
-
Generate a temp Access Token (valid for 24 hours) from dashboard page with given channel name, save for later use.
-
Define the APP_ID with your App ID.
#define APP_ID _T("Your App ID") -
(Optional)Alternate approach to setup your APPID is to create an AppId.ini file under Debug/Release. Modify the appId value to the App ID you just applied.
#[AppID] #AppID=xxxxxxxxxxxxxxxxxxx
This open source sample project uses the Agora RTC SDK,DirectShow SDK, and MeidaPlayer SDK.
You can directly run APIExample/installThirdParty.bat to automatically environment configuration.Once the configuration is complete, open the project with VS2017, select the x86 version to compile and run.
- change client role
- support 1v1,1v3, 1v8, 1v15
- join/leave channel
- render local and remote video
- Specify SDK access restrictions through Area Code
- Send the anchor flow of Channel A to Channel B to achieve anchor PK
- Use joinChannel to join channels
- Multiple other channels can be joined using RtcChannel
- Upstream and downstream network quality
- Statistical Information
- Audio and video quality
- Collection volume for local users
- Local playback volume for remote users
- Ear-Return volume
- User volume prompt
- Echo test
- Audio acquisition equipment test
- Audio playback device test
- Joint testing of audio acquisition and playback equipment
- Test of video acquisition equipment
- Add publish stream url after join channel success
- remove publish stream url before leave channel
- show information returned by rtmp streaming callback
- inject stream url after join channel success
- show information returned by inject status callback
- Receive 666 joined callback after inject stream url succeed.You can mute video and audio of 666. Also,you can render it.
- remove inject stream url before leave channel
- You need enable video and joinchannel.
- Send video SEI information. The maximum is 1024 byte.
- Receive SEI information and show it.
- Clear SEI information
- Enter the channel and enumerate all visible Windows
- Select a visible window
- Recording screen
- Stop recording
- Set lighteningContrastLevel
- Set lighteningLevel
- Set rednessLevel
- Set smoothnessLevel
- Set up sound effects or audio beauty
- Set profile
- Set scenario
- Set audio property to channel audio
- Set the audio path
- Set the number of playback times
- Sets whether to play locally only
- Sets whether to replace the microphone audio
There are two ways for SDK to realize self-collection. One is to use pushVideoFrame to actively push video frames to SDK without local rendering. In the demo, DirectX is used for local rendering; the other is to use MediaIO, which is used by SDK for local rendering of images.
- Camera capture using DirectShow
- Enumerates all image acquisition devices and types
- Create image acquisition filters
- Start collecting camera data
- SDK acquires camera data
- Stop collecting camera data
- Sign up as a video observer
- Process video frames in onCaptureVideoFrame
Custom audio capture use MeidaIO method for capture, use Sink method to obtain audio data, and then use DirectSound for local rendering.
- Audio acquisition using DirectShow
- Enumerates all audio acquisition devices and types
- Create audio capture filters
- Start collecting microphone data
- SDK gets microphone data
- Stop collecting microphone data
- Register Audio Observer
- Process Audio Frames in onRecordAudioFrame
- Register Packet Observer
- Encrypt the audio stream before sending it in onSendAudioPacket
- Encrypt the video stream before it is sent in the onSendVideoPacket
- Decrypt the audio stream after receiving it in onReceiveAudioPacket
- Decrypt a video stream after receiving it from an onReceiveVideoPacket
- Use MediaPlayer Kit for media opening, playing and other operations.
- Use the MediaPlayerExtensions to push the flow to the AgoraRtc Engine's channels.
- Use the IMediaPlayerObserver to handle MeidaPlayer callback events.For example (open stream, play stream)
- For potential issues, take a look at our FAQ first
- Dive into Agora SDK Samples to see more tutorials
- Take a look at Agora Use Case for more complicated real use case
- Repositories managed by developer communities can be found at Agora Community
- You can find full API documentation at Document Center
- If you encounter problems during integration, you can ask question in Stack Overflow
- You can file bugs about this sample at issue
The MIT License (MIT).