Closed cjackie closed 3 years ago
The best way to set this up at the moment is to use a commented out feature of Dissonance.
VoiceBroadcastTrigger
on line 429 find this code and comment it in://case CommActivationMode.Open:
// return true;
Assets\Plugins\Dissonance\Core\CommActivationMode.cs
and comment in Open
there.VoiceBroadcastTrigger
in the scene to Activation Mode: Open
and Mute: true
Event Trigger
. Bind pointer down
to VoiceBroadcastTrigger.IsMuted=false
and pointer up
to VoiceBroadcastTrigger.IsMuted=true
If you want the button to toggle speech instead of require being held down you'll need to write a small script to toggle the IsMuted
property when the button is pressed. I also suggest using Voice Activation
instead of Open
in this case.
I'm going to comment the Open
option back in for the next version of Dissonance. I might also add a ToggleMute
method, to make the second case easier to implement as well.
I want to enable speaking when a Button UI is held down. VoiceBroadcastTrigger.IsMute
is exactly what I want. Thanks! Maybe mentioning VoiceBroadcastTrigger.IsMute
in https://dissonance.readthedocs.io/en/latest/Tutorials/Push-to-Talk.html as the alternative to achieve "Push-To-Talk".
Once the next version is released on the asset store with these changes I do plan to update the docs with a tutorial about this. Thanks for the suggestion :)
In Dissonance 7.2.1 we added a couple of things to make this easier:
ToggleMute
method on VoiceBroadcastTrigger inverts IsMuted
when called.Open
mode.
Context
I follow "Push-To-Talk" tutorial to setup a broadcast trigger (https://dissonance.readthedocs.io/en/latest/Tutorials/Push-to-Talk.html). It says "To set a broadcast trigger to use PTT simply change the "Activation Mode" to "Push To Talk" and choose which input axis must be pressed for voice to be transmitted". I'm creating a game that relies on Button UI to for input (https://docs.unity3d.com/2018.3/Documentation/ScriptReference/UI.Button.html). I want to push the Button UI to trigger broadcast. But I'm stuck on setting up my Button UI as the trigger.
Workaround
It seems I can use collider volume activation to achieve Push-To-Talk. but it is a hack, and is not intuitive.
Fix
Add support of UI Button to Push-To-Talk mode, or just expose a simple bool to indicate broadcast start and end.
Your Environment
Dissonance version used: e.g. v1.0.0 (check Assets/Dissonance/changelog) v7.2.0 (2021-01-05)
Unity version: e.g. 5.3.5f1 Personal (check Help > About Unity) 2019.4.16.f1 Personal