KEMBAR78
Smart Calculator | PDF | Speech Recognition | Speech
100% found this document useful (1 vote)
276 views11 pages

Smart Calculator

The document discusses speaker-independent voice recognition systems and their potential benefits in the workplace. It describes the differences between speaker-dependent and speaker-independent systems, with speaker-independent being more suitable for industrial use as it can recognize any person's voice without training. The document also covers isolated, connected, and continuous speech recognition styles. It then provides an example problem description, modules, and sample programs for a voice-enabled calculator application for visually impaired users.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
276 views11 pages

Smart Calculator

The document discusses speaker-independent voice recognition systems and their potential benefits in the workplace. It describes the differences between speaker-dependent and speaker-independent systems, with speaker-independent being more suitable for industrial use as it can recognize any person's voice without training. The document also covers isolated, connected, and continuous speech recognition styles. It then provides an example problem description, modules, and sample programs for a voice-enabled calculator application for visually impaired users.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 11

INTRODUCTION:-

Speaker-independent voice recognition systems have a very strong

probability of becoming a necessity in the workplace in the future. Such

systems would be able to improve productivity and would be more

convenient to use. The idea of a hardware that can recognize any person's

voice without the training time involved in currently employed systems is

a very promising one, and possibly a marketable one too.

At its most basic level speech recognition allows the user to perform

parallel tasks, (i.e. hands and eyes are busy elsewhere) while continuing to

work with the computer or appliance. Another aspect of this hardware

would be in the assistance of hand-disabled people.

1.1 . Specifications
1.1.1. Speaker Dependent / Speaker Independent

Speech recognition is classified into two categories, speaker

dependent and speaker independent. Speaker dependent systems are

trained by the individual who will be using the system. These systems are

capable of achieving a high command count and better than 95% accuracy

for word recognition. The drawback to this approach is that the system

only responds accurately only to the individual who trained the system.

This is the most common approach employed in software for personal

computers. Speaker independent is a system trained to respond to a word


regardless of who speaks. Therefore the system must respond to a large

variety of speech patterns, inflections and enunciation's of the target word.

The command word count is usually lower than the speaker dependent

however high accuracy can still be maintain within processing limits.

Industrial requirements more often need speaker independent voice

systems, such as the AT&T system used in the telephone systems

Recognition Style

Speech recognition systems have another constraint concerning the

style of speech they can recognize. There are three styles of speech:

isolated, connected and continuous. Isolated speech recognition systems

can just handle words that are spoken separately. This is the most common

speech recognition systems available today. The user must pause between

each word or command spoken. The speech recognition circuit is set up to

identify isolated words of 0.96 second lengths. Connected is a half way

point between isolated word and continuous speech recognition. Allow

users to speak multiple words.


PROBLEM DESCRIPTION

Normal calculator isn’t suitable for visually challenged people.

Because they can’t see and type numbers in calculator as well as result

will be displayed in screen. This kind of user can only give and get result

through voice commands. Therefore, The Voice recognition application is

suitable for visually challenged people. When they need to perform some

mathematical operations, they can use this application without any third

person's involvement.
MODULES

 USER INTERFACE MODULE

This application is developed by Android studio.


Therefore, it has high user interface and easy to access.

Components
1.Text View
2. Edit Text

 SPEECH TO TEXT
The user can give the input in the form of speech.
The system converts the speech into text by built in library
modules
Components
1. RecognizerIntent
Operations
1. RecognizerIntent.ACTION_RECOGNIZE_SPEECH

 TEXT TO SPEECH

After calculating the given operations,the result is in the


form of text. Then that resultant value is converted in the form of
speech by using built in classes

Components
TextToSpeech
Operations
TextToSpeech()
setLanguage(Locale.ENGLISH)
SAMPLE PROGRAMS

Activity_main. xml

<?xml version="1.0" encoding="utf-8"?>


<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp">

<TextView
android:id="@+id/textview1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="100dp"
android:textSize="26sp"
android:textStyle="normal" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:gravity="center"
android:orientation="vertical" >

<TextView
android:id="@+id/textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="#36dbca"
android:clickable="true"
android:gravity="center"
android:padding="16dp"
android:text="Open Mic"
android:textColor="@color/colorAccent"
android:textSize="22sp"
android:textStyle="normal" />
</LinearLayout>

</RelativeLayout>

</android.support.constraint.ConstraintLayout>

Activity_main2. xml:-

<?xml version="1.0" encoding="utf-8"?>


<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Main2Activity">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:backgroundTint=" "
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp">

<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="84dp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="73dp"
android:layout_marginTop="99dp"
android:ems="10"
android:inputType="textPersonName"
android:text="YOU SPEAK CORRECTLY!!!" />
</RelativeLayout>
</android.support.constraint.ConstraintLayout>
MainActivity. java

package com.example.sathish.myapplication;

import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.speech.RecognizerIntent;
import android.speech.tts.TextToSpeech;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.Locale;

public class MainActivity extends AppCompatActivity {

private TextView t1;


private TextView t2;

private final int REQ_CODE_SPEECH_INPUT = 100;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

t1 = (TextView) findViewById(R.id.textview1);
t2 = (TextView) findViewById(R.id.textview);

t2.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
askSpeechInput();
}
});

private void askSpeechInput() {


Intent intent = new
Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
intent.putExtra(RecognizerIntent.EXTRA_PROMPT,
"Hi speak something");
try {
startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);
} catch (ActivityNotFoundException a) {

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);

switch (requestCode) {
case REQ_CODE_SPEECH_INPUT: {
if (resultCode == RESULT_OK && null != data) {

ArrayList<String> result =
data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
t1.setText(result.get(0));
Intent i=new Intent(getApplicationContext(),Main2Activity.class);
Bundle b2=new Bundle();
b2.putString("ed",result.get(0));
i.putExtras(b2);
startActivity(i);
}
break;
}

}
Main2Activity.java

package com.example.sathish.myapplication;

import android.speech.tts.TextToSpeech;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.EditText;

import java.util.Locale;
import java.util.StringTokenizer;

public class Main2Activity extends AppCompatActivity {


TextToSpeech t1;
EditText t;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
t=(EditText)findViewById(R.id.editText);
Bundle b2=getIntent().getExtras();
String s=b2.getString("ed").toString();
StringTokenizer s1;
float a,b;
t1=new TextToSpeech(getApplicationContext(), new
TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
if(status != TextToSpeech.ERROR) {
t1.setLanguage(Locale.ENGLISH);
}
}
});
if(s.contains("+"))
{
s1=new StringTokenizer(s, "+");
a=Float.parseFloat(s1.nextToken());
b=Float.parseFloat(s1.nextToken());
t.setText(a+b+"");
t1.speak(t.getText(), TextToSpeech.QUEUE_FLUSH,null,null);
}
if(s.contains("-"))
{
s1=new StringTokenizer(s, "-");
a=Float.parseFloat(s1.nextToken());
b=Float.parseFloat(s1.nextToken());
t.setText(a-b+"");
t1.speak(t.getText(), TextToSpeech.QUEUE_ADD,null,null);
}
if(s.contains("*"))
{
s1=new StringTokenizer(s, "+");
a=Float.parseFloat(s1.nextToken());
b=Float.parseFloat(s1.nextToken());
t.setText(a*b+"");
t1.speak(a*b+"", TextToSpeech.QUEUE_FLUSH,null,null);
}

}
public void onPause(){
if(t1 !=null){
t1.stop();
t1.shutdown();
}
super.onPause();
}

}
CONCLUSION AND SUMMARY

Smart Calculator was proposed for helping to visually

challenged people. Simple mathematical operations can be performed

through this Smart calculator. This application is based on Voice

recognizing concept. Therefore, this is very easy to use. It is convenient,

Eco friendly for both the visually impaired and normal people. This

application was developed by Android studio, that is one of the most

popular Android application development software. This app is also

published in Google play store, that act as repository of Android

applications. As this application is developed as a mobile application,

anyone can download it from play store from anywhere and use it without

any third person involvement.

You might also like