Init
and Poll
.AppID
and Key
of the SDK as instructed in Activating Services.QAVError.OK
will be returned with the value being 0
.Poll
API should be called periodically for GME to trigger event callbacks.Class | Description |
ITMGContext | Core APIs |
ITMGRoom | Room APIs |
ITMGRoomManager | Room management APIs |
ITMGAudioCtrl | Audio APIs |
ITMGAudioEffectCtrl | Sound effect and accompaniment APIs |
API | Description |
Init | Initializes GME. |
Poll | Triggers an event callback. |
Pause | Pauses the system. |
Resume | Resumes the system. |
Uninit | Uninitializes GME. |
UnInit
to uninitialize the SDK. No fee is incurred for calling Init API.ITMGContext
object first.import com.tencent.TMG.ITMGContext;ITMGContext.getInstance(this);
Delegate
method to send callback notifications to the application. Register the callback function to the SDK for receiving callback messages.static public abstract class ITMGDelegate {public void OnEvent(ITMG_MAIN_EVENT_TYPE type, Intent data){}}
Parameter | Type | Description |
type | ITMGContext.ITMG_MAIN_EVENT_TYPE | Event type in the callback response |
data | Intent message type | Callback message, i.e., event data |
private ITMGContext.ITMGDelegate itmgDelegate = null;itmgDelegate = new ITMGContext.ITMGDelegate() {@Overridepublic void OnEvent(ITMGContext.ITMG_MAIN_EVENT_TYPE type, Intent data) {if (ITMGContext.ITMG_MAIN_EVENT_TYPE.ITMG_MAIN_EVENT_TYPE_ENTER_ROOM == type){// Analyze the returned dataint nErrCode = data.getIntExtra("result" , -1);String strErrMsg = data.getStringExtra("error_info");}}}
public abstract int SetTMGDelegate(ITMGDelegate delegate);
Parameter | Type | Description |
delegate | ITMGDelegate | SDK callback function |
ITMGContext.GetInstance(this).SetTMGDelegate(itmgDelegate);
Init
API before you can use the real-time voice chat, voice message, and speech-to-text services. The Init
API must be called in the same thread as other APIs. We recommend you call all APIs in the main thread.public abstract int Init(String sdkAppId, String openId);
Parameter | Type | Description |
sdkAppId | String | |
openId | String | openID can only be in Int64 type, which is passed in after being converted to a const char* . You can customize its rules, and it must be unique in the application. To pass in openID as a string, submit a ticket for application. |
Returned Value | Description |
QAVError.OK= 0 | SDK was initialized successfully. |
AV_ERR_SDK_NOT_FULL_UPDATE=7015 | Check whether the SDK file is complete. We recommend that you delete it and then import the SDK again. |
AV_ERR_SDK_NOT_FULL_UPDATE
is only a reminder but will not cause an initialization failure.String sdkAppID = "14000xxxxx";String openID = "100";int ret = 0;// After the user agrees to the application's privacy policy, initialize the SDK at an appropriate time based on the application features//ret = 0: The user agrees to the application's privacy policy//ret = 1: The user does not agree to the application's privacy policy// If the user does not agree to the privacy policy, change `ret` to a value other than 0if(ret != 0){Log.e(TAG,"The user does not agree to the application's privacy policy");}else{ITMGContext.GetInstance(this).Init(sdkAppId, openId);}
Poll
API in update
. Poll
is the message pump of GME, and the Poll
API should be called periodically for GME to trigger event callbacks; otherwise, the entire SDK service will run exceptionally.
Refer to the EnginePollHelper.java
file in SDK Download Guide.Poll
API periodicallyPoll
API must be called periodically and in the main thread to avoid abnormal API callbacks.public abstract int Poll();
private Handler mhandler = new Handler();private Runnable mRunnable = new Runnable() { @Override public void run() { if (s_pollEnabled) { if (ITMGContext.GetInstance(null) != null) ITMGContext.GetInstance(null).Poll(); } mhandler.postDelayed(mRunnable, 33); }};
Pause
event occurs in the system, the engine should also be notified for pause. If you do not need the audio played back in the background in the room, call Pause
API to pause the GME service.public abstract int Pause();
Resume
event occurs in the system, the engine should also be notified for resumption. The Resume
API only supports resuming voice chat.public abstract int Resume();
openid
, switching game account requires uninitializing GME and then using the new openid
to initialize again.Uninit
API to stop using the SDK features and stop collecting and close the user data used by the features.public abstract int Uninit();
API | Description |
GenAuthBuffer | Calculates the local authentication key. |
EnterRoom | Enters a room. |
ExitRoom | Exits a room. |
IsRoomEntered | Determines whether room entry is successful. |
SwitchRoom | Switches the room quickly. |
StartRoomSharing | Cross-room Co-anchoring |
AuthBuffer
for encryption and authentication of relevant features. For release in the production environment, use the backend deployment key as detailed in Authentication Key.AuthBuffer public native byte[] genAuthBuffer(int sdkAppId, String roomId, String openId, String key)
Parameter | Type | Description |
appId | int | AppId from the Tencent Cloud console |
roomId | String | Room ID, which can contain up to 127 characters. |
openId | String | User ID, which is the same as OpenId during initialization. |
key | String |
import com.tencent.av.sig.AuthBuffer;// Header filebyte[] authBuffer = AuthBuffer.getInstance().genAuthBuffer(Integer.parseInt(sdkAppId), strRoomID,openId, key);
0
, the room entry is successful. If 0
is returned from the EnterRoom
API, it doesn't necessarily mean that the room entry is successful.ChangeRoomType
API, the audio type of the room will be changed.public abstract int EnterRoom(String roomID, int roomType, byte[] authBuffer);
Parameter | Type | Description |
roomId | String | Room ID, which can contain up to 127 characters. |
roomType | int | Room type. We recommend that you enter ITMG_ROOM_TYPE_FLUENCY . For more information on room audio types, see Sound Quality. |
authBuffer | byte[] | Authentication key |
ITMGContext.GetInstance(this).EnterRoom(roomId,roomType, authBuffer);
ITMG_MAIN_EVENT_TYPE_ENTER_ROOM
will be sent and identified in the OnEvent
function for callback and processing. A successful callback means that the room entry is successful, and the billing starts.private ITMGContext.ITMGDelegate itmgDelegate = null;itmgDelegate= new ITMGContext.ITMGDelegate() {@Overridepublic void OnEvent(ITMGContext.ITMG_MAIN_EVENT_TYPE type, Intent data) {}};
public void OnEvent(ITMGContext.ITMG_MAIN_EVENT_TYPE type, Intent data) {if (ITMGContext.ITMG_MAIN_EVENT_TYPE.ITMG_MAIN_EVENT_TYPE_ENTER_ROOM == type){// Analyze the returned dataint nErrCode = data.getIntExtra("result" , -1);String strErrMsg = data.getStringExtra("error_info");if (nErrCode == AVError.AV_OK){//Entered room successfully, and you can proceed with your operationScrollView_ShowLog("EnterRoom success");Log.i(TAG,"EnterRoom success!");}else{//If you fail to enter the room, you need to analyze the returned error messageScrollView_ShowLog("EnterRoom fail :" + strErrMsg);Log.i(TAG,"EnterRoom fail!");}}if (ITMGContext.ITMG_MAIN_EVENT_TYPE.ITMG_MAIN_EVENT_TYPE_ROOM_DISCONNECT == type){//waiting timeout, please check your network}}
Message | Data | Example |
ITMG_MAIN_EVENT_TYPE_ENTER_ROOM | result; error_info | {"error_info":"","result":0} |
ITMG_MAIN_EVENT_TYPE_ROOM_DISCONNECT | result; error_info | {"error_info":"waiting timeout, please check your network","result":0} |
ITMG_MAIN_EVENT_TYPE.ITMG_MAIN_EVENT_TYPE_ROOM_DISCONNECT
. At this time, the SDK will automatically reconnect, and the callback is ITMG_MAIN_EVENT_TYPE_RECONNECT_START
. When the reconnection is successful, there will be a callback ITMG_MAIN_EVENT_TYPE_RECONNECT_SUCCESS
.Error Code | Cause and Suggested Solution |
7006 | Authentication failed. Causes: AppID doesn't exist or is incorrect.An error occurred while authenticating authbuff .Authentication expired. OpenId is invalid. |
7007 | The user was already in another room. |
1001 | The user was already in the process of entering a room but repeated this operation. We recommend that you not call the room entry API until the room entry callback is returned. |
1003 | The user was already in the room and called the room entry API again. |
1101 | Make sure that the SDK is initialized, OpenId complies with the rules, the APIs are called in the same thread, and the Poll API is called normally. |
AV_OK
indicates a successful async delivery. If there is a scenario in the application where room entry is performed immediately after room exit, you don't need to wait for the RoomExitComplete
callback notification from the ExitRoom
API; instead, you can directly call the EnterRoom
API.public abstract int ExitRoom();
ITMGContext.GetInstance(this).ExitRoom();
ITMG_MAIN_EVENT_TYPE_EXIT_ROOM
.public void OnEvent(ITMGContext.ITMG_MAIN_EVENT_TYPE type, Intent data) {if (ITMGContext.ITMG_MAIN_EVENT_TYPE.ITMG_MAIN_EVENT_TYPE_EXIT_ROOM == type){// Receive the event of successful room exit}}
Message | Data | Example |
ITMG_MAIN_EVENT_TYPE_EXIT_ROOM | result; error_info | {"error_info":"","result":0} |
public abstract boolean IsRoomEntered();
ITMGContext.GetInstance(this).IsRoomEntered();
ITMG_MAIN_EVENT_TYPE.ITMG_MAIN_EVENT_TYPE_SWITCH_ROOM
, and the fields are error_info
and result
.public abstract int SwitchRoom(String targetRoomID, byte[] authBuffer);
Parameter | Type | Description |
targetRoomID | String | ID of the room to enter |
authBuffer | byte[] | Generates a new authentication key with the ID of the room to enter |
if(ITMGContext.ITMG_MAIN_EVENT_TYPE.ITMG_MAIN_EVENT_TYPE_SWITCH_ROOM == type) {int result = data.getIntExtra("result", 1);String errorInfo = data.getStringExtra("error_info");if (result == 0) {Toast.makeText(getActivity(), "switch room success.", Toast.LENGTH_SHORT).show();}else {Toast.makeText(getActivity(), "switch room failed.. error info=" + errorInfo, Toast.LENGTH_SHORT).show();}}
/// <summary> Enable the room sharing, and connect the mic of the OpenID in another room.</summary>public abstract int StartRoomSharing(String targetRoomID, String targetOpenID, byte[] authBuffer);/// <summary> Stop the enabled room sharing.</summary>public abstract int StopRoomSharing();
Parameter | Type | Description |
targetRoomID | String | ID of the room to connect mic |
targetOpenID | String | Target OpenID to connect mic |
authBuffer | byte[] | Reserved flag. You just need to enter NULL. |
if (mSwtichRoomShareStart.isChecked()){String strRoomID = mEditRoomShareRoomID.getText().toString();String strOpenID = mEditRoomShareOpenID.getText().toString();int nRet = ITMGContext.GetInstance(getActivity()).GetRoom().StartRoomSharing(strRoomID, strOpenID, null);if (nRet != 0){Toast.makeText(getActivity(), String.format("StartRoomSharing failed nRet=" + nRet), Toast.LENGTH_SHORT).show();}else{int nRet = ITMGContext.GetInstance(getActivity()).GetRoom().StopRoomSharing();if (nRet != 0){Toast.makeText(getActivity(), String.format("StopRoomSharing failed nRet=" + nRet), Toast.LENGTH_SHORT).show();}}}
API/Notification | Description |
ITMG_MAIN_EVNET_TYPE_USER_UPDATE | The member status changed. |
AddAudioBlackList | Mutes a member in the room. |
RemoveAudioBlackList | Unmutes a member. |
ITMG_MAIN_EVNET_TYPE_USER_UPDATE
, where the data contains event_id
and user_list
. The event message will be identified in the OnEvent
function.
Notifications for audio events are subject to a threshold, and a notification will be sent only when this threshold is exceeded. The notification "A member has stopped sending audio packets" will be sent if no audio packets are received in more than two seconds.event_id | Description | Maintenance |
ITMG_EVENT_ID_USER_ENTER | Return the openid of the member entering the room. | Member list |
ITMG_EVENT_ID_USER_EXIT | Return the openid of the member exiting the room. | Member list |
ITMG_EVENT_ID_USER_HAS_AUDIO | Return the openid of the member sending audio packets in the room. This event can be used to determine whether a user is speaking and display the voiceprint effect. | Chat member list |
ITMG_EVENT_ID_USER_NO_AUDIO | Return the openid of the member stopping sending audio packets in the room. | Chat member list |
public void OnEvent(ITMGContext.ITMG_MAIN_EVENT_TYPE type, Intent data) {if (ITMGContext.ITMG_MAIN_EVENT_TYPE.ITMG_MAIN_EVNET_TYPE_USER_UPDATE == type){// Update member statusint nEventID = data.getIntExtra("event_id", 0);String[] openIdList =data.getStringArrayExtra("user_list");switch (nEventID){case ITMG_EVENT_ID_USER_ENTER:// A member enters the roombreak;case ITMG_EVENT_ID_USER_EXIT:// A member exits the roombreak;case ITMG_EVENT_ID_USER_HAS_AUDIO:// A member sends audio packetsbreak;case ITMG_EVENT_ID_USER_NO_AUDIO:// A member stops sending audio packetsbreak;default:break;}}}
Message | Data | Example |
ITMG_MAIN_EVNET_TYPE_USER_UPDATE | event_id; user_list | {"event_id":0,"user_list":""} |
0
indicates that the call is successful. Assume that users A, B, and C are all speaking using their mic in a room:public abstract int AddAudioBlackList(String openId);
Parameter | Type | Description |
openId | String | openid of the user to be blocked |
ITMGContext.GetInstance(this).GetAudioCtrl().AddAudioBlackList(openId);
public abstract int RemoveAudioBlackList(String openId);
Parameter | Type | Description |
openId | String | User openid to be unblocked |
ITMGContext.GetInstance(this).GetAudioCtrl().RemoveAudioBlackList(openId);
EnableMic
or EnableSpeaker
API.EnableAudioCaptureDevice(true)
and EnableAudioPlayDevice(true)
once after room entry, and call EnableAudioSend/Recv
to send/receive audio streams when Enable/Disable Mic is clicked.API | Description |
EnableMic | Enables/Disables the mic. |
GetMicState | Gets the mic status. |
EnableAudioCaptureDevice | Enables/Disables the capturing device. |
IsAudioCaptureDeviceEnabled | Gets the capturing device status. |
EnableAudioSend | Enables/Disables audio upstreaming. |
IsAudioSendEnabled | Gets the audio upstreaming status. |
GetMicLevel | Gets the real-time mic volume level. |
GetSendStreamLevel | Gets the real-time audio upstreaming volume level. |
SetMicVolume | Sets the mic volume level. |
GetMicVolume | Gets the mic volume level. |
EnableMic
is equivalent to using EnableAudioCaptureDevice
and EnableAudioSend
together. If accompaniment is used, call this API as instructed in Accompaniment in Voice Chat.public abstract int EnableMic(boolean isEnabled);
Parameter | Type | Description |
isEnabled | boolean | To enable the mic, set this parameter to true ; otherwise, set it to false . |
// Turn on micITMGContext.GetInstance(this).GetAudioCtrl().EnableMic(true);
public abstract int GetMicState();
int micState = ITMGContext.GetInstance(this).GetAudioCtrl().GetMicState();
public abstract int EnableAudioCaptureDevice(boolean isEnabled);
Parameter | Type | Description |
isEnabled | boolean | To enable the capturing device, set this parameter to true , otherwise, set it to false . |
// Enable capturing deviceITMGContext.GetInstance(this).GetAudioCtrl().EnableAudioCaptureDevice(true);
public abstract boolean IsAudioCaptureDeviceEnabled();
bool IsAudioCaptureDevice = ITMGContext.GetInstance(this).GetAudioCtrl().IsAudioCaptureDeviceEnabled();
EnableAudioCaptureDevice
API.public abstract int EnableAudioSend(boolean isEnabled);
Parameter | Type | Description |
isEnabled | boolean | To enable audio upstreaming, set this parameter to true ; otherwise, set it to false . |
ITMGContext.GetInstance(this).GetAudioCtrl().EnableAudioSend(true);
public abstract boolean IsAudioSendEnabled();
bool IsAudioSend = ITMGContext.GetInstance(this).GetAudioCtrl().IsAudioSendEnabled();
public abstract int GetMicLevel();
int micLevel = ITMGContext.GetInstance(this).GetAudioCtrl().GetMicLevel();
ITMGContext TMGAudioCtrl int GetSendStreamLevel()
int Level = ITMGContext.GetInstance(this).GetAudioCtrl().GetSendStreamLevel();
volume
, which is equivalent to attenuating or gaining the captured sound.public abstract int SetMicVolume(int volume);
Parameter | Type | Description |
volume | int | Value range: 0-200. Default value: 100 . 0 indicates that the audio is muted, while 100 indicates that the volume level remains unchanged. |
ITMGContext.GetInstance(this).GetAudioCtrl().SetMicVolume(volume);
public abstract int GetMicVolume();
ITMGContext.GetInstance(this).GetAudioCtrl().GetMicVolume();
API | Description |
EnableSpeaker | Enables/Disables the speaker. |
GetSpeakerState | Gets the speaker status. |
EnableAudioPlayDevice | Enables/Disables the playback device. |
IsAudioPlayDeviceEnabled | Gets the playback device status. |
EnableAudioRecv | Enables/Disables audio downstreaming. |
IsAudioRecvEnabled | Gets the audio downstreaming status. |
GetSpeakerLevel | Gets the real-time speaker volume level. |
GetRecvStreamLevel | Gets the real-time downstreaming audio levels of other members in the room. |
SetSpeakerVolume | Sets the speaker volume level. |
GetSpeakerVolume | Gets the speaker volume level. |
EnableSpeaker
is equivalent to using EnableAudioPlayDevice
and EnableAudioRecv
together. If accompaniment is used, call this API as instructed in Accompaniment in Voice Chat.public abstract int EnableSpeaker(boolean isEnabled);
Parameter | Type | Description |
isEnabled | boolean | To disable the speaker, set this parameter to false ; otherwise, set it to true . |
// Turn on the speakerITMGContext.GetInstance(this).GetAudioCtrl().EnableSpeaker(true);
public abstract int GetSpeakerState();
int micState = ITMGContext.GetInstance(this).GetAudioCtrl().GetSpeakerState();
public abstract int EnableAudioPlayDevice(boolean isEnabled);
Parameter | Type | Description |
isEnabled | boolean | To disable the playback device, set this parameter to false ; otherwise, set it to true . |
// Enable the playback deviceITMGContext.GetInstance(this).GetAudioCtrl().EnableAudioPlayDevice(true);
public abstract boolean IsAudioPlayDeviceEnabled();
bool IsAudioPlayDevice = ITMGContext.GetInstance(this).GetAudioCtrl().IsAudioPlayDeviceEnabled();
EnableAudioPlayDevice
API.public abstract int EnableAudioRecv(boolean isEnabled);
Parameter | Type | Description |
isEnabled | boolean | To enable audio downstreaming, set this parameter to true ; otherwise, set it to false . |
ITMGContext.GetInstance(this).GetAudioCtrl().EnableAudioRecv(true);
public abstract boolean IsAudioRecvEnabled();
bool IsAudioRecv = ITMGContext.GetInstance(this).GetAudioCtrl().IsAudioRecvEnabled();
public abstract int GetSpeakerLevel();
int SpeakLevel = ITMGContext.GetInstance(this).GetAudioCtrl().GetSpeakerLevel();
public abstract int GetRecvStreamLevel(String openId);
Parameter | Type | Description |
openId | String | openId of another member in the room |
int Level = ITMGContext.GetInstance(this).GetAudioCtrl().GetRecvStreamLevel(openId);
public abstract int SetSpeakerVolumeByOpenID(String openId, int volume);
Parameter | Type | Description |
openId | String | OpenID of the target user |
volume | int | Percentage. Recommended value range: 0-200. Default value: 100 . |
// Lower the volume of 123333 to 80%String strOpenID = "1233333";int nOpenVolume = Integer.valueOf(80);int nRet = ITMGContext.GetInstance(getActivity()).GetAudioCtrl().SetSpeakerVolumeByOpenID(strOpenID, nOpenVolume);if (nRet != 0){// Toast error occured}else{// Toast set successfully}
public abstract int GetSpeakerVolumeByOpenID(String openId);
Parameter | Type | Description |
openId | String | OpenID of the target user |
public abstract int SetSpeakerVolume(int volume);
Parameter | Type | Description |
volume | int | Volume level. Value range: 0-200. Default value: 100 . 0 indicates that the audio is muted, while 100 indicates that the volume level remains unchanged. |
int speVol = (int)(value * 100);ITMGContext.GetInstance(this).GetAudioCtrl().SetSpeakerVolume(volume);
SetSpeakerVolume
API has not been called.
"Level" indicates the real-time volume, and "Volume" the speaker volume. The final volume = Level * Volume%. For example, if the "Level" is 100 and "Volume" is 60, the final volume is "60".public abstract int GetSpeakerVolume();
ITMGContext.GetInstance(this).GetAudioCtrl().GetSpeakerVolume();
EnableLoopBack+EnableSpeaker
before you can hear your own voice.public abstract int EnableLoopBack(boolean enable);
Parameter | Type | Description |
enable | boolean | Specifies whether to enable in-ear monitoring. |
ITMGContext.GetInstance(this).GetAudioCtrl().EnableLoopBack(true);
EnterRoom
API.public abstract int GetRoomType();
ITMGContext.GetInstance(this).GetRoom().GetRoomType();
public abstract String GetRoomID();
ITMG_MAIN_EVENT_TYPE_CHANGE_ROOM_TYPE
. The audio type of the room is determined by the first user to enter the room. After that, if a member in the room changes the room type, it will take effect for all members there.public abstract int ChangeRoomType(int nRoomType);
Parameter | Type | Description |
nRoomType | int | Room type to be switched to. For room audio types, see the EnterRoom API. |
ITMGContext.GetInstance(this).GetRoom().ChangeRoomType(nRoomType);
ITMG_MAIN_EVENT_TYPE_CHANGE_ROOM_TYPE
will be returned in the callback. The returned parameters include result
, error_info
, and new_room_type
. The new_room_type
represents the following information. The event message will be identified in the OnEvent
function.Event Subtype | Parameter | Description |
ITMG_ROOM_CHANGE_EVENT_ENTERROOM | 1 | The existing audio type is inconsistent with and changed to that of the entered room. |
ITMG_ROOM_CHANGE_EVENT_START | 2 | A user is already in the room and the audio type starts changing (e.g., calling the ChangeRoomType API to change the audio type). |
ITMG_ROOM_CHANGE_EVENT_COMPLETE | 3 | A user is already in the room, and the audio type has been changed. |
ITMG_ROOM_CHANGE_EVENT_REQUEST | 4 | A room member calls the ChangeRoomType API to request a change of the room audio type. |
public void OnEvent(ITMGContext.ITMG_MAIN_EVENT_TYPE type, Intent data) { if (ITMGContext.ITMG_MAIN_EVENT_TYPE.ITMG_MAIN_EVENT_TYPE_CHANGE_ROOM_TYPE == type) { // Process the room type events }}
Message | Data | Example |
ITMG_MAIN_EVENT_TYPE_CHANGE_ROOM_TYPE | result;error_info;new_room_type;subEventType | {"error_info":"","new_room_type":0,"subEventType":0,"result":0} |
ITMG_MAIN_EVENT_TYPE_CHANGE_ROOM_QUALITY
. The returned parameters include weight
, loss
, and delay
, which are as detailed below:Parameter | Type | Description |
weight | int | Value range: 1–50. 50 indicates excellent sound quality, 1 indicates very poor (barely usable) sound quality, and 0 represents an initial meaningless value. Generally, if the value is below 30, you can remind users that the network is poor and recommend them to switch the network. |
Loss | double | Upstream packet loss rate |
Delay | int | Voice chat delay in ms |
public abstract String GetSDKVersion();
ITMGContext.GetInstance(this).GetSDKVersion();
public abstract ITMG_RECORD_PERMISSION CheckMicPermission();
Parameter | Value | Description |
ITMG_PERMISSION_GRANTED | 0 | The mic permission is granted. |
ITMG_PERMISSION_Denied | 1 | Microphone disabled. |
ITMG_PERMISSION_NotDetermined | 2 | No authorization box has been popped up to request the permission. |
ITMG_PERMISSION_ERROR | 3 | An error occurred while calling the API. |
ITMGContext.GetInstance(this).CheckMicPermission();
public abstract ITMG_CHECK_MIC_STATUS CheckMic();
Returned Value | Description | Handling |
ITMG_CHECK_MIC_STATUS_AVAILABLE = 0 | Normally available | No handling required |
ITMG_CHECK_MIC_STATUS_NO_GRANTED = 2 | Access not obtained/denied | The access permission needs to be obtained before the mic is enabled. |
ITMG_CHECK_MIC_STATUS_INVALID_MIC = 3 | No device available | Generally, this error will be reported on PCs when no mics are available. Prompt the user to insert a headset or mic. |
ITMG_CHECK_MIC_STATUS_NOT_INIT = 5 | Not initialized | Call EnableMic after Init . |
public abstract int SetLogLevel(int levelWrite, int levelPrint);
Parameter | Type | Description |
levelWrite | ITMG_LOG_LEVEL | Sets the level of logs to be written. TMG_LOG_LEVEL_NONE indicates not to log. Default value: TMG_LOG_LEVEL_INFO . |
levelPrint | ITMG_LOG_LEVEL | Sets the level of logs to be printed. TMG_LOG_LEVEL_NONE indicates not to print. Default value: TMG_LOG_LEVEL_ERROR . |
ITMG_LOG_LEVEL
description:ITMG_LOG_LEVEL | Description |
TMG_LOG_LEVEL_NONE | Does not print logs |
TMG_LOG_LEVEL_ERROR | Prints error logs (default) |
TMG_LOG_LEVEL_INFO | Prints info logs |
TMG_LOG_LEVEL_DEBUG | Prints debug logs |
TMG_LOG_LEVEL_VERBOSE | Prints verbose logs |
ITMGContext.GetInstance(this).SetLogLevel(TMG_LOG_LEVEL_INFO,TMG_LOG_LEVEL_INFO);
public abstract int SetLogPath(String logDir);
Parameter | Type | Description |
logDir | String | Path |
ITMGContext.GetInstance(this).SetLogPath(path);
public abstract String GetQualityTips();
ITMGContext.GetInstance(this).GetRoom().GetQualityTips();
Message | Description | Data | Example |
ITMG_MAIN_EVENT_TYPE_ENTER_ROOM | A member entered the audio room. | result; error_info | {"error_info":"","result":0} |
ITMG_MAIN_EVENT_TYPE_EXIT_ROOM | A member exited the audio room. | result; error_info | {"error_info":"","result":0} |
ITMG_MAIN_EVENT_TYPE_ROOM_DISCONNECT | The room was disconnected due to a network or another issue. | result; error_info | {"error_info":"waiting timeout, please check your network","result":0} |
ITMG_MAIN_EVNET_TYPE_USER_UPDATE | Room members were updated. | user_list; event_id | {"event_id":1,"user_list":["0"]} |
ITMG_MAIN_EVENT_TYPE_RECONNECT_START | The reconnection to the room started. | result; error_info | {"error_info":"","result":0} |
ITMG_MAIN_EVENT_TYPE_RECONNECT_SUCCESS | The reconnection to the room succeeded. | result; error_info | {"error_info":"","result":0} |
ITMG_MAIN_EVENT_TYPE_SWITCH_ROOM | The room was quickly switched. | result; error_info | {"error_info":"","result":0} |
ITMG_MAIN_EVENT_TYPE_CHANGE_ROOM_TYPE | The room status was changed. | result; error_info; sub_event_type; new_room_type | {"error_info":"","new_room_type":0,"result":0} |
ITMG_MAIN_EVENT_TYPE_ROOM_SHARING_START | Cross-room mic connect started. | result; | {"result":0} |
ITMG_MAIN_EVENT_TYPE_ROOM_SHARING_STOP | Cross-room mic connect stopped. | result; | {"result":0} |
ITMG_MAIN_EVENT_TYPE_SPEAKER_DEFAULT_DEVICE_CHANGED | The default speaker was changed. | result; error_info | {"deviceID":"{0.0.0.00000000}.{a4f1e8be-49fa-43e2-b8cf-dd00542b47ae}","deviceName":"Speaker (Realtek High Definition Audio)","error_info":"","isNewDevice":true,"isUsedDevice":false,"result":0} |
ITMG_MAIN_EVENT_TYPE_SPEAKER_NEW_DEVICE | A new speaker was added. | result; error_info | {"deviceID":"{0.0.0.00000000}.{a4f1e8be-49fa-43e2-b8cf-dd00542b47ae}","deviceName":"Speaker (Realtek High Definition Audio)","error_info":"","isNewDevice":true,"isUsedDevice":false,"result":0} |
ITMG_MAIN_EVENT_TYPE_SPEAKER_LOST_DEVICE | A speaker was lost. | result; error_info | {"deviceID":"{0.0.0.00000000}.{a4f1e8be-49fa-43e2-b8cf-dd00542b47ae}","deviceName":"Speaker (Realtek High Definition Audio)","error_info":"","isNewDevice":false,"isUsedDevice":false,"result":0} |
ITMG_MAIN_EVENT_TYPE_MIC_NEW_DEVICE | A new mic was added. | result; error_info | {"deviceID":"{0.0.1.00000000}.{5fdf1a5b-f42d-4ab2-890a-7e454093f229}","deviceName":"Mic (Realtek High Definition Audio)","error_info":"","isNewDevice":true,"isUsedDevice":true,"result":0} |
ITMG_MAIN_EVENT_TYPE_MIC_LOST_DEVICE | A mic was lost. | result; error_info | {"deviceID":"{0.0.1.00000000}.{5fdf1a5b-f42d-4ab2-890a-7e454093f229}","deviceName":"Mic (Realtek High Definition Audio)","error_info":"","isNewDevice":false,"isUsedDevice":true,"result":0} |
ITMG_MAIN_EVENT_TYPE_MIC_DEFAULT_DEVICE_CHANGED | The default mic was changed. | result; error_info | {"deviceID":"{0.0.1.00000000}.{5fdf1a5b-f42d-4ab2-890a-7e454093f229}","deviceName":"Mic (Realtek High Definition Audio)","error_info":"","isNewDevice":false,"isUsedDevice":true,"result":0} |
ITMG_MAIN_EVENT_TYPE_CHANGE_ROOM_QUALITY | The room quality changed. | weight; loss; delay | {"weight":5,"loss":0.1,"delay":1} |
ITMG_MAIN_EVNET_TYPE_PTT_RECORD_COMPLETE | Voice message recording was completed. | result; file_path | {"file_path":"","result":0} |
ITMG_MAIN_EVNET_TYPE_PTT_UPLOAD_COMPLETE | Voice message upload was completed. | result; file_path;file_id | {"file_id":"","file_path":"","result":0} |
ITMG_MAIN_EVNET_TYPE_PTT_DOWNLOAD_COMPLETE | Voice message download was completed. | result; file_path;file_id | {"file_id":"","file_path":"","result":0} |
ITMG_MAIN_EVNET_TYPE_PTT_PLAY_COMPLETE | Voice message playback was completed. | result; file_path | {"file_path":"","result":0} |
ITMG_MAIN_EVNET_TYPE_PTT_SPEECH2TEXT_COMPLETE | Fast speech-to-text conversion was completed. | result; text;file_id | {"file_id":"","text":"","result":0} |
ITMG_MAIN_EVNET_TYPE_PTT_STREAMINGRECOGNITION_COMPLETE | Streaming speech-to-text conversion was completed. | result; file_path; text;file_id | {"file_id":"","file_path":","text":"","result":0} |
ITMG_MAIN_EVNET_TYPE_PTT_STREAMINGRECOGNITION_IS_RUNNING | Streaming speech-to-text conversion is in progress. | result; file_path; text;file_id | {"file_id":"","file_path":","text":"","result":0} |
ITMG_MAIN_EVNET_TYPE_PTT_TEXT2SPEECH_COMPLETE | Text-to-speech conversion was completed. | result; text;file_id | {"file_id":"","text":"","result":0} |
ITMG_MAIN_EVNET_TYPE_PTT_TRANSLATE_TEXT_COMPLETE | Text translation was completed. | result; text;file_id | {"file_id":"","text":"","result":0} |
문제 해결에 도움이 되었나요?