Author Topic: Pause between Prefix and Suffix  (Read 1014 times)

bushido

  • Newbie
  • *
  • Posts: 10
Pause between Prefix and Suffix
« on: September 05, 2020, 02:17:20 AM »
Hi, I'm very new to VA and I'm learning as I go.

I'm exploring ways to make communication more fluid, natural and immersive. I haven't started to try out the more advanced coding features yet. I'm currently exploring prefixes and suffixes. I find that it's sometimes very difficult to make myself understand because the speech recognition system expects and quick immediate word from me between the prefix and suffix.

1. Is it possible to have a condition in between prefix and suffix like: if spoken next sentence within 1.5s then..., else then...
2. if between prefix and suffix the abstract word is spoken: [ehhhh;ahhhhhm;uhhhhh] then wait another 1.5s

Would be something like this:

say 'transmit vhf <pause to think for 3s> I want <pause 1.3s> uhhhh, flight <pause 1s> go wedge formation over'

Cheers

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Pause between Prefix and Suffix
« Reply #1 on: September 05, 2020, 08:05:46 AM »
Prefix/suffix is a method for building a set of phrases that consist of two sections, but form one single phrase that is spoken without interruption.

If you want to speak multiple commands, you'll need to have separate phrases, noting that pausing (I.E. silence, no fillers like "uhhhhh" immediately before or after a command) is required between the phrases so the speech recognition engine can finish recognition.

To check whether a given command is likely to have been spoken as part of a chain of commands, you'll need to set up some logic for that.
E.G. you can set a date value of the current date plus your timeout, then check whether that point in time is still in the future when the next command is executed, and if so, either extend the timeout if the recognized command is a connecting phrase like "I want", or complete the chain if it's a finalizing statement.
You'd also need to keep track of what was spoken within the chain, which could be done using a text variable that's appended when a phrase that actually provides information is spoken.


Something like

transmit vhf
Code: [Select]
Set date [>chainTimeout] to [>chainTimeout] plus [1500] milliseconds
Set text [>chainPhrases] to 'transmit VHF,'

I want;uhhhh
Code: [Select]
Begin Date Compare : [>chainTimeout] Is After Current Date/Time
    Set date [>chainTimeout] value to the current date/time
    Set date [>chainTimeout] to [>chainTimeout] plus [1500] milliseconds
Else
    Write [Orange] 'No command chain in progress' to log
End Condition

flight
Code: [Select]
Begin Date Compare : [>chainTimeout] Is After Current Date/Time
    Set date [>chainTimeout] value to the current date/time
    Set date [>chainTimeout] to [>chainTimeout] plus [1500] milliseconds
    Set text [>chainPhrases] to '{TXT:>chainPhrases} flight,'
Else
    Write [Orange] 'No command chain in progress' to log
End Condition

go wedge formation [over;]
Code: [Select]
Begin Date Compare : [>chainTimeout] Is After Current Date/Time
    Begin Text Compare : [>chainPhrases] Contains 'VHF'
        Press V key and hold for 0,01 seconds and release
    Else If Text Compare : [>chainPhrases] Contains 'UHF'
        Press U key and hold for 0,01 seconds and release
    End Condition
    Begin Text Compare : [>chainPhrases] Contains 'flight'
        Press F key and hold for 0,01 seconds and release
    Else If Text Compare : [>chainPhrases] Contains 'wingman'
        Press W key and hold for 0,01 seconds and release
    Else
        Write [Red] 'No valid target specified' to log
    End Condition - Exit when condition not met
    Press Left Ctrl+Left Shift+W keys and hold for 0,01 seconds and release
Else
    Write [Orange] 'No command chain in progress' to log
End Condition

bushido

  • Newbie
  • *
  • Posts: 10
Re: Pause between Prefix and Suffix
« Reply #2 on: September 06, 2020, 07:46:53 AM »
Huge thanks to you!