Wrong Counting
First, please have a quick look at the VPL diagram:
www.ie.bgu.ac.il/kartoun/microsoft/pics/VPL_Count_Down.JPG
While trying to run the counting down program, I encounter a weird output; sometimes the program runs properly and says: "ten, nine, eight and so on till zero, all done" and sometimes it says "ten, eight... zero... all done, nine" or other wrong counting.
Have you ever encountered such a situation?
Thanks!
In VPL everything that is not explicitely sequenced can happen in parallel, to solve the issue and maintain ordering you have to make the loop dependent on the response SayTextSynchronous action of the TTS activity, i.e. add a join to the connection that loops back and feed the response of the action into the join.
Hope this helps,
Andreas
Andreas, can you please be even more specific?
It still doesn't work (although it is supposed to be a very simple issue).
Thanks,
Uri.
Hi Uri,
The problem is that the branch of your diagram from the merge to the top TextToSpeech block happens concurrently to all other processing and the VPL runtime doesn't guarantee order of execution of concurrent blocks so the numbers will be said out of order. If you structure the diagram such that the counter is not decremented until the number has been passed to the TextToSpeech service and a response received then you can guarantee the order of execution.
Hopefully the following ascii art will make this clear...
Code Snippet
+-Data-+ +-If+ +-TextToSpeech-+
| | | | | |
+ 10 +O+ value == 0 +-SayText-+ "All done!" |
| | / | | | |
+-int--+ | | Else +. +--+
| + \ \
| \ \ +-Join-+
| \ \ | | +--Calculate--+
| | `-+ Counter | | |
| | | ++ Counter - 1 +-.
| | .+ Success | | | |
| | / | | +-+ |
| | | ++ /
\ | +-TTS+ | /
\ \ | | / /
\ '-+ value +-' /
\ | | /
\ +-+ /
\ /
''
Hope this Helps
Paul