胡佳骏 94b73602dc 覆盖原有项目 1 rok temu
..
AppIdInput a603062e8a 20230702 Create 1 rok temu
Editor a603062e8a 20230702 Create 1 rok temu
Examples a603062e8a 20230702 Create 1 rok temu
Image a603062e8a 20230702 Create 1 rok temu
Prefab a603062e8a 20230702 Create 1 rok temu
Tools 94b73602dc 覆盖原有项目 1 rok temu
AppIdInput.meta a603062e8a 20230702 Create 1 rok temu
Editor.meta a603062e8a 20230702 Create 1 rok temu
Examples.meta a603062e8a 20230702 Create 1 rok temu
Home.cs a603062e8a 20230702 Create 1 rok temu
Home.cs.meta a603062e8a 20230702 Create 1 rok temu
HomeScene.unity a603062e8a 20230702 Create 1 rok temu
HomeScene.unity.meta a603062e8a 20230702 Create 1 rok temu
Image.meta a603062e8a 20230702 Create 1 rok temu
Prefab.meta a603062e8a 20230702 Create 1 rok temu
README.md a603062e8a 20230702 Create 1 rok temu
README.md.meta a603062e8a 20230702 Create 1 rok temu
README.zh.md a603062e8a 20230702 Create 1 rok temu
README.zh.md.meta a603062e8a 20230702 Create 1 rok temu
Tools.meta a603062e8a 20230702 Create 1 rok temu

README.md

API-Example-Unity

其他语言版本: 简体中文

Overview

The API-Example-Unity project is an open-source demo that will show you different scenes on how to integrate Agora SDK APIs into your project.

Any scene of this project can run successfully alone.

Project structure

  • Basic demos:
Demo Description APIs
JoinChannelAudio basic demo to show audio call CreateAgoraRtcEngine, JoinChannel, LeaveChannel
JoinChannelVideo video demo with role selection in Editor Inspector SetChannelProfile,SetClientRole,EnableVideo,EnableVideo, JoinChannel, VideoSurface
  • Advanced demos:
Demo Description APIs
AudioMixing audioMixing and play audio effect in the channel StartAudioMixing, PlayEffect
AudioSpectrum audio spectrum IAudioSpectrumObserver, RegisterMediaPlayerAudioSpectrumObserver
ChannelMediaRelay start cross channel media streaming forwarding. This method can be used to realize cross channel wheat connection and other scenes. StartChannelMediaRelay, UpdateChannelMediaRelay, PauseAllChannelMediaRelay, ResumeAllChannelMediaRelay, StopChannelMediaRelay
ContentInspect content inspect SetContentInspect
CustomCaptureAudio Sending raw data from AudioSource into the Agora channel PushAudioFrame
CustomCaptureVideo Sending raw data from VideoSource into the Agora channel PushVideoFrame
CustomRenderAudio use AudioSource to play raw data received in the Agora channel PullAudioFrame
DeviceManager show how to get and set Device on the desktop platforms GetAudioDeviceManager, GetVideoDeviceManager
DualCamera show how to use dual camera to capture data StartPrimaryCameraCapture, StartSecondaryCameraCapture
JoinChannelVideoToken demo on how to run Agora app with a token RenewToken
JoinChannelWithUserAccount demo on how to join channel with user account JoinChannelWithUserAccount, GetUserInfoByUserAccount
MediaPlayer how to play media CreateMediaPlayer, Play, Stop
MediaRecorder Media recording StartRecording, StopRecording,
Metadata send meta data IMetadataObserver
ProcessAudioRawData process raw Audio data in rtc engine and play with audioclip RegisterAudioFrameObserver, OnPlaybackAudioFrame, OnRceordAudioFrame
ProcessVideoRawData process raw Video data in rtc engine and render with texture RegisterVideoFrameObserver, OnCaptureVideoFrame, OnRenderVideoFrame
PushEncodedVideoImage push encoded data in rtc engine PushEncodedVideoImage
ScreenShare sharing screen view with rtc engine StartScreenCaptureByWindowId, StartScreenCaptureByDisplayId
ScreenShareWhileVideoCall sharing screen view while with a video call StartScreenCaptureByWindowId, StartScreenCaptureByDisplayId
SetBeautyEffectOptions Turn on beauty during video call SetBeautyEffectOptions
SetEncryption sending video with encryption EnableEncryption
SetVideoEncoderConfiguration video demo with multiple encoding dimension choice SetVideoEncoderConfiguration
SpatialAudioWithMediaPlayer play media with spatial audio GetLocalSpatialAudioEngine, UpdateRemotePositionEx
StartLocalVideoTranscoder Merging of multiple video sources, options are jpg,png,gif,medai,etc StartLocalVideoTranscoder
StartDirectCdnStreaming stream video by RTMP Push to a CDN StartDirectCdnStreaming, SetDirectCdnStreamingVideoConfiguration, StopDirectCdnStreaming
StartRhythmPlayer use phythm player in rtc engine StartRhythmPlayer
StartRtmpStreamWithTranscoding stream video by RTMP Push to a CDN StartRtmpStreamWithTranscoding, UpdateRtmpTranscoding, StopRtmpStream
StreamMessage how to send stream message CreateDataStream, SendStreamMessage
TakeSnapshot how to screen shot TakeSnapshot
VirtualBackground enable virtual background EnableVirtualBackground
VoiceChanger how to modify your voice SetVoiceBeautifierPreset, SetAudioEffectPreset,SetVoiceConversionPreset,SetLocalVoicePitch, SetLocalVoiceEqualization, SetLocalVoiceReverb

How to run the sample project

Developer Environment Requirements

  • Unity 2017 LTS and up

Steps to run

First, create a developer account at Agora.io, and obtain an App ID.

Then do the following:

  1. Clone this repository.

  2. Open the project in Unity Editor. Note that you will see compiler errors before you download the SDK package.

  3. You may download the SDK package in either of the following two ways:

    a. From Unity Asset Store download and import the Agora Video SDK

    b. Download the ***Agora Video SDK*** from Agora.io SDK. Unzip the downloaded SDK package and import into Unity project

  4. Fill your App ID into the ***API-Example-Unity/Assets/API-Example/appIdInput/AppIdInput.asset***

  5. Choose one of the scene that you want to run

Run the game and you are now good to go!

Feedback

If you have any problems or suggestions regarding the sample projects, feel free to file an issue.

Reference

Related resources

  • Check our FAQ to see if your issue has been recorded.
  • Dive into Agora SDK Samples to see more tutorials
  • Take a look at Agora Use Case for more complicated real use case
  • Take a look at AgoraIO-Extensions for Crossplatform and Marketing-place projects
  • Repositories managed by developer communities can be found at Agora Community
  • If you encounter problems during integration, feel free to ask questions in Stack Overflow

License

The sample projects are under the MIT license.