I am trying to expand my grasp on tokens/small integers in a test profile that uses TTS rather than pre-recorded sound bits. My desired goal is to create the ability to generate context-sensitive answers to generic questions. For a simple example, assume a discussion of cars.
At the onset I declare a variable called ‘Topic’ with an initial value of zero
I then declare a variable called ‘Query’ also with an initial value of zero
I have three separate initial commands: lets talk about the Camaro, lets talk about the Firebird, lets talk about the Mustang. Each command will set Topic to a specific value, in this case 1, 2 or 3 respectively.
I then have generic commands: What does it cost? How fast will it go? Who manufactures it?
I know that inside each of these generic commands I can have an If/ElseIf stack based on the value of Topic that would give me the corresponding answer. (if asking about cost, a Topic 1 returns $100, ElseIf 2 then $125, ElseIf 3 $150…)
But if I have a large body of generic questions, I would have to spend a lot of editing ElseIf statements every time I wanted to add a new car. It gets really hairy when I'm trying to use SSML.
What I’m wondering is if I could do this: What if each of the generic commands set the value of Query (in this small example, to 1,2 or 3 respectively.) This would give me a number pair (Topic + Query) so if I was talking Mustangs (Topic = 3) and followed that by asking how fast will it go (Query = 2) then I’d have 32.
If I was using pre-recorded sound files, I think I could name them based on this matrix, so the command would then play the sound file named 32. But could I do that same thing using TTS replies and somehow speak text string #32?
My thought is that as I add a new Topic to the library, I need only create the new replies; I do not need to go back to every question and add a new ElseIf line to the command. The math would carry by itself.
Or is there some flawed thinking here…?
Note: I understand that my actual number sequences would carry more digits, just using 1-2-3 here for ease of discussion.
Thanks!