Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text To Speech
#1
I'm using the latest Microsoft v11 driver and voice. 


I am using the httptrigger to send a parameter like this: 

"http://my.dns:11002/httpspeech?P1=Hello World"

My action is 
Devices::FieldWrite
    P1=TextToSpeech.SayText
    P2=%(LVar:CQCActParm_2)
    P3=True

The voice response is "Hello percent twenty world"

Seems like spaces in a url are converted to %20. Is there a CQC function that would strip out %20 and replace it with space?

Thanks, Richard
My Other web server is Dropbox.
Reply
#2
Actually probably the trigger driver should unescape the parameters itself, since there can be more than that. I'll do that for the next drop.

In the meantime, if you just want to get around that, use the ReplaceSubStr command on the variables target. So put the value into a local variable, then do:

LocalVars::ReplaceSubStr(LVar:CQCActParm_2, %20, , False)

That should update that variable appropriately. Keeping in mind of course that you have now altered the original incoming parameter. I don't think there's any issue with that, and it shoudln't matter here. But, to be really safe and in case you ever needed to get back to the original, I'd probably copy it first to a local of your own.

LocalVars::SetVariable(LVar:Temp, %(LVar:CQCActParm_2)
LocalVars::ReplaceSubStr(LVar:Temp, %20, , False)

Something like that. Then use %(LVar:Temp) in the TTS command.
Dean Roddey
Software Geek Extraordinaire
Reply
#3
Actually, maybe it's no a good idea for me to unescape them, since then that would become two separate parameters. I need to address this in a better way, maybe by being able to quote parameters so as to get around this, and have the underlying code know to watch for this and strip off the quotes. But I don't have time to do that right right now. So I'll just put it on the list to look at. In the meantime, the above will get you going.
Dean Roddey
Software Geek Extraordinaire
Reply
#4
That's what I was looking for. Don't think you need to address this any further.

Thanks, Richard
My Other web server is Dropbox.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Embedded Variable in Text zra 2 139 05-07-2018, 09:59 AM
Last Post: zra
  Test to Speech TTS - No voice available NightLight 1 324 12-02-2017, 08:49 PM
Last Post: NightLight
  Field Boolean Text Widget issue greymatter 5 1,370 08-26-2017, 04:45 PM
Last Post: greymatter
  Pop Up Text Transparent sic0048 10 1,606 08-18-2017, 01:45 PM
Last Post: Dean Roddey
  Text Entry pjgregory 5 1,539 03-15-2017, 08:35 AM
Last Post: Dean Roddey
  Concatenated field text widgets? dlmorgan999 6 1,746 03-09-2017, 02:54 PM
Last Post: dlmorgan999
  Field Check Box Text on 2 Lines Shaky 6 2,266 02-25-2017, 10:05 PM
Last Post: Shaky
  Text to Speech changes as of 5.0.9 and beyond Dean Roddey 0 971 01-12-2017, 06:28 PM
Last Post: Dean Roddey
  Finding Text in a Template potts.mike 3 1,143 12-07-2016, 06:32 PM
Last Post: Dean Roddey
  Echo is passing numbers as text so it cant be written to a field - any fix? ghurty 9 1,681 07-03-2016, 08:05 AM
Last Post: ghurty

Forum Jump:


Users browsing this thread: 1 Guest(s)