Author Topic: Can you make a command wait until a .wav file has finished playing?  (Read 2439 times)

pilbrob

  • Guest
I write a lot of multiple-part commands. For example, this is a small part of one for starting an engine:

Say, 'Engine one starter switch. . Set to ground.' or 'Engine one. . Ignition switch on.'  (and wait until it completes)
Press Left Ctrl+Left Alt+Left Shift+R keys and hold for 0.1 seconds and release
Pause 10.11 seconds
Say, 'N2 climbing, at 10 percent now.' or 'N2 at 11 percent' or 'N2 spooling up.' or ' ' or ' '  (and wait until it completes)
Pause 12 seconds
Say, 'N2 at 20 percent, fuel lever to idle.' or 'Left fuel lever. . On.' or 'Left fuel lever to idle.' or 'Fuel lever. . On'  (and wait until it completes)
Press Left Ctrl+Left Shift+F2 keys and hold for 0.1 seconds and release

Each spoken command is completed, before the next action is taken. The timing of each spoken command will vary (some are a lot more variable in length than this example).

I'm thinking of changing all these statements to recorded .wav files, as that would sound a lot more realistic than even the best TTS voices. However, I'm not sure how I would get the command to stop and wait while the wav file was playing (just like it can be made to do for a TTS sentence).

Is there a way to do this? I could just insert a pause command after the 'play a random wav' call, but I'd have to time or guess each wav file length, plus - more importantly - it wouldn't work when some of the random wavs are much longer than others.

Thanks for your advice!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Can you make a command wait until a .wav file has finished playing?
« Reply #1 on: April 03, 2018, 01:34:18 PM »
If you check the "Wait until sound completes before continuing command" checkbox, VoiceAttack will do just that.

For the "Play a Random Sound" action, that checkbox is separate for each sound in the list(it's available when adding or editing added sound files).

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Can you make a command wait until a .wav file has finished playing?
« Reply #2 on: April 03, 2018, 01:54:32 PM »
You should get that option when you choose the directory too.  That might be a newer addition... I can't remember o_O

pilbrob

  • Guest
Re: Can you make a command wait until a .wav file has finished playing?
« Reply #3 on: April 04, 2018, 01:05:38 PM »
Thanks Pfeil and Gary.

I'm using the directory option. Yes, it's there on my version of voice attack (the current one). I must have just missed that check box, so thankyou very much for your help.  :)