@geko
I’m using VLCThing 1.2.2. It’s mostly working for speech but often doesn’t return speech and instead throws an error at the point where it calls def sound = textToSpeech(text, true)
in myTextToSpeech()
. This really looks like an inconsistent platform issue with calling SmartThings textToSpeech()
function. What’s odd, is some phrases work and some do not and eventually phrases that didn’t work will suddenly work but may not later again.
I added some additional logging in the Device Type to verify this is the exact point where the issue is occuring:
private def myTextToSpeech(text) {
LOG("Executing: textToSpeech(${text},true)")
def sound = textToSpeech(text, true)
LOG("Executing: sound.uri")
sound.uri = sound.uri.replace('https:', 'http:')
LOG("returning sound")
return sound
}
Here is my log result:
11:34:45 AM: error java.lang.reflect.UndeclaredThrowableException @ line 571
11:34:44 AM: trace Executing: textToSpeech(Warning, Warning: Laundry Outside Door is now closed,true)
11:34:44 AM: trace playTextAndResume(Warning, Warning: Laundry Outside Door is now closed, 95)
Line 571 in my code (with the extra logging) is def sound = textToSpeech(text, true)
which is line 570 in your code.
So you see it bombs and halts execution when calling textToSpeech(text, true)
and never progresses further to sound.uri = sound.uri.replace('https:', 'http:')
or return sound
.
For what it’s worth, below is a log of when this same phrase worked during a later attempt:
11:59:48 AM: trace Skipping event generation for sound file http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3
11:59:48 AM: trace Track info: [filename:http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3])
11:59:48 AM: trace parseHttpResponse([position:0, information:[category:[meta:[filename:http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3]], chapters:[], titles:[]], stats:[averagedemuxbitrate:0, playedabuffers:0, demuxreadpackets:0, lostabuffers:0, displayedpictures:0, averageinputbitrate:0, decodedaudio:0, demuxdiscontinuity:0, lostpictures:0, sentpackets:0, inputbitrate:0, decodedvideo:0, demuxreadbytes:0, sentbytes:0, sendbitrate:0, readpackets:0, demuxbitrate:0, readbytes:0, demuxcorrupted:0], videoeffects:[brightness:1, contrast:1, gamma:1, saturation:1, hue:0], random:false, state:playing, repeat:false, subtitledelay:0, equalizer:[], apiversion:3, version:2.0.3 Twoflower, fullscreen:0, time:0, rate:1, loop:false, audiodelay:0, volume:256, length:0, audiofilters:[filter_0:]])
11:59:47 AM: trace Skipping event generation for sound file http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3
11:59:47 AM: trace Track info: [filename:http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3])
11:59:47 AM: trace parseHttpResponse([position:0, information:[category:[meta:[filename:http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3]], chapters:[], titles:[]], stats:[averagedemuxbitrate:0, playedabuffers:0, demuxreadpackets:0, lostabuffers:0, displayedpictures:0, averageinputbitrate:0, decodedaudio:0, demuxdiscontinuity:0, lostpictures:0, sentpackets:0, inputbitrate:0, decodedvideo:0, demuxreadbytes:0, sentbytes:0, sendbitrate:0, readpackets:0, demuxbitrate:0, readbytes:0, demuxcorrupted:0], videoeffects:[brightness:1, contrast:1, gamma:1, saturation:1, hue:0], random:false, state:playing, repeat:false, subtitledelay:0, equalizer:[], apiversion:3, version:2.0.3 Twoflower, fullscreen:0, time:0, rate:1, loop:false, audiodelay:0, volume:256, length:0, audiofilters:[filter_0:]])
11:59:47 AM: trace Skipping event generation for sound file http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3
11:59:47 AM: trace Track info: [filename:http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3])
11:59:47 AM: trace parseHttpResponse([position:0, information:[category:[meta:[filename:http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3]], chapters:[], titles:[]], stats:[averagedemuxbitrate:0, playedabuffers:0, demuxreadpackets:0, lostabuffers:0, displayedpictures:0, averageinputbitrate:0, decodedaudio:0, demuxdiscontinuity:0, lostpictures:0, sentpackets:0, inputbitrate:0, decodedvideo:0, demuxreadbytes:0, sentbytes:0, sendbitrate:0, readpackets:0, demuxbitrate:0, readbytes:0, demuxcorrupted:0], videoeffects:[brightness:1, contrast:1, gamma:1, saturation:1, hue:0], random:false, state:playing, repeat:false, subtitledelay:0, equalizer:[], apiversion:3, version:2.0.3 Twoflower, fullscreen:0, time:0, rate:1, loop:false, audiodelay:0, volume:486, length:0, audiofilters:[filter_0:]])
11:59:47 AM: trace vlcGet(/requests/status.json?command=volume&val=256)
11:59:47 AM: trace vlcCommand(command=volume&val=256)
11:59:47 AM: trace setLevel(50)
11:59:47 AM: trace vlcGet(/requests/status.json?command=volume&val=256)
11:59:47 AM: trace vlcCommand(command=volume&val=256)
11:59:47 AM: trace setLevel(50)
11:59:47 AM: trace vlcGet(/requests/status.json)
11:59:47 AM: trace delayHubAction(500)
11:59:47 AM: trace vlcGet(/requests/status.json?command=in_play&input=http%3A%2F%2Fs3.amazonaws.com%2Fsmartapp-media%2Ftts%2F5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3)
11:59:47 AM: trace vlcCommand(command=in_play&input=http%3A%2F%2Fs3.amazonaws.com%2Fsmartapp-media%2Ftts%2F5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3)
11:59:47 AM: trace playTrack(http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3)
11:59:47 AM: trace returning sound
11:59:47 AM: trace Executing: sound.uri
11:59:46 AM: trace Executing: textToSpeech(Warning, Warning: Laundry Outside Door is now open,true)
11:59:46 AM: trace playText(Warning, Warning: Laundry Outside Door is now open)
11:59:47 AM: trace parseHttpResponse([position:0, videoeffects:[brightness:1, contrast:1, gamma:1, saturation:1, hue:0], random:false, state:stopped, repeat:false, subtitledelay:0, equalizer:[], apiversion:3, version:2.0.3 Twoflower, fullscreen:0, time:0, rate:1, length:0, volume:486, audiodelay:0, loop:false])
11:59:47 AM: trace vlcGet(/requests/status.json)
11:59:47 AM: trace delayHubAction(500)
11:59:47 AM: trace vlcGet(/requests/status.json?command=in_play&input=http%3A%2F%2Fs3.amazonaws.com%2Fsmartapp-media%2Ftts%2F5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3)
11:59:47 AM: trace vlcCommand(command=in_play&input=http%3A%2F%2Fs3.amazonaws.com%2Fsmartapp-media%2Ftts%2F5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3)
11:59:47 AM: trace playTrack(http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3)
11:59:47 AM: trace returning sound
11:59:47 AM: trace Executing: sound.uri
11:59:46 AM: trace Executing: textToSpeech(Warning, Warning: Laundry Outside Door is now open,true)
11:59:46 AM: trace playText(Warning, Warning: Laundry Outside Door is now open)
11:59:46 AM: trace vlcGet(/requests/status.json?command=volume&val=486)
11:59:46 AM: trace vlcCommand(command=volume&val=486)
11:59:46 AM: trace setLevel(95)
11:59:46 AM: trace vlcGet(/requests/status.json?command=volume&val=486)
11:59:46 AM: trace vlcCommand(command=volume&val=486)
11:59:46 AM: trace setLevel(95)