cmdrmcdonald / EliteDangerousDataProvider

Apache License 2.0
134 stars 31 forks source link

Check for responder voice output #260

Open mikelimtw opened 7 years ago

mikelimtw commented 7 years ago

Hi Cmdr McDonald,

I'm wondering if there is a way to check if EDDI is speaking from any of the responders? I have a lot of routines that I am building in VoiceAttack, and since version 1.6.5 there has been a way to check if there is voice output from VoiceAttack. This allows me to stop further voice output so I don't have TTS talking over itself. Is there a way to check for this in EDDI so that I can prevent my VoiceAttack routines from speaking over EDDI's responders?

Tkael commented 7 years ago

I'm not Cmdr McDonald, but I have some experience with EDDI and as far as I'm aware there isn't any built-in function for this. That said, you can use the SetState function to set a variable when EDDI is speaking and have VoiceAttack read the value of the variable. Or to set send the status of whether VoiceAttack is speaking & send that to EDDI.

To interact with the variable from VoiceAttack: https://github.com/cmdrmcdonald/EliteDangerousDataProvider/wiki/VoiceAttack-Integration#setstate

To interact with the variable from EDDI: https://github.com/cmdrmcdonald/EliteDangerousDataProvider/blob/master/SpeechResponder/Help.md#setstate

Darkcyde13 commented 7 years ago

My 2 cents...

The problem I find is that an EDDI script can finish, but the speech can go on for a long time after (for a lot of speech). If this happens, it can mess with the order of script speech sometimes. If a script finishes and the speech is still going, other scripts can execute and queue up the speech. If several scripts finish before the speech of the first one ends, then EDDI seems to randomly choose which to say next (I've not bothered trying to determine the reason for their order).

My guess is that when a script executes, it completes and sends the speech to the speech engine to be spoken. EDDI is then free to do the next one, and will execute that regardless, sending that speech to the engine, thus queuing up the next set of spoken words, even if the engine is still going with the first lot.

I am only guessing here, but I'd say that you would need the speech engine to return a value when it has processed all the current speech sent to it, and then EDDI react to that value, only sending the next lot when it is received. That is, if this is even possible. If your chosen speech engine already does this, then EDDI would need programming to recognise and use that value.