Talk


Source link: https://github.com/PDDStudio/Talk

#Talk An easy to use Android library with a fluent interface to integrate voice interaction into your Application.

##Demo Application ###Screenshot ###Download

##Getting Started ###Add the library as dependency Add the library as dependency to your build.gradle file.

dependencies {
  //other dependencies...  compile 'com.pddstudio:talk:1.0.0' 
}

###Initialize the library Implement the Talk.Callback interface and initialize Talk in your Activities onCreate() method.

@Override
  protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

 //initialize Talk lib

Talk.init(this, this);
 
}

###Create and add your voice commands Each voice command is represented as a SpeechObject in the library. You can create and add as much SpeechObjects as you like.

Assuming you want to let your application react on the word Hello you have to create a SpeechObject which will represent this word.

private SpeechObject helloObject = new SpeechObject() {

@Override

public void onSpeechObjectIdentified() {

 //handle action here in case the word is recognized

}

 @Override

public String getVoiceString() {

 return "hello";

}

  
}
;

After creating your SpeechObject instances you can add them to Talk to let it react on them

//add the speech objects (you can add one or more at once)

Talk.getInstance().addSpeechObjects(helloObject);

###Start Listening Assuming you have a button on which you want to start listening for voice input you simply trigger the startListening() method in the button's onClickListener.

listenBtn = (Button) findViewById(R.id.listenBtn);

listenBtn.setOnClickListener(new View.OnClickListener() {

 @Override

 public void onClick(View v) {

//make sure to check permission on Android 6.0

  if(hasPermission()) {

Talk.getInstance().startListening();

  
}
 else {

requestPermission();

  
}

 
}

}
);

###Notes

  • Make sure that permission RECORD_AUDIO is added & granted: <uses-permission android:name="android.permission.RECORD_AUDIO" />
  • You can find some more details in the demo application on how to add voice integration into your layout
  • Offline Mode is automatically available on SDK > 23
  • Default language is English, you can change this by yourself in case you want to

##About & Contact

##License Copyright 2016 Patrick J

Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License. You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

Resources

A cool loading view with Bezier and a smooth circular motion.

A toolkit help to build Android MVVM Application.

Native ItemTouch helper swipe and drag support for RecyclerView with undo action just like in "Do It" app.

Cute and colorful toggle button with 18 jelly types and 30 ease types.

Glide Bitmap Pool is a memory management library for reusing the bitmap memory.

This is a dialog utility library. It provides a easy way to let developers deal with screen rotation issue.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes