All Projects â†’ algolia â†’ Voice Overlay Android

algolia / Voice Overlay Android

Licence: mit
🗣 An overlay that gets your user’s voice permission and input as text in a customizable UI

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Voice Overlay Android

Voice Overlay Ios
🗣 An overlay that gets your user’s voice permission and input as text in a customizable UI
Stars: ✭ 440 (+132.8%)
Mutual labels:  chatbots, conversation, search, speech-recognition, speech-to-text, voice-recognition, voice, permissions, conversational-ui, input, overlay
Rhino
On-device speech-to-intent engine powered by deep learning
Stars: ✭ 406 (+114.81%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
Zzz Retired openstt
RETIRED - OpenSTT is now retired. If you would like more information on Mycroft AI's open source STT projects, please visit:
Stars: ✭ 146 (-22.75%)
Mutual labels:  speech-recognition, speech-to-text, voice
Sonus
💬 /so.nus/ STT (speech to text) for Node with offline hotword detection
Stars: ✭ 532 (+181.48%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
musicologist
Music advice from a conversational interface powered by Algolia
Stars: ✭ 19 (-89.95%)
Mutual labels:  conversational-ui, speech-recognition, speech-to-text
React Mic
Record audio from a user's microphone and display a cool visualization.
Stars: ✭ 323 (+70.9%)
Mutual labels:  speech-to-text, voice-recognition, voice
Speech To Text Benchmark
speech to text benchmark framework
Stars: ✭ 481 (+154.5%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
open-speech-corpora
💎 A list of accessible speech corpora for ASR, TTS, and other Speech Technologies
Stars: ✭ 841 (+344.97%)
Mutual labels:  voice-recognition, speech-recognition, speech-to-text
Nativescript Speech Recognition
💬 Speech to text, using the awesome engines readily available on the device.
Stars: ✭ 72 (-61.9%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
Botpress
🤖 Dev tools to reliably understand text and automate conversations. Built-in NLU. Connect & deploy on any messaging channel (Slack, MS Teams, website, Telegram, etc).
Stars: ✭ 9,486 (+4919.05%)
Mutual labels:  chatbots, conversation, conversational-ui
Naomi
The Naomi Project is an open source, technology agnostic platform for developing always-on, voice-controlled applications!
Stars: ✭ 171 (-9.52%)
Mutual labels:  speech-recognition, speech-to-text, voice
spokestack-android
Extensible Android mobile voice framework: wakeword, ASR, NLU, and TTS. Easily add voice to any Android app!
Stars: ✭ 52 (-72.49%)
Mutual labels:  voice, voice-recognition, speech-recognition
voce-browser
Voice Controlled Chromium Web Browser
Stars: ✭ 34 (-82.01%)
Mutual labels:  voice-recognition, speech-recognition, speech-to-text
Cheetah
On-device streaming speech-to-text engine powered by deep learning
Stars: ✭ 383 (+102.65%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
spokestack-ios
Spokestack: give your iOS app a voice interface!
Stars: ✭ 27 (-85.71%)
Mutual labels:  voice-recognition, speech-recognition, speech-to-text
Spokestack Python
Spokestack is a library that allows a user to easily incorporate a voice interface into any Python application.
Stars: ✭ 103 (-45.5%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition
KeenASR-Android-PoC
A proof-of-concept app using KeenASR SDK on Android. WE ARE HIRING: https://keenresearch.com/careers.html
Stars: ✭ 21 (-88.89%)
Mutual labels:  voice-recognition, speech-recognition, speech-to-text
AmazonSpeechTranslator
End-to-end Solution for Speech Recognition, Text Translation, and Text-to-Speech for iOS using Amazon Translate and Amazon Polly as AWS Machine Learning managed services.
Stars: ✭ 50 (-73.54%)
Mutual labels:  voice-recognition, speech-recognition, speech-to-text
Annyang
💬 Speech recognition for your site
Stars: ✭ 6,216 (+3188.89%)
Mutual labels:  speech-recognition, speech-to-text, voice
Vosk Api
Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Stars: ✭ 1,357 (+617.99%)
Mutual labels:  speech-recognition, speech-to-text, voice-recognition

Voice Overlay for Android

Platform Android License: MIT Android Arsenal

Overview

Voice overlay helps you turn your user's voice into text, providing a polished UX while handling for you the necessary permission.

       

Demo

You can clone this repo, then run the Demo project by doing ./gradlew app:installDebug and launching the application:

Installation

The Voice overlay is available as a gradle dependency via JCenter. To install it, add the following line to your app's build.gradle:

dependencies {
    // [...]
    implementation 'com.algolia.instantsearch:voice:1.0.0-beta02'
    // [...]
}

Usage

Basic usage

  1. In your Activity, check if you have the permission and show the appropriate Dialog:
if (!isRecordAudioPermissionGranted()) {
    VoicePermissionDialogFragment().show(supportFragmentManager, "DIALOG_PERMISSION")
} else {
    VoiceInputDialogFragment().show(supportFragmentManager, "DIALOG_INPUT")
}

See it implemented in the demo app.

This will display the permission dialog if the RECORD_AUDIO permission was not yet granted, then the voice input dialog once the permission is granted.

Once the user speaks, you will get their input back by implementing VoiceSpeechRecognizer.ResultsListener:

override fun onResults(possibleTexts: Array<out String>) {
    // Do something with the results, for example:
    resultView.text = possibleTexts.firstOrNull()?.capitalize()
}

See it implemented in the demo app.

When the permission is not granted

If the user didn't accept the permission, you should explain the permission's rationale. If they deny the permission, you need to guide them into manually enabling it if they want to use the voice-input feature.

Voice overlay makes it easy to handle all these cases:

override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
    super.onRequestPermissionsResult(requestCode, permissions, grantResults)
    if (Voice.isRecordPermissionWithResults(requestCode, grantResults)) {
        when {
            Voice.isPermissionGranted(grantResults) -> showVoiceDialog()
                shouldExplainPermission() -> showPermissionRationale(getPermissionView())
                else -> Voice.showPermissionManualInstructions(getPermissionView())
        }
    }
    // [...] eventual handling of other permissions requested by your app 
}

See it implemented in the demo app.

This will display the permission rationale when the user doesn't allow it, and the manual instructions in case they denied it.

Customization

You can customize your voice overlay in the following ways:

Behavior

Several options let you adapt the voice overlay's behavior to your needs.

Suggestions

You can provide suggestions of what the user could say, to give them some examples.

voiceInputDialogFragment.setSuggestions(
    "64GB Smartphone",
    "Red running shoes",
    "Cheap TV screen"
)

AutoStart

You can prevent the overlay from automatically listening to user input.

/// Requires the user to click the mic to start listening. 
voiceInputDialogFragment.autoStart = false
// [...]
// you can also start listening programmatically with
voiceInputDialogFragment.start()

Copy text

You can change any text displayed in the overlay by overriding its resource in your strings.xml:

<!-- VoiceInputDialogFragment -->
<string name="input_title_listening">Listening…</string>
<string name="input_subtitle_listening">Say something like:</string>
<string name="input_title_error">Sorry, we didn\'t quite get that.</string>
<string name="input_subtitle_error">Try repeating your request.</string>
<string name="input_hint_error">Try again</string>

<!-- VoicePermissionDialogFragment -->
<string name="permission_title">You can use voice search to find products.</string>
<string name="permission_subtitle">May we access your device’s microphone to enable voice search?</string>
<string name="permission_button_allow">Allow microphone access</string>
<string name="permission_button_reject">No</string>

<!-- Rationale/Try Again -->
<string name="permission_rationale">Voice search requires this permission.</string>
<string name="permission_button_again">Request again?</string>

<!-- Manual Instructions -->
<string name="permission_enable_rationale">Permission denied, allow it to use voice search.</string>
<string name="permission_button_enable">Allow recording</string>
<string name="permission_enable_instructions">On the next screen, tap Permissions then Microphone.</string>

Layouts

You can replace the voice overlay's layouts by your own, as long as they respect the following structure:

Permission

Create a layout called voice_input.xml with

  • A ViewGroup container with id @+id/voicePermission
  • A View with id @+id/close for closing the overlay when clicked
  • A TextView with id @+id/title
  • A TextView with id @+id/subtitle

Input

Create a layout called voice_permission.xml with

  • A ViewGroup container with id @+id/voiceInput
  • A VoiceMicrophone with id @+id/microphone to handle the voice input
  • A TextView with id @+id/suggestions to display eventual suggestions
  • A View with id @+id/close for closing the overlay when clicked
  • A TextView with id @+id/title
  • A TextView with id @+id/subtitle
  • An eventual TextView with id @+id/hint to display a hint on error
  • An eventual RippleView with id @+id/ripple if you want to keep the animation

Getting Help

Getting involved

License

The VoiceOverlay is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].