It is currently May 6th, 2024, 6:39 pm

JSMSpeak character limit?

Get help with creating, editing & fixing problems with skins
edjec
Posts: 5
Joined: November 24th, 2010, 3:32 am

JSMSpeak character limit?

Post by edjec »

I'm trying to develop a random quote generator using an external quote text file, but JSMSpeak will not verbalize anything over 30 characters. I checked the JSMSpeak.au3 file, but can't see any reference to character length. Is this a hard limit of JSMSpeak?

TIA
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: JSMSpeak character limit?

Post by jsmorley »

edjec wrote:I'm trying to develop a random quote generator using an external quote text file, but JSMSpeak will not verbalize anything over 30 characters. I checked the JSMSpeak.au3 file, but can't see any reference to character length. Is this a hard limit of JSMSpeak?

TIA
It's not JSMSpeak, it's Google Translate, and I think the limit is like 100 chars.
edjec
Posts: 5
Joined: November 24th, 2010, 3:32 am

Re: JSMSpeak character limit?

Post by edjec »

Thanks for getting back to me so quickly.

I had originally suspected that as well, so I went to Google translate and put the quotes in and it worked just fine. So, is there some handler between Google and JSMSpeak that would be intercepting the string?

On second thought, this can't be the problem either because Rainmeter About displays the quote string in it's entirety on every update.

I have even put the longer quotes into your routine:

Code: Select all

 !Execute ["#ADDONSPATH#JSMeterIIISpeak\JSMSpeak.exe" "#MyQuote#" "#Language#"]
and it would not function with strings longer than 30 characters. When I cut it back to 30 or shorter, it worked just fine.

I'm stumped.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: JSMSpeak character limit?

Post by jsmorley »

I don't know. I have my clock say the time and weather on the hour, and it is certainly more than 30 chars.

Here is the AutoIt code in its entirety.

If $CmdLine[0] > 0 Then
$Url = "http://translate.google.com/translate_tts?q=" & $CmdLine[1]
InetGet($Url, @ScriptDir & "\JSMSpeak.mp3", 1)
SoundPlay(@ScriptDir & "\JSMSpeak.mp3",1)
Sleep(1000)
SoundPlay("")
FileDelete(@ScriptDir & "JSMSpeak.mp3")
EndIf

Sure there isn't some weird character or something at position 30 in your string that is making Google Translate angry?
edjec
Posts: 5
Joined: November 24th, 2010, 3:32 am

Re: JSMSpeak character limit?

Post by edjec »

No, nothing other than normal ASCI characters. Here is the nonsense that's in the quote.inc file:

Code: Select all

Don't you have anything else to do? \n You really need to get a life. \n Chuck Norris can strangle you with a cordless phone. \n I think WalMart has bowling balls on sale today. \n Did I just hear the mailman? \n This is the messiest office I've ever seen. \n It's eleven o'clock, did you let the cat out? \n Never take life seriously. Nobody gets out alive anyway. \n Chuck Norris counted to infinity - twice. \n When I die, I want to go peacefully like my Grandfather did, in his sleep.  Not screaming, like the passengers in his car. \n Why does Sea World have a seafood restaurant? \n Chuck Norris is the reason why Waldo is hiding. 
As I said, I have taken a single quote from this file that is longer than 30 chrs. and put it into a variable and then directly into the code line on my previous post and it would not play. When shortened to under 30 chrs. it played fine. By doing this I think I eliminated any possibility that I was introducing an error through faulty code.

Here is an executable .ini file to test:

Code: Select all

[Variables]  ;::::::::::::::::::::::::::::::::::::::: Edit in UserVariables.inc 
MyQuote1="When I die, I want to go peacefully like my Grandfather did, in his sleep. Not screaming, like the passengers in his car. "
MyQuote2="When I die, I want to go peace"
Language="en"
Morning="Good Morning"
Afternoon="Good Afternoon"
Evening="Good Evening"
TimeSpeak="[MeasurePartOfDay]. [MeasureSpeakTime], and all is well.  It is [MeasureNowWeatherTemp] degrees under [MeasureNowWeatherConditions] skies."
[MeasureTime]  ;::::::::::::::::::::::::::::::::::::: Measures
Measure=Time

[Measure24Hour]  ;::::::::::::::::::::::::::::::::::: Begin Speach Measures
Measure=Time
Format=%#H

[MeasureSpeakTime]
Measure=Time
Format=%#I:%M

[MeasureMinutes]
Measure=Time
Format=%#M

[MeasureSpeakHour]
Measure=Time
Format=%#I

[MeasureYahooWeather]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1200
URL=http://weather.yahooapis.com/forecastrss?w=#Location#&u=#Unit#
RegExp="(?siU)<title>.*- (.*)</title>.*<link>(.*)/\*(.*)</link>.*<description>(.*)</description>.*<language>(.*)</language>.*<lastBuildDate>(.*)</lastBuildDate>.*<yweather:location city="(.*)".*region="(.*)".*country="(.*)".*<yweather:units temperature="(.*)".*distance="(.*)".* pressure="(.*)".*speed="(.*)".*<yweather:wind chill="(.*)".*direction="(.*)".*speed="(.*)".*<yweather:atmosphere humidity="(.*)".* visibility="(.*)".*pressure="(.*)".* rising="(.*)".*<yweather:astronomy sunrise="(.*)".*sunset="(.*)".*<title>(.*)</title>.*<width>(.*)</width>.*<height>(.*)</height>.*<link>(.*)</link>.*<url>(.*)</url>.*<title>(.*)</title>.*<geo:lat>(.*)</geo:lat>.*<geo:long>(.*)</geo:long>.*<link>(.*)/\*(.*)</link>.*<pubDate>(.*)</pubDate>.*<yweather:condition  text="(.*)".*code="(.*)".*temp="(.*)".*date="(.*)".*<img src="(.*)".*Current Conditions:</b><br />(.*)<BR />.*Forecast:</b><BR />(.*)<br />.*(.*)<br />.*<a href="(.*)/\*(.*)">.*provided by <a href="(.*)" >(.*)</a>.*<yweather:forecast day="(.*)".*date="(.*)".*low="(.*)".*high="(.*)".*text="(.*)".*code="(.*)".*<yweather:forecast day="(.*)".*date="(.*)".*low="(.*)".*high="(.*)".*text="(.*)".*code="(.*)".*"

[MeasureNowWeatherConditions]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureYahooWeather]
StringIndex=34

[MeasureNowWeatherTemp]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureYahooWeather]
StringIndex=36
Substitute="-":"minus "
[MeasureFirstRun]
Measure=Calc
Formula=1

[MeasurePartOfDay]  
Measure=CALC
Formula=Measure24Hour<12 ? 1 : (Measure24Hour<17 ? 2 : 3)
Substitute="1":"#Morning#","2":"#Afternoon#","3":"#Evening#"
[MeterTime]  ;::::::::::::::::::::::::::::::::::::::: Time/Weather Speech
Meter=ROUNDLINE
MeasureName=MeasureTime
X=10
Y=10
W=40
H=40
LineWidth=#LineWidth#
StartAngle=4.7123889
RotationAngle=6.2831853
LineLength=20
LineStart=0
AntiAlias=1
LineColor=255,255,255,255
Solid=1
LeftMouseUpAction=!Execute ["#ADDONSPATH#JSMeterIIISpeak\JSMSpeak.exe" "#MyQuote2#" "#Language#"]
I'm sure you recognize the above code. When #TimeSpeak# is substituted for #MyQuote2# it works as you intended. The same is true with MyQoute2. But, change that to MyQuote1 and it breaks. Even using strings without punctuation longer than 30 chrs. yield the same result.

I must be missing something simple here.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: JSMSpeak character limit?

Post by jsmorley »

If I use my browser and put:

http://translate.google.com/translate_tts?q="123456789012345678901234567890123456789012345678901234567890"

Which is 50 chars, it returns the .mp3 just fine.

If I put:

http://translate.google.com/translate_tts?q="When I die, I want to go peacefully like my Grandfather did, in his sleep."

That works, and is 74 chars.

http://translate.google.com/translate_tts?q="When I die, I want to go peacefully like my Grandfather did, in his sleep. Not screaming, like the passengers in his car."

Fails, as it is 122 chars (actually probably 124, as I think the quotes count.)

As I said, I think the limit is 100 chars.
edjec
Posts: 5
Joined: November 24th, 2010, 3:32 am

Re: JSMSpeak character limit?

Post by edjec »

I'm not sure what is happening here. When I sent the last post it would not work on any string longer than 30 chrs. I've been playing with this issue for the past two days before I decided to post it here.

At one time I had the quote "When I die, I want to go peacefully" which is 35 chrs. and it would not play. Shortening one chr. at a time until I reached "peace" and then it played.

Now after this last post, it works on longer strings until I exceed the Google limit as you said. So either you did some voodoo over the internet or I have a mouse living in my computer.

Well, don't I look like a fool? Sorry to bother you, but thank you very much for taking the time to investigate this issue.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: JSMSpeak character limit?

Post by jsmorley »

edjec wrote:I'm not sure what is happening here. When I sent the last post it would not work on any string longer than 30 chrs. I've been playing with this issue for the past two days before I decided to post it here.

At one time I had the quote "When I die, I want to go peacefully" which is 35 chrs. and it would not play. Shortening one chr. at a time until I reached "peace" and then it played.

Now after this last post, it works on longer strings until I exceed the Google limit as you said. So either you did some voodoo over the internet or I have a mouse living in my computer.

Well, don't I look like a fool? Sorry to bother you, but thank you very much for taking the time to investigate this issue.
Hard to say. That really is strange...