Talk

Voice integration for Android with a fluent and easy to use interface

License

License

GroupId

GroupId

com.pddstudio
ArtifactId

ArtifactId

talk
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

aar
Description

Description

Talk
Voice integration for Android with a fluent and easy to use interface
Project URL

Project URL

https://github.com/pddstudio/talk
Source Code Management

Source Code Management

https://github.com/pddstudio/talk

Download talk

How to add to project

<!-- https://jarcasting.com/artifacts/com.pddstudio/talk/ -->
<dependency>
    <groupId>com.pddstudio</groupId>
    <artifactId>talk</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.pddstudio/talk/
implementation 'com.pddstudio:talk:1.0.0'
// https://jarcasting.com/artifacts/com.pddstudio/talk/
implementation ("com.pddstudio:talk:1.0.0")
'com.pddstudio:talk:aar:1.0.0'
<dependency org="com.pddstudio" name="talk" rev="1.0.0">
  <artifact name="talk" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.pddstudio', module='talk', version='1.0.0')
)
libraryDependencies += "com.pddstudio" % "talk" % "1.0.0"
[com.pddstudio/talk "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
com.android.support » appcompat-v7 jar 23.1.1

Project Modules

There are no modules declared in this project.

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

Android Arsenal

##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.

Versions

Version
1.0.0