Speak command not working with large block of text


#1

I’m currently using the built in severe weather functions to try and create a severe weather voice alert through my google home speakers. The majority of the code is functioning as designed, and typically 2 of the 3 speak commands are working as intended. The problem comes when it’s supposed to read the full weather announcement. It shows successful execution, but I’m not even getting the preliminary “bloop” that occurs before it’s about to broadcast the speech.

Using webcore in combination with cast-web-api for tts for google home


#2

Currently the variables are set as the following.

This is an example of the size of text block I’m working with. I can’t find any documentation on either the webcore “speak” function as to a max text length, or with the cast-web-api. So I’m not sure where the problem is actually laying.


#3

I don’t see where message is getting set in your code so it might have been blank when it ran through. Can’t tell.


#4

The $weather.alerts.alerts.type and $weather.alerts.alerts.description are built in variables as part of the webcore weather underground api. So I’m using those values to set to a local variable before sending them out to the speak action.

You can see in my second screen shot what actual data coming from those variables looks like.

When it comes time for the piston to actually fire, the “This is a special weather alert” and the {description} text come through just fine. It’s the {message} value that doesn’t. As I have tried in previous iterations to do some formatting on the text in the {message} to remove things like ellipses (…) and the brackets, and this doesn’t help fix the issue, I can only assume that it has something to do with the length of the data being parsed for TTS. Only I can’t find ANY reference material for either WebCORE or cast-web-api to tell me whether or not there is such a limit. At which point, I’d need to figure out a smart way to break that message up into chunks to be read as pieces.


#5

In the Echo Speaks thread (ST Forum), I believe it was about 400 character limit… @tonesto7 built in process to trim the large block of text to manageable pieces. I’m not sure if it can be done within castweb or you’ll have to do some text-block manipulation of your own.


#6

Thanks @eibyer. I’m working on running it through a while loop to trim it into chunks and break it up (not the best for speech, but if it works…)

And @guxdude, I think I realized what you were talking about. I must have trimmed that bit of code while I was working on it today. It would have been with the other set variables above the with block. I’ll update my code here shortly and let you both know if it works or not.