JioTranslate CoreSDK iOS Demo App
In this documentation, we'll guide you through the process of installation, Let's get started on your journey to Break Language barriers with translation of any language into your native tongue with JioTranslate CoreSDK!
In JioTranslate Core SDK, you'll find a range of powerful features designed to enhance your iOS application's translation needs. These features include:
-
Speech to Text Translation: Experience seamless conversion of spoken language into written text.
-
Text to Text Translation: Effortlessly translate text from one language to another.
-
Text to Speech Translation: Transform written text into spoken language.
Before getting started with this example app, please ensure you have the following software installed on your machine:
- Xcode 14.2 or later.
- Swift 5.0 or later.
- An iOS device or emulator running iOS 13.0 or later.
Please add below permissions keys to your Info.plist
file with proper description.
<key>NSMicrophoneUsageDescription</key>
<string>App needs microphone access to record your audio and translate</string>
Please add below pod to your Podfile and run command pod install --repo-update --verbose
.
pod 'JioTranslateCoreSDKiOS', '1.2.0'
Please use below import statements
import JioTranslateCoreSDKiOS
Create and configure the instance of JioTranslateManager
.
JioTranslateManager.shared.configure(server: .sit, jwt: jwt, userId: userId)
Property Name | Type | Description |
---|---|---|
server | JioTranslateServer | Server address, .sit or .prod |
jwt | String | JWT token |
userId | String | Unique id of the User |
This method fetches the configuration data required for the SDK to function properly, upon successful loading, the list of supported languages can be obtained.
public func loadConfig(completion: @escaping (Result<String, JioTranslateApiError>) -> Void)
Property Name | Type | Description |
---|---|---|
completion | Result<String, JioTranslateApiError> | .success(_), .failure(let error) |
Use this function to convert spoken language into written text.
public func startSpeechToText(audioFilePath: URL, inputLanguage: String, translateEngine: TranlsateEngine? = nil, completion: @escaping (Result<String, JioTranslateApiError>) -> Void)
Property Name | Type | Description |
---|---|---|
audioFilePath | URL | Send recorded audio file path URL(Ex: recorded.wav) |
inputLanguage | String | Language name of the recorded audio, Ex: 'English', 'Telugu' |
translateEngine | TranlsateEngine | .TRANSLATE_ENGINE_1, .TRANSLATE_ENGINE_2, .TRANSLATE_ENGINE_3 |
completion | Result<String, JioTranslateApiError> | .success(let text), .failure(let error) |
Use this function to translate text from one language to another.
public func startTextTranslation(inputText: String, inputLanguage: String, translationLanguage: String, translateEngine: TranlsateEngine? = nil, isIndirectTranslation: Bool = false, completion: @escaping (Result<String, JioTranslateApiError>) -> Void)
Property Name | Type | Description |
---|---|---|
inputText | String | Input text to translate |
inputLanguage | String | Language name of the input text, Ex: 'English', 'Telugu' |
translationLanguage | String | Language name of the output translation text, Ex: 'Hindi', 'Telugu' |
translateEngine | TranlsateEngine | .TRANSLATE_ENGINE_1, .TRANSLATE_ENGINE_2, .TRANSLATE_ENGINE_3 |
isIndirectTranslation | Bool | true or false |
completion | Result<String, JioTranslateApiError> | .success(let text), .failure(let error) |
Use this function to translate written text into spoken language.
public func startTextToSpeech(inputText: String, inputLanguage: String, translateEngine: TranlsateEngine? = nil, gender: Gender, completion: @escaping (Result<String, JioTranslateApiError>) -> Void)
Property Name | Type | Description |
---|---|---|
inputText | String | Input text to translate |
inputLanguage | String | Language name of the input text, Ex: 'English', 'Telugu' |
translateEngine | TranlsateEngine | .TRANSLATE_ENGINE_1, .TRANSLATE_ENGINE_2, .TRANSLATE_ENGINE_3 |
gender | String | 'male' or 'female' |
completion | Result<String, JioTranslateApiError> | .success(let audioContent), .failure(let error) |
Facing any issues while integrating or installing the JioTranalte iOS CoreSDK kit, please connect with us via real time support present in [email protected] or https://translate.jio/contact-us.html