This document describes how to use the GME Native Sample Code.
The voice chat UI in Sample Code is as shown below (in the demo for iOS):
The following steps apply to all platforms:
|2||Enterroom||Enters the audio room whose room number is specified by
|3||Capture||Enables capture device|
|4||Send||Enables audio upstreaming (then, audio can be sent and users in the same room can receive the voice chat audio)|
|5||Play||Enables playback device|
|6||Rec||Enables audio downstreaming (if another user in the same room has upstreaming audio at the same time, you can hear the corresponding voice chat audio)|
|7||ExitRoom||Exits room (then, you cannot hear other users' audio nor send your audio to them)|
|8||Uninit||Uninitializes SDK and completely exits GME|
- As steps 3 and 5 are performed at the hardware level, they will take some time to complete.
- Only after steps 3 and 4 are completed can audio be upstreamed. Similarly, audio can be played back only after steps 5 and 6 are completed.
You can skip this step and use the test account provided by GME by default.
Before initializing the SDK, modify the
OpenID parameters on the voice chat UI and click Init.
For the source of the
Key parameters, please see Access Guide.
OpenID parameter is used to identify the local user, and its value must be above 10,000.
After setting the account and
openID, click "Init" to initialize the SDK. You can perform other operations after initialization.
Click "EnterRoom" to enter a desired voice chat room. You can manipulate the devices only after room entry.
RoomId specifies the ID of the room to be entered. Only users under the same room ID can talk to each other.
Manipulate the devices. If there are other users in the room, you can communicate with them.
During the test, you can use another device with the same
Appid and different
OpenID to enter the same room. After enabling the mic and speaker, your two devices can communicate with each other.
|Capture||Enables capture device|
|Send||Enables audio upstreaming (then, audio can be sent and users in the same room can receive the voice chat audio)|
|Play||Enables playback device|
|Rec||Enables audio downstreaming (if another user in the same room has upstreaming audio at the same time, you can hear the corresponding voice chat audio)|
You can drag the slider to set the volume level after room entry.
You can click the button next to "Loopback" to enable/disable in-ear monitoring. If it is enabled, you will be able to hear your own voice from the playback device.
After entering the room and performing steps 3, 4, 5, and 6, you can click the button next to "Accomp" to enable other users in the same room to hear your accompaniment. If in-ear monitoring is enabled, you can also hear your accompaniment.
Enter the corresponding parameter in the input box next to ChangeKaraoke and click ChangeKaraoke, then the sent real-time audio will have the corresponding karaoke effect. The effect parameters are as detailed below:
Enter the corresponding parameter in the input box next to "ChangeVoiceType" and click "ChangeVoiceType", then the sent real-time audio will have the corresponding voice changing effect. The effect parameters are as detailed below:
|10||Strong electric current|
Some special APIs for testing the SDK are used in the demo. You should not call them:
SetAppVersion GetSDKVersion SetAdvanceParams SetTestEnv SetRecvMixStreamCount