Voice Translation V2 (TranslateVoiceV2)
For voice translation, see FINTLTranslatorLang for the list of supported languages.
Login Requirement
You must be logged in before calling this API.If not logged in, a NEED_LOGIN error will be returned.
Function definition
UFUNCTION(BlueprintCallable, Category = "INTLSDKAPI")
static void TranslateVoiceV2(FINTLTranslatorVoiceV2Req req_info);
Parameter Descriptions
| Parameters | Type | Description |
|---|---|---|
| req_info | FINTLTranslatorVoiceV2Req | Translation request information. For details, see TranslatorVoiceV2Req |
Observers
The callback handler interface is TranslatorResultObserver.The callback data structure is TranslatorResult.
Callback ID is kMethodIDTranslatorTranslateVoiceV2.
Code sample
FINTLTranslatorVoiceV2Req req;
FString NativePath;
// Define path based on your project Platform
#if PLATFORM_ANDROID
NativePath = FPaths::Combine(FPaths::ProjectPersistentDownloadDir(), TEXT("intl-test/000.wav"));
#elif PLATFORM_IOS
NativePath = FPaths::Combine(FPaths::ProjectPersistentDownloadDir(), TEXT("intl-test/000.wav"));
#elif PLATFORM_WINDOWS
NativePath = FPaths::Combine(FPaths::ProjectPersistentDownloadDir(), TEXT("intl-test/000.wav"));
#elif INTL_PLATFORM_SERIES_PS
NativePath = FPaths::Combine(FPaths::ProjectPersistentDownloadDir(), TEXT("intl-test/000.wav"));
#elif INTL_PLATFORM_SERIES_XBOX
NativePath = FPaths::Combine(FPaths::ProjectPersistentDownloadDir(), TEXT("intl-test/000.wav"));
#else
NativePath = FPaths::Combine(FPaths::ProjectPersistentDownloadDir(), TEXT("intl-test/000.wav"));
#endif
req.voicePath = NativePath;
// Audio format: 1 = WAV, 2 = GVoice Opus
req.audioFormat = 1;
// Business Project Code, please contact your business Admin for details, incorrect usage will result in error.
req.gameCode = "";
// Unique request ID for tracking purposes
req.traceId = "";
UINTLSDKAPI::TranslateVoiceV2(req);