Skip to content

Repository files navigation

TYPEVERSIONSTATUSCOVERAGE
demodemoLatest demoBuild StatusCoverage Status
vui-corecoreLatest versionBuild StatusCoverage Status
addon-android-speechaddonLatest versionBuild StatusCoverage Status
addon-google-speechaddonLatest versionBuild StatusCoverage Status
addon-amazon-speechaddonLatest versionBuild StatusCoverage Status

This library combines both native built-in resources and cloud services into a component capable to run reliably and seamlessly a Speech Synthesizer and a Voice Recognizer.



It enables currently the following providers:

Other providers you can contribute with are:

  • Microsoft Azure
  • Watson (IBM)
  • Wit.ai
  • Temi

Why choosing this library?

Apart from the above mentioned, it also helps you when:

  • some devices don't have configured the resources you need to run a conversation in your app
  • a developer needs to learn and test quite a lot before even to start coding for voice capabilities
  • noise is impacting considerably the communication
  • oldest android components force you to create a lot of boilerplate
  • some countries don't allow Google Services

Prerequisites

The SDK works on Android version 5.0 (Lollipop) and above. (for lower versions contact us)

Dependencies

repositories { // Optional. Access to early versions not yet published.
maven { url "https://dl.bintray.com/chattylabs/maven" }
}
dependencies {
// Required
implementation 'chattylabs:vui-core:<latest version>'
// You can either use only one or combine addons
// i.e. Use voice Synthesizer from Google and SpeechRecognizer from Android
implementation 'chattylabs:addon-android-speech:<latest version>'
implementation 'chattylabs:addon-google-speech:<latest version>'
}

How to create a Conversation?

You can use the component at any Context level, both in an Activity and a Service.
You will create a set of VoiceNode objects, add them into the graph and build a flow.

// Get the Component via default providerval component =ConversationalFlow.provide(...)
// Setup the Addons to use (typically done in your Application class)
component.updateConfiguration(builder ->
builder .setRecognizerServiceType(() ->AndroidSpeechRecognizer.class)
.setSynthesizerServiceType(() ->AndroidSpeechSynthesizer.class)
.build())
// To record from the mic you have to request the permissionsval perms = component.requiredPermissions()
// requestPermissions(perms)// You should check if the addons are available
component.checkSpeechSynthesizerStatus(...)
val conversation:Conversation= component.create(context)
val question:VoiceMessage=...
val answers:VoiceMatch=...
with(conversation) {
addNode(question)
addNode(answers)
with(prepare()) {
from(question).to(answers)
}
start(question)
}

There are different Voice Nodes and Configurations, check the wiki page

About

The Conversational Flow combines both native built-in resources and cloud services into a software component capable to run reliably a Speech Synthesizer and a Voice Recognizer.

Topics

Resources

Stars

9 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages