cs378 - mobile computing speech to text, text to speech, telephony
TRANSCRIPT
![Page 1: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/1.jpg)
CS378 - Mobile Computing
Speech to Text,Text to Speech,
Telephony
![Page 2: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/2.jpg)
2
SPEECH RECOGNITION - SPEECH TO TEXT
![Page 3: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/3.jpg)
3
Speech Recognition• android.speech package• Simplest example - start an Intent for a
resultRecognizerIntent.ACTION_RECOGNIZE_SPEECH
• uses network– true on the dev phones– doesn't work on emulator
![Page 4: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/4.jpg)
4
Speech Recognition
![Page 5: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/5.jpg)
5
Starting Intent
![Page 6: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/6.jpg)
6
Responding to Result• Note: list of results, ordered by confidence
![Page 7: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/7.jpg)
7
Results
![Page 8: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/8.jpg)
8
Modified Version• Show confidence scores
![Page 9: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/9.jpg)
9
Sample Results
![Page 10: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/10.jpg)
10
Sample Results
![Page 11: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/11.jpg)
11
Android SpeechRecognizer• Allows lower level control of SpeechRecognizer• If you don't want to use the intent and built in
activity• must call methods on the main activity thread• must have RECORD_AUDIO permission• likely uses a service– don't use for continuous recognition
• Requires RecognitionListener for call backs
![Page 12: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/12.jpg)
12
TEXT TO SPEECH
![Page 13: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/13.jpg)
13
Android TextToSpeech Class• Not as easy to use as SpeechToText• … but not too bad• In example, edit text to enter text and
button to launch speech to text object
![Page 14: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/14.jpg)
14
Text to Speech UI Example
![Page 15: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/15.jpg)
15
Text To Speech• Create Text To Speech Object• constructor requires a Context and a
TextToSpeech.OnInitListener
![Page 16: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/16.jpg)
16
TextToSpeech.OnInitListener• one method, onInit• passed an int for status
![Page 17: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/17.jpg)
17
onClick Method for Text to Speech• get text from EditText• pass to TextToSpeech object
• Demo• Other locales available–does not translate text
![Page 18: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/18.jpg)
18
Text To Speech• methods to:• save to a sound file• map text to sound files other than
default• check if languages available• set rate and pitch of speech engine
![Page 19: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/19.jpg)
19
TELEPHONY
![Page 20: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/20.jpg)
20
Telephony• "The working or use of telephones"• Remember, a lot of Android devices are
smartphones• android.telephony package in the API
![Page 21: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/21.jpg)
21
![Page 22: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/22.jpg)
22
android.telephony package• classes to work with• cellular network• the phone itself• SMS, short messaging service, text
messages• TelephonyManager
![Page 23: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/23.jpg)
23
Making Calls• From you app, easiest way is via Intents
• required permission is CALL_PHONE• Intent.ACTION_DIAL, brings up phone
app with numbered entered
![Page 24: CS378 - Mobile Computing Speech to Text, Text to Speech, Telephony](https://reader036.vdocuments.site/reader036/viewer/2022062308/56649dd05503460f94ac5378/html5/thumbnails/24.jpg)
24
Telephony Provider• Content Provider for data related to
phone operation• tables for– carriers, MMS, SMS