VoiceGuide IVR Software Main Page
Jump to content

Vbs Changing

Recommended Posts

Hi,

 

I'm not working with VBS so I have a problem with changing GetMarketLevels script.

 

Can You help me to disabling part witch "removed everything except digits"?

 

I changed GetMarketLevels to read my data but can't disabling this element.

 

I try to get data witch include text and digits.

Share this post


Link to post

Are you referring to the sample "Internet Portal.vgs" VoiceGuide script that is installed in VoiceGuide's \Scripts\Internet Portal\ subdirectory?

 

That script has a module titled "GetMarketLevels" in it.

 

If you want to disable the "now remove everything except the digits" in that module change:

 

 

  'now remove everything except the digits.
 for i = 1 to len(strAfterLabel)
   ch = mid(strAfterLabel, i, 1)
   if ch >= "0" and ch <= "9" then
     GetIntegerAfterLabel = GetIntegerAfterLabel & ch
   end if
 next

 

to:

 

 GetIntegerAfterLabel = strAfterLabel

Share this post


Link to post

I try to get following text:

"Przesyłka ju pi es o numerze 1ZY5928R6895267281 posiada status doręczono"

 

I changed function to:

"

'now remove everything except the digits.

for i = 1 to len(strAfterLabel)

ch = mid(strAfterLabel, i, 1)

if ch >= " " and ch <= "˙" then

GetIntegerAfterLabel = GetIntegerAfterLabel & ch

end if

next

"

 

but

in this case vbs ignoring polish (Poland) characters and

log shows:

 

ResultReturn é [[wartosc0]{Przesyka ju pi es o numerze 1ZY5928R6895267281 posiada status dorono}] [[wartosc0]{Przesyka ju pi es o numerze 1ZY5928R6895267281 posiada status dorono}] 81 81

 

 

how to fix it?

Share this post


Link to post

So sounds like you are not seeing the special language characters that you are expecting to see, correct?

 

So it looks like you are extracting this sentence from data retrieved from some web page or web service?

 

Can you describe in more detail form where you are retrieving this data? We can then have a closer look and see whether the characters are likely to get stripped during transfer, or during data manipulation within the VBScript, or within VoiceGuide.

 

As a test can you save the data retrieved from web service into a file on disk (do this all in VBScript) and see if the file that you saved is viewed using your viewer are the special characters still visible.

 

Also, why are you retrieving text? Do you you need it for TTS afterwards?

As a workaround instead of using TTS can you just per-record the text as sound files and use the "Say number" module to speak back this information by concatenating the per-recorded prompts instead of trying to use TTS?

Share this post


Link to post

Yes, I want to get text data from web page and read it using TTS. But VBS skip special characters so eliminating possibility to get any kind of data to read.

 

Of course I can to set typical prompts to create answer to play, but I want to create tool to solve more tasks than individual for each case.

 

I was created whole VG script, only VBS is our weak point.

 

Solving this problem is important to buy next VG licenses to our IVR system.

Share this post


Link to post

As a test can you save the data retrieved from web service into a file on disk (do this all in VBScript) and see if the file that you saved is viewed using your viewer are the special characters still visible?

Share this post


Link to post

How to save the data to a file in VBScript?

Here is an exmaple snippet:

Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\yourtextfile.txt", ForWriting)
objFile.Write "my text"
objFile.Close
Set objFile = Nothing
Set objFSO = Nothing

Also, which TTS engine are you using?

Share this post


Link to post

I achieved next level.

 

I see now

 

Przesy?ka ju pi es o numerze 1ZY5928R6895267281 posiada status dor?czono

 

I coded page in utf8 but still VG don't recognize polish characters.

 

I tested script in windows and see right whole text

 

Przesyłka ju pi es o numerze 1ZY5928R6895267281 posiada status doręczono

 

it shows differences between VG interpretation.

Share this post


Link to post
I see now

You see this in vgEngine log files entry for the data received as parameter in the using the ResultReturn function call, or somewhere else?

 

I coded page in utf8

Are you referring to the Web page?

Can you post the HTML returned by web page? (.ZIped)

 

I tested script in windows and see right whole text

Can you post the VBScript script that you are using? (ZIP it up first)

Share this post


Link to post

I see now whole text with replaced characters ('?' in places of polish characters).

 

I attached php file and two scripts (desktop and VG version).

index.zip

VBS.zip

Share this post


Link to post

Hi,

 

When can I expect a solution?

 

My clients are waiting for this functionality.

 

M.

Share this post


Link to post

Right now the COM interface transfers all strings as ANSI, which means that the non-standard-ANSI characteres would be converted to their ANSI equivalent.

So even if the string supplied in call to Run_ResultReturn is Unicode, by the time VoiceGuide receives it it will be ANSI.

It is possible to have the VBScript save the string in a Unicode type text file, or a UTF-8 type text file. See sample code below.

As a temporary workaroud are you abe to call your TTS with Unicode file or UTF-8 file as input in order to generate the sound file?

Which TTS engine are you using on your system?

We will also look into setting up a COM interface that accpts Unicode strings - will advise in next couple of days on this.



Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
Const TriStateTrue = -1


if 1 then
'preferred approach is:
'connect and retrieve data by using XMLHTTP object

Set objXMLHTTP = CreateObject("microsoft.XMLHTTP")
objXMLHTTP.Open "GET", "[link removed]", False
'objXMLHTTP.overrideMimeType('text/html; charset=UTF8');
objXMLHTTP.Send
If objXMLHTTP.Status <> 200 Then
readWwwText = ""
else
readWwwText = objXMLHTTP.responseText

Set objXMLHTTP = Nothing
end if

else
'another approach is:
'connect and retrieve data by starting up another instance of InternetExplorer

Set IE = CreateObject("InternetExplorer.Application")
With IE
.RegisterAsDropTarget = False
.Visible = False
.Silent = True
.Navigate("[old link removed]")
While .Busy
WScript.Sleep 100
Wend
With .Document.Body
readWwwHtml = .InnerHTML
readWwwText = .InnerText
End With
End With
IE.Quit
Set IE = Nothing

end if

iwart0 = GetIntegerAfterLabel("<span id=""stan0"">")

'UTF-8
Dim oStream
Set oStream = CreateObject("ADODB.Stream")
With oStream
.Open
.CharSet = "utf-8"
.WriteText iwart0
.SaveToFile "C:\vbsout_adodbstream_utf8.txt", 2
End With
Set oStream = Nothing

'Unicode
set fso = CreateObject("Scripting.FileSystemObject")
set tsFile = fso.OpenTextFile("C:\vbsout_fso_unicode.txt", ForWriting, True, TriStateTrue)
tsFile.WriteLine iwart0
tsFile.Close
set tsFile = Nothing
set fso = Nothing

'ANSI
set fso = CreateObject("Scripting.FileSystemObject")
set tsFile = fso.OpenTextFile("C:\vbsout_fso_ansi.txt", ForWriting, True)
tsFile.WriteLine iwart0
tsFile.Close
set tsFile = Nothing
set fso = Nothing

Share this post


Link to post

I need to store text as variable in script to work with.

 

I don't use TTS direct in VG but as application to generate wav file.

 

I'm using IVO TTS (polish super product supported many languages).

Share this post


Link to post
I need to store text as variable in script to work with.

Can you advise what work would need to be done the the text? Do you need to prepend/append more text to it before doing TTS, or something else?

Can you post the script which shows what you are doing with the text?

 

I don't use TTS direct in VG but as application to generate wav file.

So you call a .exe/.com/etc from VG and pass to it as parameter the text of TTS that needs to be spoken?

Share this post


Link to post

It's not important what I do with text.

VG is working properly except getting data with vbs with using UTF-8 coding.

 

I'm using VG.com module to generate prompt with TTS engine.

 

It's important to me to get data from web (php, xml) to expand VG IVR application and reach new clients.

Share this post


Link to post

Please update your system to this version of VoiceGuide:

[old link removed]

This version handles accepts Unicode strings when the vgServices COM interface functions are called.

Please post VoiceGuide traces (.ZIped) that capture the entire call if you still have any issues that need resolved.

Share this post


Link to post

Hi,

 

I installed newer version of VG.

 

Every logs (vbsout_fso_unicode.txt, vbsout_fso_ansi.txt,vbsout_adodbstream_utf8.txt) shows right strings: "Przesyłka firmy kurierskiej ju pi es o numerze 1ZY5928R6895267281 posiada status doręczono"

 

But VG log:

 

143529.168 16 2 1 rem Run_ResultReturn é [[wartosc0]{Przesyłka firmy kurierskiej ju pi es o numerze 1ZY5928R6895267281 posiada status doręczono}] [[wartosc0]{Przesy?ka firmy kurierskiej ju pi es o numerze 1ZY5928R6895267281 posiada status dor?czono}] 103 103

143529.168 16 2 1 qScr add cmdRun_ResultReturn 0

143529.168 6 2 1 qScr run cmdRun_ResultReturn sCode=[] iActionID=0, crn=0[0|0|0|0|0][[wartosc0]{Przesy?ka firmy kurierskiej ju pi es o numerze 1ZY5928R6895267281 posiada status dor?czono}|||||]

143529.168 6 d added wartosc0 | Przesy?ka firmy kurierskiej ju pi es o numerze 1ZY5928R6895267281 posiada status dor?czono | ( 77 61 72 74 6f 73 63 30 | 50 72 7a 65 73 79 ef bf bd 6b 61 20 66 69 72 6d 79 20 6b 75 72 69 65 72 73 6b 69 65 6a 20 6a 75 20 70 69 20 65 73 20 6f 20 6e 75 6d 65 72 7a 65 20 31 5a 59 35 39 32 38 52 36 38 39 35 32 36 37 32 38 31 20 70 6f 73 69 61 64 61 20 73 74 61 74 75 73 20 20 64 6f 72 ef bf bd 63 7a 6f 6e 6f | 38) id=2

143529.168 6 2 1 FindNextVgmTitleInPathList: next module title is=[Evaluate 8]

143529.168 6 2 1 module's runwait=1, WavPlayHasNowFinished=0, iRunWait_ExeResult_NextVgm=215

143529.168 6 2 1 qTel add cmd_PlayStop [0,0,0,0,0][||||]

143529.168 7 2 1 qTel run cmd_PlayStop

143529.168 6 2 1 play PlaySoundStop ok

143529.168 6 2 1 t timer clear (force=False)

143529.168 6 2 1 RunModule start Evaluate, [Evaluate 8], iModuleIdx=215, previous: vgm=208, vgs=4:4

143529.168 6 2 1 state [Evaluate 8] Evaluate ["$RV[wartosc0]"]

143529.168 6 2 1 rv replace start ["$RV[wartosc0]"]

143529.168 6 2 1 rv replace end ["Przesy?ka firmy kurierskiej ju pi es o numerze 1ZY5928R6895267281 posiada status dor?czono"]

143529.168 6 2 1 eval[Cstr("Przesy?ka firmy kurierskiej ju pi es o numerze 1ZY5928R6895267281 posiada status dor?czono")]

 

 

 

So we are on right way to solve the problem ...

Share this post


Link to post

The vgEngine log is by default saved in ASCII format, so any Unicode characters would be replaced by a "?".

 

To have vgEngine log created in Unicode by default please add this to VG.INI's [Log] section:

 

Encoding=Unicode

Share this post


Link to post

Hi,

 

now VBS is working properly in VG.

 

Both way: direct as variable and as txt file is ready to use with TTS engine.

 

Thanks a lot! It opening new areas and targets in IVR solutions!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×