All Projects → zagum → Speechrecognitionview

zagum / Speechrecognitionview

Licence: apache-2.0
"Google Now" style animation for Speech Recognizer.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Speechrecognitionview

Php Opencv Examples
Tutorial for computer vision and machine learning in PHP 7/8 by opencv (installation + examples + documentation)
Stars: ✭ 333 (-25.17%)
Mutual labels:  recognition
Cnn handwritten chinese recognition
CNN在线识别手写中文。
Stars: ✭ 365 (-17.98%)
Mutual labels:  recognition
Material Auto Rotating Carousel
Introduce users to your app with this Material-style carousel.
Stars: ✭ 400 (-10.11%)
Mutual labels:  material-ui
Skclusive.material.component
Port of Material-UI in C# for Blazor
Stars: ✭ 337 (-24.27%)
Mutual labels:  material-ui
Aestheticdialogs
📱 An Android Library for 💫fluid, 😍beautiful, 🎨custom Dialogs.
Stars: ✭ 352 (-20.9%)
Mutual labels:  material-ui
Library Assistant
Modern Library Management Software using JavaFX
Stars: ✭ 380 (-14.61%)
Mutual labels:  material-ui
Next Shopify Storefront
🛍 A real-world Shopping Cart built with TypeScript, NextJS, React, Redux, Apollo Client, Shopify Storefront GraphQL API, ... and Material UI.
Stars: ✭ 317 (-28.76%)
Mutual labels:  material-ui
Handwriting Ocr
OCR software for recognition of handwritten text
Stars: ✭ 411 (-7.64%)
Mutual labels:  recognition
App
🤖 A GitHub App to automate acknowledging contributors to your open source projects
Stars: ✭ 358 (-19.55%)
Mutual labels:  recognition
Admin On Rest
A frontend framework for building admin SPAs on top of REST services, using React and Material Design.
Stars: ✭ 392 (-11.91%)
Mutual labels:  material-ui
All Contributors Cli
Tool to help automate adding contributor acknowledgements according to the all-contributors specification ✨
Stars: ✭ 345 (-22.47%)
Mutual labels:  recognition
Floatingsearchview
A search view that implements a floating search bar also known as persistent search
Stars: ✭ 3,522 (+691.46%)
Mutual labels:  material-ui
Spectro
🎶 Real-time audio spectrogram generator for the web
Stars: ✭ 383 (-13.93%)
Mutual labels:  material-ui
Text Image Augmentation
Geometric Augmentation for Text Image
Stars: ✭ 333 (-25.17%)
Mutual labels:  recognition
Vue Material Dashboard
Vue Material Dashboard - Open Source Material Design Admin
Stars: ✭ 403 (-9.44%)
Mutual labels:  material-ui
Material Ui Dropzone
A Material-UI file upload dropzone
Stars: ✭ 328 (-26.29%)
Mutual labels:  material-ui
Mson
🏗️MSON Lang: Generate an app from JSON
Stars: ✭ 378 (-15.06%)
Mutual labels:  material-ui
Materialtimelineview
With MaterialTimelineView you can easily create a material looking timeline.
Stars: ✭ 443 (-0.45%)
Mutual labels:  material-ui
React Social Network
Simple React Social Network
Stars: ✭ 409 (-8.09%)
Mutual labels:  material-ui
Rally
Unofficial Implementation of Material Studies https://material.io/design/material-studies/rally.html
Stars: ✭ 392 (-11.91%)
Mutual labels:  material-ui

SpeechRecognitionView

Android Arsenal Release

"Google Now" style animation for Speech Recognizer.

image

Compatibility

This library is compatible from API 15 (Android 4.0.3).

Download

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

Add the dependency

dependencies {
    compile 'com.github.zagum:SpeechRecognitionView:1.2.2'
}

Usage

  • Xml file:

Simply add view to your layout:

<com.github.zagum.speechrecognitionview.RecognitionProgressView
	android:id="@+id/recognition_view"
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	android:layout_gravity="center"/>
  • Initialization:

Init speech recognizer:

SpeechRecognizer speechRecognizer = SpeechRecognizer.createSpeechRecognizer(context);

Init RecognitionProgressView:

RecognitionProgressView recognitionProgressView = (RecognitionProgressView) findViewById(R.id.recognition_view);
recognitionProgressView.setSpeechRecognizer(speechRecognizer);
recognitionProgressView.setRecognitionListener(new RecognitionListenerAdapter() {
        @Override
        public void onResults(Bundle results) {
	        showResults(results);
        }
});

When SpeechRecognizer and RecognitionProgressView inited, use your speech recognizer as usual:

listen.setOnClickListener(new View.OnClickListener() {
	@Override
	public void onClick(View v) {
		startRecognition();
	}
});

private void startRecognition() {
	Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
	intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getPackageName());
	intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
	speechRecognizer.startListening(intent);
}

Start and stop RecognitionProgressView animation:

recognitionProgressView.play();

recognitionProgressView.stop();
  • Customization:

Set custom colors:

int[] colors = {
		ContextCompat.getColor(this, R.color.color1),
		ContextCompat.getColor(this, R.color.color2),
		ContextCompat.getColor(this, R.color.color3),
		ContextCompat.getColor(this, R.color.color4),
		ContextCompat.getColor(this, R.color.color5)
};
recognitionProgressView.setColors(colors);

Set custom bars heights:

int[] heights = {60, 76, 58, 80, 55};
recognitionProgressView.setBarMaxHeightsInDp(heights);

Set custom circle radius/spacing between circles/idle animation amolitude size/rotation animation radius:

recognitionProgressView.setCircleRadiusInDp(2);
recognitionProgressView.setSpacingInDp(2);
recognitionProgressView.setIdleStateAmplitudeInDp(2);
recognitionProgressView.setRotationRadiusInDp(10);

Don't forget to add permission to your AndroidManifest.xml file

<uses-permission android:name="android.permission.RECORD_AUDIO"/>
  • Warning

From Android Documentation For java public abstract void onRmsChanged (float rmsdB) callback There is no guarantee that this method will be called., so if this callback does not return values the Bars animation will be skipped.

I found some hack to make it working every time you want to start speech recognition:

listen.setOnClickListener(new View.OnClickListener() {
	@Override
	public void onClick(View v) {
		startRecognition();
		recognitionProgressView.postDelayed(new Runnable() {
			@Override
			public void run() {
				startRecognition();
			}
		}, 50);
	}
});

License

Copyright 2016 Evgenii Zagumennyi

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