Skip to main content

Voice Translation (TranslateVoice)

AndroidiOSWindows
If you are using the Unity engine, see Unity SDK's TranslateVoice.

For voice translation, see FINTLTranslatorLang for the list of supported languages.

Function Definition

UFUNCTION(BlueprintCallable, Category = "INTLSDKAPI")
static void TranslateVoice(FINTLTranslatorVoiceReq req_info);

Parameter Instructions

ParametersTypeExplanation
req_infoFINTLTranslatorVoiceReqTranslation request information, see TranslatorVoiceReq for details.

Observers

The callback handler interface is TranslatorResultObserver.The callback data structure is TranslatorResult.

Callback ID is kMethodIDTranslatorTranslateVoice.

Code example

	FINTLTranslatorVoiceReq 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;

// Business Game Code, please contact your business administrator for details, incorrect usage will result in error.
req.GameCode = "";
// Unique request ID for tracking purposes
req.traceId = "";

UINTLSDKAPI::TranslateVoice(req);