Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tamimzoabi request for help #157

Closed
martindevans opened this issue Aug 6, 2019 · 9 comments
Closed

tamimzoabi request for help #157

martindevans opened this issue Aug 6, 2019 · 9 comments

Comments

@martindevans
Copy link
Member

@tamimzoabi commented on #81 (comment), moving discussion to a new issue.

Hi
Please i need your help
i need to do the first step of your project : user press a button and start speaking.
i configure Dissonance fine . but its start to receive my voice if i press what ever on the scene .
i need just to react if i press a Button .

@martindevans
Copy link
Member Author

@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 :)

@tamimzoabi
Copy link

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 .

@martindevans
Copy link
Member Author

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.

@tamimzoabi
Copy link

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 .

@martindevans
Copy link
Member Author

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 :)

@tamimzoabi
Copy link

thats helped me a lot
thanks

@martindevans
Copy link
Member Author

Glad I could help :)

@tamimzoabi
Copy link

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 ?

@martindevans
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants