Closed martindevans closed 4 years ago
@tamimzoabi I'm not sure what you are asking, sorry.
Please describe: 1) what you want to happen 2) what you tried 3) what actually happened
So I can help you out :)
ok firstly i am using unity with pun2 with dissonance last version . my scene is very simple had one button when the button pressed can talk . i do it and its talking but the problem that if i pressed any were on the scene its respond and can talk . i want just by pressing the button to talk . 2: there is too many echo if i talk more than 1 second 3: i build my project and have a one copy run on my pc and second on my phone . with the copy on my pc can talk but with the phone copy cant talk ? thanks a lot for your help .
It sounds like you have a few different issues to sort out.
i do it and its talking but the problem that if i pressed any were on the scene its respond and can talk . i want just by pressing the button to talk .
I'm not sure what you mean by this, sorry.
It sounds like you want a button you can click with your mouse to start talking? If so, you should have a unity UI element which enables/disables the Dissonance VoiceBroadcastTrigger
component and set the VoiceBroadcastTrigger
to Voice Activated
mode. When the trigger is disabled no voice will be sent, when it is enabled voice will automatically be sent when you talk.
there is too many echo if i talk more than 1 second
There are two settings to help with this.
One is to set Audio Duck Attenuation
(docs) to a smaller value (try 0.4). This will reduce the volume of other speakers when you are sending voice, which will reduce echo/feedback.
The other approach is to set up Acoustic Echo Cancellation
(docs). This will detect echo and cancel it out automatically.
with the copy on my pc can talk but with the phone copy cant talk
If you're using Push To Talk
this is because you are not pressing the "talk" button on the phone. Try setting the VoiceBroadcastTrigger
to Voice Activated
.
i am very thank to your help . i had fix the echo and the "phone copy cant talk". but still have problem set the button to activate the triger and DesActivate it . may you please give me a simple code . it may help me a lot please .
For the button you would need to add a Unity UI element in the editor (e.g. a button).
Create a component like this:
class ToggleVoice
: MonoBehaviour
{
public VoiceBroadcastTrigger Trigger;
public void Toggle()
{
Trigger.enabled = !Trigger.enabled;
}
}
Then set this component in the "OnClick" event of the button to trigger the "Toggle" method.
This is core Unity UI stuff, so if you're not familiar with it there are a lot of excellent video tutorials online to help :)
thats helped me a lot thanks
Glad I could help :)
Hi is there any way to make my apk run under background . i made a chatting rooms .... But photonview && all connection && talking and chatting sound , all that gone if the app is on background . i tried to use Anbdroid Studio and Edit this file "UnityPlayerActivity.java commenting out the calling on the Pause . but it did not work . please ?
Unfortunately I don't think that's possible with Unity. To have something running in the background you need a service, but you can't make a service with Unity as far as I know.
@tamimzoabi commented on https://github.com/Placeholder-Software/Dissonance/issues/81#issuecomment-518855507, moving discussion to a new issue.