Sie sind auf Seite 1von 4

Web Site: www.ijettcs.org Email: editor@ijettcs.org, editorijettcs@gmail.

com Volume 2, Issue 3, May June 2013 ISSN 2278-6856

Generating Select Query from Spoken Words on Android Smart Phone


Pritesh N. Patel1, Jigisha K. Patel2 and Paresh V. Virparia3
1

Institute of Science and Technology for Advanced Studies and Research (ISTAR), Vallabh Vidyanagar, Gujarat, India
2

Department of Computer Science, Sardar Patel University, Vallabh Vidyanagar, Gujarat, India Department of Computer Science, Sardar Patel University, Vallabh Vidyanagar, Gujarat, India

Abstract: Today in the world of Information Technology,


Smartphone offers access to information from global Internet world by availing broadband mobile network and powerful application to the users. People not only use smartphone to talk, but also for e-mailing, texting, microblogging, etc.In addition to these, user can also give voice commands for different activities like searching, navigating and also provides voice-enabled keyboard. Smartphones are also used to access useful information in the fields of education. In this paper we discuss an application which recognizesusersvoice and convert it into text using android voice recognition API and Google Voice Search application and this converted text is used to generate standard SELECT query and execute to produce result.

speech, understand it and convert it in other kind of desired output and also perform required action. The recognition of speech works in four different phases: 1. Conversion of speech into digital signals 2. Extracting the actual speech sound 3. Constructing speech frames 4. Comparison of speech frames to words in grammar files to determine the correct word Speech recognition involves speaking into the device microphone and enabling the software to detect the voice, interpret the speech, translate speech into a string and thisspeech recognition services are intended for use with short command-like phrases without pauses, not for long dictation. As we know that an Android is an open platform, so our application can potentially make use of any speech recognition service on the device that is registered to receive a RecognizerIntent. Google's Voice Search application, which is pre-installed on many Android devices or can be installed, responds to a RecognizerIntent by displaying the "Speak now" dialog and streaming audio to Google's server that is same servers used when a user taps the microphone button on the search widget or the voice-enabled keyboard [5]. RecognizerIntent is constant for supporting speech recognition through starting intent.Android.speech.RecognizerIntent.ACTION_RECO GNIZE_SPEECH will start an activity that will prompt the user for speech and send it through a speech recognizer and Android.speech.RecognizerIntent.EXTRA_LANGUAGE _MODE will informs the recognizer which speech model to prefer when performingACTION_RECOGNIZE_SPEECH.

Keywords:Android, GoogleVoiceSearchAPI, Natural Language Processing, Voice Recognition, Voice Recognition, Smartphone

1. INTRODUCTION
Traditional data are given toSmartphone using keyboard and by just pressing finger on icon. Today, a new input medium is evolved i.e. voice input.People love their smart phones because they can stay in touch with the rest of the world wherever they are. That means not just talking, but e-mailing, texting, microblogging, and so on. So, in addition to search by voice and voice shortcuts like "Navigate to", we included a voice-enabled keyboard [5]. Here in this paper we describe an application developed to collect spoken words by users. By extracting these words we generate standard SELECT query and also execute it to produce output. If the word for appropriate operation is not matched then message is display that no match found. This application can be used by the person who is not enabled to input data using standard keypad.

2. INTRODUCTION TO GOOGLE VOICE SEARCH AND ANDROID VOICE RECOGNITION API


The process of converting speech input to digital output like text is generally known as a speech recognition which provides a computer with a feature to listen user Volume 2, Issue 3 May June 2013

3. THE APPLICATION
The Android SDK includes numerous features and services for the benefit of users with visual and hearing impairments [4] like speech recognition framework, TextTo-Speech (TTS), etc.Android applications can leverage Page 91

Web Site: www.ijettcs.org Email: editor@ijettcs.org, editorijettcs@gmail.com Volume 2, Issue 3, May June 2013 ISSN 2278-6856
speech input and output.Speech input can be achieved using speech recognition services and speech output can be achieved using Text-To-Speech services [4] and Speech services are available within the Android SDK in the android speech package.

Figure 1General Operation Screen Figure 1 shows the operation of creation of database, creation of table, record insertion operation, viewing all record and button to navigate to speak query. Below given code snippet perform the operation of extracting words from string returned by Google Voice API. //Store Query returned by Google Voice Search Application strQuery= txtText.getText().toString(); String []words= strQuery.split(" "); String strOperation =words[0].toUpperCase(); String[] strSelectMatch = getResources().getStringArray(R.array.dSelect); inti=-1; for (String s : strSelectMatch) { i = s.indexOf(strOperation); if(i>=0) { strOperation = "SELECT"; break; }}

Flow Chart 1 Working Flow Diagram Here flow chart 1 outlines the system workflow. Following steps are involved in these system: 1. Take voice input from user. 2. Send this voice to Google voice service server to produce string from voice. 3. Extract words from resulting string. 4. Prepare query by comparing words from database. 5. Execute generated query to produce output. This application requires following as discussed in introduction: 1. Google Voice Search Application 2. Internet connection Application requires Google Voice Search Application preinstalled to convert Speech to Text and resulting string is analyzed to create standard SELECT query on android smartphone for SQLite database. This generated query is transformed to format used in android database handling function like: Cursor c=db.query(String table,String[] columns,String selectio n,String[]selectionArgs,StringgroupBy,String having, St ring orderBy,String limit) The query is created only from specified word list only, and if word is not matched then prompt is opened to selected appropriate word and these new word is added to database for future match. Various matching word for standard word SELECT are like GET, DISPLAY, FETCH, GIVE, RETRIVE, LIST, etc.

Figure 2 Query Execution for correct query Figure 2 shows query generated from spoken words and produce result after successfully execution of generated query. Page 92

Volume 2, Issue 3 May June 2013

Web Site: www.ijettcs.org Email: editor@ijettcs.org, editorijettcs@gmail.com Volume 2, Issue 3, May June 2013 ISSN 2278-6856 References
[1] Android Programmers Guide, By. Jerome F. DiMarzio, McGraw-Hill Companies, Inc. [2] Professional Android Application Development, By. Reto Meier, Wiley Publishing, Inc. [3] Android Application Development, By Rick Rogers, John Lombardo, O'Reilly Media, Inc. [4] Android Wireless Application Development, By. Shane Conder and Lauren Darcey, Addison-Wesley. [5] Android Developers Blog, http://androiddevelopers.blogspot.in/2010/03/speech-input-api-forandroid.html, Retrieved 18th May 2013. [6] Javacodegeeks.com, http://www.javacodegeeks.com/2012/08/androidvoice-recognition-tutorial.html, Retrieved 29th May 2013. [7] Head First Android Development, By. Jonathan Simon, OReilly Media, Inc. [8] BEGINNING ANDROID APPLICATION DEVELOPMENT, BY. WEI-MENG LEE, WILEY PUBLISHING, INC. [9] ANDROID PROGRAMMING TUTORIALS,BY. MARK L MURPHY, COMMENWARE, LLC. [10] ANDROID DEVELOPER DOCUMENTATION, HTTP://DEVELOPER.ANDROID.COM/REFEREN CE/ANDROID/SPEECH/PACKAGESUMMARY.HTML, RETRIEVED 28TH MAY 2013. [11] Android In Action, By. W. Frank Ableson, RobiSen and Chris King, Manning GreenWich. [12] Code4reference, http://code4reference.com/2012/07/tutorial-androidvoice-recognition/, Retrieved 29th May 2013. [13] Fundamentals of Speech Recognition, By. Lawrence Rabiner and Biing-Hwang Juang, Prentice Hall Press [14] Automatic Speech Recognition: The Development of the SPHINX Recognition System, By. Kai-Fu Lee, Kluwer Academic Publisher

Figure 3 Query Execution for word match In Figure 2 result is shown when user speak query SELECT * FROM Employee and in Figure 3 user speaks query GET All FROM employee. After comparing from selected words from database query generate same output for both generated spoken statements. To activate Google Voice Search application from android application following Intent is to be called: Intent intent = newIntent(RecognizerIntent.ACTION_RECOGNIZE_SPE ECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE _MODEL, "en-US"); try { startActivityForResult(intent, RESULT_SPEECH); txtText.setText(""); }catch (ActivityNotFoundException a) { Toast.makeText(getApplicationContext(),"Sorry! Your device doesn't support Speech to Text functionality",30).show(); } Here we use android.speech.RecognizerIntent to launch the built-in speech recorder and allow the use to record the speech. After recording this sound file is sent to underlying speech recognizing server provided by Google or other using internet connection.We also call the startActivityForResult method, so we will handle the recognizer results in the onActivityResult method. Applicationrequires Android.permission.INTERNET permission to successfully run and to use internet.

AUTHOR
Pritesh Patel received his Master degree in Computer Application from Sardar Patel University in 2008. He is currently working as an Assistant Professor with the Department of Computer Science, Institute of Science and Technology for Advanced Studies and Research, Vallabh Vidyanagar, Gujarat Technological University, Gujarat, India. His research interests are mainly focused on Mobile and Web Technology. Jigisha Patel received her Master degree in Computer Application from Sardar Patel University in 2008. She is currently working as an Assistant Professor with the Department of Computer Science, Sardar Patel University, Gujarat, India. Her research interests are mainly focused on Natural Language Processing and Web Technology.

4. CONCLUSION
Here we conclude that Smartphone is not only used for just calling, messaging, Internet surfing, etc., but can also be used to carry out some useful functionality that can be benefit to ease the people to perform their task easily. This application can be useful in education sector for fetching record from database by just speaking words and can also useful to those users who are not known to database functionality and SQL query formats. Volume 2, Issue 3 May June 2013

Page 93

Web Site: www.ijettcs.org Email: editor@ijettcs.org, editorijettcs@gmail.com Volume 2, Issue 3, May June 2013 ISSN 2278-6856

Dr. Paresh Virparia is working as a Director and Professor in the Department of Computer Science, Sardar Patel University, Vallabh Vidyanagar. He completed his MCA in 1989 from Sardar Patel University and Ph. D. in 2002 from Sardar Patel University. He is recognized Ph.D. guide in Computer Science at Sardar Patel University, V. V. Nagar, KadiVishvaVidyalaya, Gandhinagar, Charotar University of Science & Technology, Changa, R K University, Rajkot and UkaTarsadia University, Bardoli. THREE research scholars have completed their Ph.D. (Computer science) under his guidance. Currently, EIGHT students are doing their Ph. D. under the guidance of him. Also, three students have completed their M.Phil. (Comp.Sci.) under his supervision. His publications include 31 papers in International Journal, 14 papers in National Journals and 36 papers in national conferences/seminars. His research interests include the areas of Computer Simulation & Modeling, Networking and IT enabled services.

Volume 2, Issue 3 May June 2013

Page 94

Das könnte Ihnen auch gefallen