Text to Speech voice coming out of Earphones Headphones and Speaker

1,277 views
Skip to first unread message

Chris Larcombe

unread,
Oct 13, 2015, 7:31:36 AM10/13/15
to AndroidScript
Hi there,

I just upgraded to new version and the behavior of my app changed unfavorably: the TTS now comes out of the phone speaker and headphones when I have earphones/headphones connected, rather than just coming out of earphones/headphones as expected (and as it behaved before).  The voice also sounds slightly different, possibly lower quality or a bit tinny or something (just sounds a bit different).

Is there a way to ensure the voice comes out of the ear/headphones only, when they are connected?


Thank you, x

:)



Dave Smart

unread,
Oct 14, 2015, 6:36:23 AM10/14/15
to AndroidScript
Hi Chris,

As far as I know, we have not made any changes to the TextToSpeech functionality... are you sure that something else is not causing the problem?

Have you updated your Android version recently or something?

Steve Garman

unread,
Oct 14, 2015, 6:43:16 AM10/14/15
to AndroidScript
I remember Google Text To Speech updating itself on my phone recently.

I see from Google Play that the latest version is dated 22nd September but I am pretty sure it was installed more recently than that.

Is it possible that update had an effect?

John TZ

unread,
Oct 20, 2015, 10:33:53 AM10/20/15
to AndroidScript
Hi there,

Sorry to tell but I'm pretty sure this problem comes from the new version because I've downgraded my DS version via "pm install -r -d ds.apk" and the TTS sound comes back into the headset only again. 

Chris Larcombe

unread,
Oct 20, 2015, 5:29:21 PM10/20/15
to AndroidScript
Hi there,

The behaviour of my application changed when I upgraded Droidscript. Nothing else changed. I have not yet updated Google text to speech.

Is voice coming out of speaker when earphones are connected for you?

Thanks, Chris x

Message has been deleted

Chris Larcombe

unread,
Oct 20, 2015, 5:33:31 PM10/20/15
to AndroidScript
I think you did change the tts code in that version or perhaps the previous version, because the callback for 'on speech end' was not working until after I updated DS. (Before the update I did, the callback was not in the code, I think)

John TZ

unread,
Oct 20, 2015, 8:38:09 PM10/20/15
to AndroidScript
Hi there,

Yes Chris, I've got the voice coming out from my speaker when earphones are connected in the new version. Besides, OnSpeechEnd sounds like an excellent callback! I've had a hard time manually delaying(string.length*300milliseconds) speech and still always missing words or delaying too much time!This is so touching!

Chris Larcombe

unread,
Oct 21, 2015, 4:00:19 PM10/21/15
to AndroidScript
Yes, the callback is great. I'm very grateful for that new feature!

Is there any way to get the voice to come out of the headphones/earphones again like it was before? Today when I connected an external speaker via the minijack (headphone socket) it came out of phone speaker and not the external speaker. Strange!

Chris Larcombe

unread,
Oct 23, 2015, 7:21:02 AM10/23/15
to AndroidScript
Main issue is when I connect an external speaker (via headphone socket) to the phone, the text-to-speech voice is not coming out of the speaker properly (it seems to be coming out of the speaker very quietly, whilst also coming out of the phone speaker). This definitely was not the case in older version of Droidscript.


Thank you :)

Chris.

Dave Smart

unread,
Nov 26, 2015, 4:07:43 AM11/26/15
to DroidScript
Hi Guys,

I'm not sure why this has changed (possibly due to a change in the DS target SDK) but I have now made the app.TextToSpeach() method default to the 'System' audio stream. In my tests, the sound only comes out of the headphones when set to this mode.  

I have also added an extra parameter to the above method, so that you can specify any of the following audio streams:-

alarm, dtmf, music, notification, ring, system, voicecall

Note: You can also use the app.SetVolume(stream,level) method to set stream volumes

(New private beta to be released in the next few days)

Regards
David

richard.t...@gmail.com

unread,
Dec 14, 2015, 9:38:18 AM12/14/15
to DroidScript
Can you give me an example on how to use the method to set up the default audio stream.

I try app.TextToSpeech("what ever text,pitch,speed,"music");

It didn't work. Is that the right way of doing it?
Thanks!

Steve Garman

unread,
Dec 14, 2015, 9:46:04 AM12/14/15
to DroidScript
This option is still in private beta.

Hopefully, it will be publicly available very soon.

richard.t...@gmail.com

unread,
Dec 15, 2015, 7:55:16 AM12/15/15
to DroidScript
Okay, thanks

Steve Garman

unread,
Dec 15, 2015, 8:20:29 AM12/15/15
to DroidScript
In the new version being made available today,
app.TextToSpeech("Hello world",1,1,null,"system")
should do the same as
app.TextToSpeech("Hello world")
and should have fixed the problem.

app.TextToSpeech("Hello world",1,1,onFinished,"music")
will play the voice through the music stream and call the callback
function onFinished()
when the voice has finished speaking.

Chris Larcombe

unread,
Dec 16, 2015, 11:45:59 AM12/16/15
to DroidScript
Just downloaded latest version and it's working perfectly now! Thank youuu!!! I really appreciate you fixing this, thank you.  :)
Reply all
Reply to author
Forward
0 new messages