Carphone Report post Posted 03/09/2004 01:07 AM I have been having great difficulty in understanding why my alteration of the vbs code in lib_num2wav is not working correctly. Basically i am trying to get the voice guide say number module to speak additional characters. e.g i want a string of the following format to be spoken #pd+777-4 the original code i am altering is '###### 'name : Digits 'info : Say the digits in the number 'arg1 : Digits to be spoken : '###### Function Digits(byval arg1) 'returns a list of comma delimited wav files, 'with each wav file corresponding to a character 'in the supplied input string. sDigits=Trim(arg1) For i=1 To Len(sDigits) sDigit = Mid(sDigits, i, 1) If sDigit = "-" Then sWav = "minus.wav" Else sWav = sDigit & ".wav" end If If sOut = "" Then sOut = sWav else sOut = sOut & "," & sWav End if Next Digits = sOut End Function now the above code already has a minus character in place. so i have been experimenting with this. I changed the "-" to a "+" and "minus.wav" to "plus.wav". I have recorded the plus.wav sound file and placed it in the correct directory. But the script does not recognise the + unless i remove: sDigits=Trim(arg1) line of code. When i remove this line the + is played a correctly. The consequence of removing this line though is that the say say number module will no longer speak any numbers (only my plus). How should i code this section so that my characters and digits are spoken? The code i came up with below does not work: Function Digits(byval arg1) 'returns a list of comma delimited wav files, 'with each wav file corresponding to a character 'in the supplied input string. sDigits=Trim(arg1) For i=1 To Len(sDigits) sDigit = Mid(sDigits, i, 1) swav = sdigit & ".wav" If sdigit = "-" Then swav = "minus.wav" end If If sdigit = "#" Then swav = "hash.wav" end If If sdigit = "p" Then swav = "p.wav" End If If sdigit = "w" Then swav = "w.wav" end If If sdigit = "+" Then swav = "plus.wav" end If If sOut = "" Then sOut = sWav else sOut = sOut & "," & sWav End if Next Digits = sOut End Function I am familiar with visual basic but not with vbscript, so maybe i am missing something. Also at present i am altering the code using note pad as i do not know where to find a vbscript utility. (i dont think this should be a problem though) PLEASE HELP ITS DRIVING ME BONKERS! Kind regards Dan Share this post Link to post
Guest Guest Report post Posted 03/09/2004 02:36 AM ok i have been experimenting further and i have narrowed down the problem. i have now created a new function in lib_num2wav.vbs called testspeakcode '###### 'name : TestSpeakcode 'info : Say the digits in the number 'arg1 : Digits to be spoken : '###### Function TestSpeakcode(byval arg1) 'returns a list of comma delimited wav files, 'with each wav file corresponding to a character 'in the supplied input string. FullCode = arg1 For i=1 To Len(FullCode) sDigit = Mid(FullCode, i, 1) 'swav = sDigit & ".wav" If sDigit = "1" Then swav = "1.wav" End If If sDigit = "2" Then swav = "2.wav" End If If sDigit = "3" Then swav = "3.wav" End If If sDigit = "4" Then swav = "4.wav" End If If sDigit = "5" Then swav = "5.wav" End If If sDigit = "6" Then swav = "6.wav" End If If sDigit = "7" Then swav = "7.wav" End If If sDigit = "8" Then swav = "8.wav" End If If sDigit = "9" Then swav = "9.wav" End If If sDigit = "-" Then swav = "minus.wav" End If If sDigit = "#" Then swav = "hash.wav" End If If sDigit = "p" Then swav = "p.wav" End If If sDigit = "w" Then swav = "w.wav" End If If sDigit = "+" Then swav = "plus.wav" End If If sOut = "" Then sOut = sWav Else sOut = sOut & "," & sWav End if Next TestSpeakcode = sOut End Function when i use this function to speak the code the numbers are detected fine but again the characters are just ignored. I have carefully analysed the trace log and it confirms that the full code is read into voice guide. see log section below: 022640.76 0 rv add [dct3code1full]{#pw+6171687437+1#} 022640.76 0 rv add [dct3code2full]{#pw+7735457142+2#} 022640.76 0 TimeoutClear 022640.76 0 [Get ready for codes dct3] Playing 022640.76 0 [Get ready for codes dct3] Playing (C:\Documents and Settings\nabeel\Desktop\sounds for voice\getreadycodesdct3.wav) 022640.81 0 PlaySoundStart ok [C:\Documents and Settings\nabeel\Desktop\sounds for voice\getreadycodesdct3.wav] 022640.81 0 TimeoutClear 022640.81 0 RunModule PLAY end 022640.81 0 wa(17263,18837500) 022658.14 0 Play End line[0] (id=188375) 022658.14 0 ScriptEventCode 8001 iLineState=1100 022658.14 0 LsPlayMsg EV_PLAY_FINISHED 022658.14 0 TimeoutSet 10 EV_TIMEOUT_HANGUP 022658.14 0 TimeoutSet 0 EV_TIMEOUT_GOTOMODULE 022658.14 0 ScriptEventCode 9002 iLineState=1101 022658.14 0 LsPlayMsgFinished EV_TIMEOUT_GOTOMODULE 022658.14 0 TimeoutClear 022658.14 0 RVreplace start: [$RV[dct3code1full]] 022658.16 0 RVns [PathSysVoice]{}[PathApp]{C:\Program Files\VoiceGuide\}[PathDataVm]{C:\Program Files\VoiceGuide\data\}[PathVgSys]{C:\Program Files\VoiceGuide\system\}[$RV_STARTTIME]{3/9/2004 2:25:11 AM}[$RV_DEVICEID]{0}[$RV_CIDNAME]{}[PathApp]{C:\Program Files\VoiceGuide\}[$RV_CIDNUMBER]{}[Enter Network1234]{1}[1 Orange]{1}[Enter phone Model]{3310}[Enter phone Model_PathTaken]{matched}[Verify phone model dct3]{1}[Enter imei dct3]{351525002549187}[dct3code1]{6171687437}[dct3code2]{7735457142}[dct3code1full]{#pw+6171687437+1#}[dct3code2full]{#pw+7735457142+2#} 022658.16 0 RVreplace end: [#pw+6171687437+1#] 022658.16 0 [Saycode dct3 code 1] Say numbers: #pw+6171687437+1# as TestSpeakcode 022658.16 0 fn PlaySoundStartNumbers C:\Documents and Settings\nabeel\Desktop\sounds for voice\hashpwplus.wav, C:\Documents and Settings\nabeel\Desktop\sounds for voice\plus1hash.wav, #pw+6171687437+1#, TestSpeakcode 022658.16 0 sVbsFunctionToUse=TestSpeakcode 022658.20 0 Started SayNumber VBScript OK. (C:\Program Files\VoiceGuide\data\vbs_0_SayNumber.vbs) 022658.30 0 cl Play_Start C:\Documents and Settings\nabeel\Desktop\sounds for voice\hashpwplus.wav,6.wav,1.wav,7.wav,1.wav,6.wav,8.wav,7.wav,4.wav,3.wav,7.wav, .wav,C:\Documents and Settings\nabeel\Desktop\sounds for voice\plus1hash.wav 022658.34 0 PlaySoundStart ok [C:\Documents and Settings\nabeel\Desktop\sounds for voice\hashpwplus.wav,C:\Program Files\VoiceGuide\system\voice\6.wav,C:\Program Files\VoiceGuide\system\voice\1.wav,C:\Program Files\VoiceGuide\system\voice\7.wav,C:\Program Files\VoiceGuide\system\voice\1.wav,C:\Program Files\VoiceGuide\system\voice\6.wav,C:\Program Files\VoiceGuide\system\voice\8.wav,C:\Program Files\VoiceGuide\system\voice\7.wav,C:\Program Files\VoiceGuide\system\voice\4.wav,C:\Program Files\VoiceGuide\system\voice\3.wav,C:\Program Files\VoiceGuide\system\voice\7.wav,C:\Program Files\VoiceGuide\system\voice\1.wav,C:\Documents and Settings\nabeel\Desktop\sounds for voice\plus1hash.wav] 022658.36 0 TimeoutClear This is very strange, please help! Thanks Dan Share this post Link to post
SupportTeam Report post Posted 03/09/2004 03:36 AM (edited) Turns out that before passing data to procedures in lib_num2wav.vbs VG 'cleaned' the input to only allow digits 0 to 9 and characters "." and "-". Attached .exe does not 'clean' the input data. Please update your v5.2.1 install with this .exe and all should be fine (you should backup stuff you need from VG's current directory if you are using version prior to v5.2.1 as uninstall will remove entire directory) [Attached .exe deleted as it contained a bug. new .exe available in subsequent post] Edited 03/10/2004 08:44 PM by SupportTeam Share this post Link to post
Carphone Report post Posted 03/09/2004 10:49 PM Hi, thanks for the suppport, sadly your patched version must have a bug in it as it will not run even a basic script correctly. It either plays no digit/wav files at all or plays the incorrect one. (even using the VG original lib_num2wav.vbs). I uninstalled VG then installed 5.2.1, I then copied the patch. befor the patch is applied VG behaves normally after the patch is applied it acts very strange. I hope you can help. Thanks Dan Share this post Link to post
SupportTeam Report post Posted 03/10/2004 01:10 AM Could you please post a copy of VoiceGuide's Debug Printout which captures the problem, this will allow us to see what is going wrong. Share this post Link to post
SupportTeam Report post Posted 03/10/2004 08:43 PM OK, we have found the problem. The patched version supplied before did contain a bug - the .exe attached to this post will work. (previous .exe with bug in it will be removed) VgMulti_5.2.1009.zip Share this post Link to post
Carphone Report post Posted 03/11/2004 11:40 PM Hi this version is almost there but it still gives an error when it tries to play characters other than digits. VG does now successfully pass back a string of sound files to be played, but when it attempts to play the first one it gives an error. The sound files are recorded in the correct format and are placed in the correct directory. please see a copy of the trace below: 232924.11 0 rv add [dct3code1]{6171687437} 232924.13 0 rv add [dct3code2]{7735457142} 232924.13 0 rv add [dct3code1full]{#pw+6171687437+1#} 232924.13 0 rv add [dct3code2full]{#pw+7735457142+2#} 232924.13 0 TimeoutClear 232924.13 0 [Get ready for codes dct3] Playing 232924.13 0 [Get ready for codes dct3] Playing (C:\Documents and Settings\nabeel\Desktop\sounds for voice\getreadycodesdct3.wav) 232924.17 0 PlaySoundStart ok [C:\Documents and Settings\nabeel\Desktop\sounds for voice\getreadycodesdct3.wav] 232924.17 0 TimeoutClear 232924.17 0 RunModule PLAY end 232924.17 0 wa(17263,26773400) 232941.50 0 Play End line[0] (id=267734) 232941.50 0 ScriptEventCode 8001 iLineState=1100 232941.50 0 LsPlayMsg EV_PLAY_FINISHED 232941.50 0 TimeoutSet 10 EV_TIMEOUT_HANGUP 232941.50 0 TimeoutSet 0 EV_TIMEOUT_GOTOMODULE 232941.50 0 ScriptEventCode 9002 iLineState=1101 232941.50 0 LsPlayMsgFinished EV_TIMEOUT_GOTOMODULE 232941.50 0 TimeoutClear 232941.50 0 RVreplace start: [$RV[dct3code1full]] 232941.52 0 RVns [PathSysVoice]{}[PathApp]{C:\Program Files\VoiceGuide\}[PathDataVm]{C:\Program Files\VoiceGuide\data\}[PathVgSys]{C:\Program Files\VoiceGuide\system\}[$RV_STARTTIME]{3/11/2004 11:28:11 PM}[$RV_DEVICEID]{0}[$RV_CIDNAME]{}[PathApp]{C:\Program Files\VoiceGuide\}[$RV_CIDNUMBER]{}[Enter Network1234]{1}[1 Orange]{1}[Enter phone Model]{3310}[Enter phone Model_PathTaken]{matched}[Verify phone model dct3]{1}[Enter imei dct3]{351525002549187}[dct3code1]{6171687437}[dct3code2]{7735457142}[dct3code1full]{#pw+6171687437+1#}[dct3code2full]{#pw+7735457142+2#} 232941.52 0 RVreplace end: [#pw+6171687437+1#] 232941.52 0 [Saycode dct3 code 1] Say numbers: #pw+6171687437+1# as Digits 232941.52 0 fn PlaySoundStartNumbers C:\Documents and Settings\nabeel\Desktop\sounds for voice\hashpwplus.wav, C:\Documents and Settings\nabeel\Desktop\sounds for voice\plus1hash.wav, #pw+6171687437+1#, Digits 232941.52 0 sVbsFunctionToUse=Digits 232941.56 0 Started SayNumber VBScript OK. (C:\Program Files\VoiceGuide\data\vbs_0_SayNumber.vbs) 232941.61 0 cl Play_Start C:\Documents and Settings\nabeel\Desktop\sounds for voice\hashpwplus.wav,hash.wav,p.wav,w.wav,plus.wav,6.wav,1.wav,7.wav,1.wav,6.wav, .wav,7.wav,4.wav,3.wav,7.wav,plus.wav,1.wav,hash.wav,C:\Documents and Settings\nabeel\Desktop\sounds for voice\plus1hash.wav 232941.67 0 PlaySoundStart err=[0 , lPlayId=0x45a32, lOptions=0x0, strOptions=)] [C:\Documents and Settings\nabeel\Desktop\sounds for voice\hashpwplus.wav,C:\Program Files\VoiceGuide\system\voice\hash.wav,C:\Program Files\VoiceGuide\system\voice\p.wav,C:\Program Files\VoiceGuide\system\voice\w.wav,C:\Program Files\VoiceGuide\system\voice\plus.wav,C:\Program Files\VoiceGuide\system\voice\6.wav,C:\Program Files\VoiceGuide\system\voice\1.wav,C:\Program Files\VoiceGuide\system\voice\7.wav,C:\Program Files\VoiceGuide\system\voice\1.wav,C:\Program Files\VoiceGuide\system\voice\6.wav,C:\Program Files\VoiceGuide\system\voice\8.wav,C:\Program Files\VoiceGuide\system\voice\7.wav,C:\Program Files\VoiceGuide\system\voice\4.wav,C:\Program Files\VoiceGuide\system\voice\3.wav,C:\Program Files\VoiceGuide\system\voice\7.wav,C:\Program Files\VoiceGuide\system\voice\plus.wav,C:\Program Files\VoiceGuide\system\voice\1.wav,C:\Program Files\VoiceGuide\system\voice\hash.wav,C:\Documents and Settings\nabeel\Desktop\sounds for voice\plus1hash.wav] 232944.00 0 TimeoutClear 232944.00 0 wa(4425,28523418) 232948.30 0 wa(4425,28523400) 232948.30 0 Play End line[0] (id=285234) 232948.30 0 ScriptEventCode 8001 iLineState=1600 232948.30 0 LsSayNbrPlay EV_PLAY_FINISHED 232948.30 0 TimeoutSet 10 EV_TIMEOUT_HANGUP 232948.30 0 TimeoutSet 0 EV_TIMEOUT_GOTOMODULE 232948.30 0 ScriptEventCode 9002 iLineState=1600 232948.31 0 LsSayNbrPlay EV_TIMEOUT_GOTOMODULE 232948.31 0 TimeoutClear I suspect there is still a small bug some where in your code. Thank you for your continued support! regards Dan Share this post Link to post
SupportTeam Report post Posted 03/12/2004 12:01 AM Please do: 1. Stop VG 2. Place the appropriate OCX below in your Windows' \System32\ directory. (if using Dialogic card then use OCX in this post, otherwise use OCX from next post) 3. Start VG again. If problem persists please also .zip and post both the MMDDvgm.txt and MMDDtw.txt log files TapiWrap_1.83_for_Dialogic_Analog.zip Share this post Link to post
SupportTeam Report post Posted 03/12/2004 12:02 AM OCX to use for Voice Modem based site. TapiWrap_1.83_for_Voice_Modems.zip Share this post Link to post