Cannot hear voice in the editor neither see created speaker i the hierarchy. However works on device
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on Voice.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Cannot hear voice in the editor neither see created speaker i the hierarchy. However works on device
Reaper
2019-01-21 09:41:48
Currently added photon voice V2 chat along with UNET. Using also OVR plugin because using "Oculus GO" . My setup is that i have Voice connection, Recorder and ConnectAndJoin on a separate Game Object. Voice seems to connect just fine on our Oculus GO device. However when hosting from both editor and even standalone build voice seems not to work on those.
No errors seem to occur when running the application. I seems that it gives the same voice ID to both clients.
Here are the inspector settings:
https://drive.google.com/file/d/1eohou7RSeq72u1Vtj9s_XSV_tfaoBar1/view?usp=sharing
I am connecting manually on player object Start function therefor AutoConnect and AutoTransmit are disabled. Previously tried them enabled did not work. If you need anything to know other that I've posted. I will provide everything below.
Comments
Hi @Reaper,
Thank you for choosing Photon!
Hi @JohnTube
Thanks for quick response
private ConnectAndJoin myVoiceConnector;
private void Start()
{
myVoiceConnector = FindObjectOfType();
if(isLocalPlayer)
{
ConnectVoice();
}
}
private void ConnectVoice()
{
myVoiceConnector.ConnectNow();
myVoiceConnector.voiceConnection.PrimaryRecorder.TransmitEnabled = true;
myVoiceConnector.voiceConnection.PrimaryRecorder.Init(myVoiceConnector.voiceConnection.VoiceClient;
}
Hi again @JohnTube
I've tried previous fix and that seem eliminate the case when nether of users gets the sound. But it still doesn't seem to work in the editor.And by "not working " i mean that i don't get to hear the sound and neither i see the speaker prefab appearing on editor side. Is there a reason to that? Can i make it work?
Hi @Reaper,
Could you reproduce using DemoVoiceUI?
We've found out what the problem was. It was a microphone setting on a Recorder component. It used to be Unity microphone which was looking for Realtek mic on our Oculus Go and obviously fail) We've switched to Photon mic and that did the trick. By the way for the sake of sanity of all the developers that ran into our next problem with voice. App can sometimes not request a microphone permission on its first launch so force request on start if that happens.
Thanks for your help @JohnTube
You're welcome @Reaper.
@JohnTube Yes of course)
The problem is that you app for some reason may not request a permission on its first launch.
Basically what you do is you write a following piece of code either on start of an existing script that is in your scene or create a new one.
void Start ()
{
#if PLATFORM_ANDROID
if (!Permission.HasUserAuthorizedPermission(Permission.Microphone))
{
Permission.RequestUserPermission(Permission.Microphone);
}
#endif
}
That is for android however it is similar for other platforms.
You can also go further and make an explanation message for user why do you need permissions.
More detailed explanation about it you can find here
Ah I see now, this is a new feature in 2018.3!
Thanks for the link! we will add it here.
I am facing the same issue while using a photon voice some time one player is not able to hear another player but the other player is able to hear.
I also added code for permission for Microphone. Still facing the issue.
while debugging I came to know that the SimpleSpeakerFactory method is not getting called this method belongs to VoiceConnection class.
Back to top