Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Krishna Vemulavada
/
vera_2.1_app
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
064686d9
authored
Mar 13, 2018
by
Kunj Gupta
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fixed - TTS two messages speak issue.
parent
59b3733d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
187 deletions
app/build.gradle
app/src/arrow/java/com/vsoft/servicenow/chat/ChatActivity.java
app/src/arrow/java/com/vsoft/servicenow/chat/Speaker.java
app/src/arrow/java/com/vsoft/servicenow/speechRecognizer/DroidSpeech.java
app/build.gradle
View file @
064686d9
...
...
@@ -31,7 +31,7 @@ android {
defaultConfig
{
applicationId
"com.vsoft.servicenow"
minSdkVersion
1
6
minSdkVersion
1
5
targetSdkVersion
27
versionCode
1
versionName
"0.0.29"
...
...
app/src/arrow/java/com/vsoft/servicenow/chat/ChatActivity.java
View file @
064686d9
This diff is collapsed.
Click to expand it.
app/src/arrow/java/com/vsoft/servicenow/chat/Speaker.java
View file @
064686d9
...
...
@@ -3,9 +3,6 @@ package com.vsoft.servicenow.chat;
import
android.content.Context
;
import
android.media.AudioManager
;
import
android.speech.tts.TextToSpeech
;
import
android.speech.tts.UtteranceProgressListener
;
import
android.util.Log
;
import
com.vsoft.servicenow.utils.Util
;
import
java.util.HashMap
;
...
...
@@ -47,14 +44,14 @@ public class Speaker implements TextToSpeech.OnInitListener {
}
}
public
void
speak
(
String
text
){
public
void
speak
(
String
text
)
{
// Speak only if the TTS is ready
// and the user has allowed speech
if
(
ready
&&
allowed
)
{
HashMap
<
String
,
String
>
hash
=
new
HashMap
<
String
,
String
>();
if
(
ready
&&
allowed
)
{
HashMap
<
String
,
String
>
hash
=
new
HashMap
<
String
,
String
>();
hash
.
put
(
TextToSpeech
.
Engine
.
KEY_PARAM_STREAM
,
String
.
valueOf
(
AudioManager
.
STREAM_MUSIC
));
hash
.
put
(
TextToSpeech
.
Engine
.
KEY_PARAM_UTTERANCE_ID
,
"
UniqueID"
);
hash
.
put
(
TextToSpeech
.
Engine
.
KEY_PARAM_UTTERANCE_ID
,
"
"
+
System
.
currentTimeMillis
()
);
tts
.
speak
(
Util
.
fromHtml
(
text
).
toString
(),
TextToSpeech
.
QUEUE_ADD
,
hash
);
}
}
...
...
@@ -63,16 +60,16 @@ public class Speaker implements TextToSpeech.OnInitListener {
return
tts
.
isSpeaking
();
}
public
void
stop
(){
public
void
stop
()
{
tts
.
stop
();
}
public
void
pause
(
int
duration
){
public
void
pause
(
int
duration
)
{
tts
.
playSilence
(
duration
,
TextToSpeech
.
QUEUE_ADD
,
null
);
}
// Free up resources
public
void
destroy
(){
public
void
destroy
()
{
tts
.
shutdown
();
}
...
...
app/src/arrow/java/com/vsoft/servicenow/speechRecognizer/DroidSpeech.java
View file @
064686d9
...
...
@@ -246,8 +246,6 @@ public class DroidSpeech {
if
(
play
)
{
recognitionProgressView
.
play
();
speechProgressAlertDialog
.
show
();
// confirmLayout.setVisibility(View.GONE);
}
else
{
recognitionProgressView
.
stop
();
speechProgressAlertDialog
.
cancel
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment