Author Topic: Using two variables to define a directory for audio playback  (Read 2208 times)

Mike308

  • Newbie
  • *
  • Posts: 48
Using two variables to define a directory for audio playback
« on: April 24, 2019, 01:41:48 PM »
This is a follow-up from a prior question. I'd appreciate a hand with directing VA to play a random sound from within a specific folder that is defined by a pair of variables. I can get VA to play a random sound from one manually-defined folder using the basic command-builder interface. Easy-peezy. What I would like to do, however, is this:

Lets say I have 3 "lets talk about" commands, one each for Mustang, Camaro and Firebird.
Each command will set a common variable named "Topic" to a respective value, say 1,2,3...

I then have a number of common questions, i.e. what does it weigh? how fast will it go? what does it cost?
Lets assume for a moment the list of these questions to be uniformly ordered, and carry a second variable, "Question" hypothetically designated A, B, C... for ease of discussion.

For audio response, rather than TTS I am using pre-recorded voice clips saved in folders. Most folders have more than one clip simply for variety sake.

So if I tell VA I want to talk about Mustangs, my topic is set to 1.

If I then ask "How fast will it go" my question is B.

At that point I want VA to randomly play any one sound in folder 1B.

What is the best way to direct VA to play a sound from the correct folder based on a pair of variables?

Thanks!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: Using two variables to define a directory for audio playback
« Reply #1 on: April 24, 2019, 01:58:14 PM »
Code: [Select]
Play random sound (from directory: {VA_SOUNDS}\{INT:Topic}{TXT:Question})

Mike308

  • Newbie
  • *
  • Posts: 48
Re: Using two variables to define a directory for audio playback
« Reply #2 on: April 25, 2019, 07:17:59 PM »
and there we go!  Thank you!