This SDK helps in accurately converting speech into text using an API powered by Reverie's AI technology. The solution will transcribe the speech in real time in various Indian languages and audio formats.
-
Accurate Speech-to-Text Conversion: The Voice Input SDK ensures precise and reliable conversion of spoken words into text, leveraging the advanced AI technology developed by Reverie.
-
Minimalistic Integration: Seamlessly integrate the SDK into your application with minimal effort, allowing you to focus on enhancing the user experience rather than grappling with complex integration processes.
-
Option to Use Bundled UI: Enjoy the convenience of utilizing the bundled user interface, streamlining the integration process and offering a consistent and user-friendly experience within your application.
There are two constructors in the RevVoiceInput class. The first constructor accepts all parameters, allowing full customization. The second constructor accepts minimal parameters, assuming default values for language and domain.
There are two startRecognitions() methods in the RevVoiceInput class. The first method allows customization of language and domain for a specific call, while the second method uses default values for language and domain. Users can choose the constructor or method that best fits their needs based on whether they want to customize language and domain for the entire app flow or individual cases.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
apiKey | String | true | - | Api key given to the client |
appId | String | true | - | App Id given to the client |
domain | String | false | ‘voice_search’ | Domain of the voice Input |
Language | String | false | ‘en’ | Language of voice Input |
Logging | String | true | - | Logging of data required or not |
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
apiKey | String | true | - | Api key given to the client |
appId | String | true | - | App Id given to the client |
Logging | String | true | - | Logging of data required or not |
Element | Type | Required | Default | Description |
---|---|---|---|---|
Context | context | true | - | Context of the activity |
isUiNeeded | boolean | true | - | to use bundled UI element of the SDK |
Language | String | false | ‘en’ | Language of Input |
Domain | String | false | ‘voice_search’ | Domain of Input |
Element | Type | Required | Default | Description |
---|---|---|---|---|
Context | context | true | - | Context of the activity |
isUiNeeded | boolean | true | - | to use bundled UI element of the SDK |
Various constant values are provided in SDK for DOMAIN, LANGUAGES, and LOGGING parameters
Domain.VOICE_SEARCH
Domain.GENERIC
Domain.BFSI
Languages.ENGLISH
Languages.HINDI
Logging.TRUE
- stores client’s audio and keeps transcript in logs.Logging.NO_AUDIO
- does not store client’s audio but keeps transcript in logs.Logging.NO_TRANSCRIPT
- does not keep transcript in logs but stores client’s audio.Logging.FALSE
- does not keep the client’s audio or the transcript in the log.
To integrate the SDK into your application, follow these steps:
-
Addition of Gradle dependencies as follows:
-
Add the
jitpack.io
repository to the project levelbuild.gradle
file:dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { mavenCentral() maven { url 'https://jitpack.io' } } }
and add the following to the app-level dependencies:
dependencies { implementation 'com.github.reverieinc:rev-voice-input-android:v1.0.4' }
-
Add the
jitpack.io
repository to the project levelbuild.gradle
file:dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { mavenCentral() maven { url = uri("https://jitpack.io") } } }
and add the following to the app-level dependencies:
dependencies { implementation ("com.github.reverieinc:rev-voice-input-android:v1.0.4") }
Note:
- Verify that the latest version is added as a dependency.
- Min Supported Android SDK-21
-
-
Addition of Necessary Manifest Permissions
Add the following permissions in your manifest:
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.RECORD_AUDIO" />
Make sure to request the user to grant the RECORD_AUDIO permission at runtime.
Kotlin
-
Prepare the constructor:
Type I:
//Preparing the Constructor with API-key, APP-ID, language, domain, and logging val voiceInput=RevVoiceInput(API_KEY,APP_ID, Domain.VOICE_SEARCH, Languages.ENGLISH, Logging.TRUE)
Type II:
//Preparing the constructor with a valid API key and APP-ID val voiceInput = RevVoiceInput(API_KEY, APP_ID,Logging.TRUE)
For more details about the types check: API Reference
-
Implement the listener:
//Implement the listener to get results and error details voiceInput.setListener(object : VoiceInputListener { override fun onResult(result: VoiceInputResultData?) { } override fun onError(error: VoiceInputErrorResponseData?) { } override fun onRecordingStart(isStart: Boolean) { // } override fun onRecordingEnd(isEnd: Boolean) { } })
-
Starting the Input process:
Type I:
voiceInput.startRecognition( getApplicationContext(), true ,Domain.VOICE_SEARCH, Languages.ENGLISH )
Type II:
//To start the voice search voiceInput.startRecognition( applicationContext, true )
For more details about the types check: API Reference
-
(Optional) Abort the search process
//To stop the voice searching forcefully voiceInput.cancel()
-
(Optional) Finish the search process
//To stop the voice searching forcefully and get the result voiceInput.finishInput()
-
(Optional) To Set the No Input Timeout
voiceInput.setNoInputTimeout(5.0)
-
(Optional) To Set the TimeOut
voiceInput.setTimeout(5.0)
-
(Optional) To Set the Silence
voiceInput.setSilence(2.0)
-
(Optional) To Enable Logging
import com.reverie.voiceinput.LOG; LOG.DEBUG=true
Java
-
Prepare the constructor:
Type I:
//Preparing the Constructor with a valid API key, APP-ID, language, domain, and Logging RevVoiceInput voiceInput = new RevVoiceInput( API_KEY, APP_ID, Domain.VOICE_SEARCH, Languages.ENGLISH, Logging.TRUE);
Type II:
//Preparing the constructor with a valid API key and APP-ID RevVoiceInput voiceInput = new RevVoiceInput(API_KEY, APP_ID,Logging.TRUE);
For more details about the types check: API Reference
-
Implement the listeners:
//Implement the listener to get results and error details voiceInput.setListener(new VoiceInputListener() { @Override public void onResult(VoiceInputResultData result) { //Log.d(TAG, "onResult: " + result); } @Override public void onError(VoiceInputErrorResponseData error) { //Log.d(TAG, "onError: " + error.toString()); } @Override public void onRecordingStart(boolean isStart) { } @Override public void onRecordingEnd(boolean isEnd) { } });
-
Starting the search Process.
Type I:
voiceInput.startRecognition( getApplicationContext(), true Domain.VOICE_SEARCH, Languages.ENGLISH )
Type II:
//To Start the Voice Input voiceInput.startRecognition( getApplicationContext(),//Context true//isUiNeeded );
For more details about the types check: API Reference
-
(Optional) Abort the search process
//To stop the voice searching forcefully voiceInput.cancel();
-
(Optional) Finish the search process
//To stop the voice searching forcefully and get the result voiceInput.finishInput();
-
(Optional) To Set the No Input Timeout
voiceInput.setNoInputTimeout(5.0);
-
(Optional) To Set the TimeOut
voiceInput.setTimeout(5.0);
-
(Optional) To Set the Silence
voiceInput.setSilence(2.0)
-
(Optional) To Enable Logging(Logcat)
import com.reverie.voiceinput.LOG; LOG.Companion.setDEBUG(true);
All Rights Reserved. Copyright 2023. Reverie Language Technologies Limited.(https://reverieinc.com/)
Reverie Voice Input SDK can be used according to the Apache License, Version 2.0.