Voice Translation V2 (TranslateVoiceV2)
For voice translation, refer to TranslatorLang to view the list of supported languages.
Function definition
public static void TranslateVoiceV2(INTLTranslatorVoiceV2Req req_info);
Parameter Instructions
| Parameters | Type | Description |
|---|---|---|
| req_info | INTLTranslatorVoiceReqV2 | Translation request information. For details, see TranslatorVoiceV2Req |
Observers
The callback handling interface is TranslatorResultObserver.The callback data structure is TranslatorResult.
Callback ID is kMethodIDTranslatorTranslateVoiceV2.
Code example
var translatorReq = new INTLTranslatorVoiceV2Req();
var NativePath = "";
// Define path based on project platform
#if UNITY_ANDROID
NativePath = Path.Combine(Application.persistentDataPath, "intl-test/000.wav");
#elif UNITY_IOS
NativePath = Path.Combine(Application.persistentDataPath, "intl-test/000.wav");
#elif UNITY_STANDALONE_WIN
NativePath = Path.Combine(Application.persistentDataPath, "intl-test/000.wav");
#elif UNITY_PS5
NativePath = Path.Combine(Application.persistentDataPath, "intl-test/000.wav");
#elif UNITY_GAMECORE_XBOXSERIES || UNITY_GAMECORE_SCARLETT
NativePath = Path.Combine(Application.persistentDataPath, "intl-test/000.wav");
#else
NativePath = Path.Combine(Application.persistentDataPath, "intl-test/000.wav");
#endif
translatorReq.VoicePath = NativePath;
// Business Game Code, please contact your business administrator for details, incorrect usage will result in error.
translatorReq.GameCode = "";
// Unique request ID for tracking purposes
translatorReq.traceId = "";
INTLAPI.TranslateVoiceV2(translatorReq);