Thank you for using Tencent Cloud Game Multimedia Engine (GME) SDK. This document describes how to access GME's range voice service to make it easy for developers to debug and access the APIs of GME.
GME range voice is a customized product specifically developed for battle royale games. Different from team audio room, it has the following core capabilities:
|Audio mode||Parameter name||Function|
|Everyone||RANGE_AUDIO_MODE_WORLD||In this mode, other users within a certain range can hear the user|
|Team only||RANGE_AUDIO_MODE_TEAM||Only teammates can hear the user|
|Are they in the same team?||Are they within the range?||Audio mode||Can A hear B?||Can B hear A?|
|Are they in the same team?||Are they within the range?||Audio status||Can A hear B?||Can B hear A?|
Different from general team audio rooms, when using range voice capabilities, the following two APIs must be called before EnterRoom:
The team ID can be set by this method, which must be called before EnterRoom; otherwise, it will directly return the error code AV_ERR_ROOM_NOT_EXITED(1202)
This parameter will not be automatically reset to 0 when exiting the room, so once it is decided to call this audio mode, please call this method to set the TeamID before each EnterRoom
ITMGContext SetRangeAudioTeamID(int teamID)
|teamID||int||Team ID, used for uplink/downlink audio stream control in range voice. When TeamID is 0, the voice chat mode is team voice chat; the default value is 0.|
The audio mode can be modified by this method, which can be called either before or after entering the room.
Calling this method before entering the room affects the next time the user enters the room
Calling this method after entering the room will directly change the current user's audio mode
This parameter will not be automatically reset to MODE_WORLD when exiting the room, so once it is decided to call this method, please call this method to set the audioMode before each EnterRoom
ITMGRoom int SetRangeAudioMode(RANGE_AUDIO_MODE rangeAudioMode)
|rangeAudioMode||int||0(MODE_WORLD) means "Everyone", while 1(MODE_TEAM) means "Team only"|
This method is used to set the voice reception range (subject to the game engine) and only can be called after successfully entering the room
This method must be used in conjunction with UpdateSelfPosition which updates the sound source position
ITMGRoom int UpdateAudioRecvRange(int range)
|range||int||Maximum audio reception range|
This function is used to update the sound source position information and can be called only after successfully entering the room.
In this product form, only the position is required and no sound orientation is required.
The distance between the sound source and the listener is determined through the combination of the source's SelfPostion and the listener's SelfPostion and AudioRecvRange
public abstract int UpdateSelfPosition(int position, float axisForward, float axisRight, float axisUp)
|position||int||Self-position; the coordinate order is front, right and top|
|axisForward||float||Ignore in this product|
|axisRight||float||Ignore in this product|
|axisUp||float||Ignore in this product|