Photon voice speaker has not correct signal

PawelL
✭
in Photon Voice
Hello.
I have application that use desktop version and vr version of the same app. I try to connect PC player voice chat with VR player voice chat. Steps i do:
1: create lobby by pc and room by pc
2: master disable scene synchronization flag (pc and vr has other scenes)
3: join lobby and room by vr
4: setup PhotonVoiceNetwork
5: create local recorder for pc
6: create local recorder for vr
7: send rpc for create speaker of pc in vr
8: send rpc for create speaker of vr in pc
9: IT WORKS!
10; now when they are connected in "lobby scene" i click play, then start new scene and both players change scene
11: wait for both players until changed scenes
12: PhotonVoiceNetwork is on scene because it is singleton
13: steps 5, 6, 7, 8
14: now when i talk from PC i can hear in vr and speaker curve is correct
15: when i transmit enable in vr then pc speaker draw curve but it is straight line (in vr debug it is correct)
16: i can't hear in PC nothing from VR
So i don't know what happend and why this is happend. Really even in documentation I can not find anything that could help me.
Please help me.
I have application that use desktop version and vr version of the same app. I try to connect PC player voice chat with VR player voice chat. Steps i do:
1: create lobby by pc and room by pc
2: master disable scene synchronization flag (pc and vr has other scenes)
3: join lobby and room by vr
4: setup PhotonVoiceNetwork
5: create local recorder for pc
6: create local recorder for vr
7: send rpc for create speaker of pc in vr
8: send rpc for create speaker of vr in pc
9: IT WORKS!
10; now when they are connected in "lobby scene" i click play, then start new scene and both players change scene
11: wait for both players until changed scenes
12: PhotonVoiceNetwork is on scene because it is singleton
13: steps 5, 6, 7, 8
14: now when i talk from PC i can hear in vr and speaker curve is correct
15: when i transmit enable in vr then pc speaker draw curve but it is straight line (in vr debug it is correct)
16: i can't hear in PC nothing from VR
So i don't know what happend and why this is happend. Really even in documentation I can not find anything that could help me.
Please help me.
0
Comments
-
I updated PUN yesterday to "v2.16.1 (April 30th, 2020) PUN2: v2.18.1".
PhotonVoiceView is needed to use recorder and speaker. I know I can use PhotonVoiceView or by prefab workflow. No one teach me so that my workflow that worked in PC - PC, and VR - VR.
When i instantiate Players in scene, then i create voice chat.
1: players on scene with viewID - 1000, 2000, 3000...
2: everyone spawned then create PhotonVoiceView - that also gives me 3d sound near player
3: if is owner then create recorder, but if is not owner create speaker
It worked always but not now. I really don't know why.0 -
Hi @PawelL,I updated PUN yesterday to "v2.16.1 (April 30th, 2020) PUN2: v2.18.1".PhotonVoiceView is needed to use recorder and speaker. I know I can use PhotonVoiceView or by prefab workflow. No one teach me so that my workflow that worked in PC - PC, and VR - VR.1: players on scene with viewID - 1000, 2000, 3000...2: everyone spawned then create PhotonVoiceView - that also gives me 3D sound near playerIt worked always but not now. I really don't know why.0
-
Sorry i am little chaotic, because i fight with this 4 days now.
changes-voice.txt :Photon Voice 2 Change Log
v2.16.1 (April 30th, 2020)
PUN2: v2.18.1 (624dae8c)
PhotonVoiceApi: revision 5464You can use Photon Voice without PhotonVoiceViewI was just curious why not have a prefab that has PhotonVoiceView and Recorder (local) or Speaker (remote).
I tried this to! really nothing helped me.You mean 1001, 2001, 3001 right?
no... just 1000, 2000 and Unity show me that is first and second player. Also i tried to make other prefab in next try with 1001, 2001 and that not helped me.this is done via AudioSource.spatialBlendYou mean this stopped working after update to 2.16.1
0 -
It works in first scene both ways right? it stops working when you switch scenes?
But now I changed something. I am not creating PhotonVoiceNetwork and not creating recorders or speaker in first scene.
When new scene is loaded and i see in both PCs (Just PC, and PC with Oculus) that game is loaded, then i click "Create voice chat". I added that for test and that create localy PhotonVoiceView, and add recorder send rpc to second player that i clicked it and create PhotonVoiceView that create automaticly speaker in remote. In second PC i do the same.
Now I have created automaticlly "PhotonVoiceNetwork singleton" and Cached Remote Voices' Info show
in VR :
voice# 1
Player# 2
Channel# 0
UserData: 1001
in PC:
voice# 1
Player# 1
Channel# 0
UserData: 2001
I can see other player oculus avatar so it is the same room. Even Client Debug Info show the same _voice_ room and 2 players.
I can hear PC, i can't hear VR (but speaker show straight line curve when start Transmit enabled)0 -
public void VoiceChatIntance() //EDITOR CLICK { StartCoroutine(InitVoiceChat()); } public IEnumerator InitVoiceChat() { int viewId = photonView.ViewID + 1; //photonView.ViewID = local player GameObject voiceController = new GameObject("voice " + viewId.ToString()); voiceController.SetActive(false); PhotonVoiceView photonVoiceView = voiceController.AddComponent<PhotonVoiceView>(); PhotonView pv = voiceController.GetComponent<PhotonView>(); pv.ViewID = viewId; voiceController.SetActive(true); pv.RequestOwnership(); yield return new WaitForEndOfFrame(); Recorder recorder = voiceController.AddComponent<Recorder>(); photonVoiceView.RecorderInUse = recorder; recorder.TransmitEnabled = true; photonView.RPC(nameof(PlayerVRRemoteController.RPCCreateSpeaker), RpcTarget.Others); }
[PunRPC] public void RPCCreateSpeaker() { int viewId = photonView.ViewID + 1; GameObject voiceController = new GameObject("voice " + viewId.ToString()); voiceController.SetActive(false); PhotonVoiceView photonVoiceView = voiceController.AddComponent<PhotonVoiceView>(); PhotonView pv = voiceController.GetComponent<PhotonView>(); pv.ViewID = viewId; voiceController.SetActive(true); voiceController.gameObject.GetComponent<AudioSource>().spatialBlend = 0; }
0 -
If you increase log level of PhotonVoiceView to ALL and add a debug button that calls PhotonVoiceView.Init what happens?0
-
Nothing.
I debug this and
this.photonView.ViewID > 0 is true in recorder and speaker.
this.IsSetup is true in recorder and speaker.
(this.IsSpeaker && !this.SpeakerInUse.IsLinked) is false because this.SpeakerInUse.IsLinked is true in speaker, this.IsSpeaker is false in recorder0 -
what happens if you restart recording?
recorder.IsRecording = false; recorder.IsRecording = true;
orrecorder.StopRecording(); recorder.StartRecording();
0 -
Recorder box : IsRecording call stop and start recording, so i click it and nothing happend, nothing changed and then i used Init again and nothing happend :<0
-
Oculus Rift S with OVR SDK. I will remove sdk in future but now i can't.did you take a look here and here?did you disable (set to false, uncheck, untick) recorder.VoiceDetection (VAD)?what's the value of recorder.IsCurrentlyTransmitting?
Also in local debug speaker i have normal signal (i can hear myself in debug echo)do you use WebRtcAudioDsp?0 -
I made session with 1 PC and 2 VRs and vrs can hear each others but pc can't hear VRs0
-
Hi @PawelL,I have this disable, should not?
weird that recorder is transmitting, speaker is linked and yet it does not work!
photonVoiceView.SpeakerInUse.IsPlaying is false?
how do you connect the Photon Voice client?
hmm since the way you instantiate and set ViewID is orthodox, I think it's better if you share a minimal repro project here or via private message or via [email protected]
0 -
Sorry i didn't answer, but i found solution and i had to work hard....
as i saidI made session with 1 PC and 2 VRs and vrs can hear each others but pc can't hear VRs
Later after that i added to my pc-player: local avatar and ovr camera rig (oculus prefabs) and it worked. I couldn't do vr stufs in my pc version, but voice chat worked so i deleted local avatar and that worked... so i tried to delete more components, but if i deleted something from ovr camera rig then it not work.
My solution is to instantiate hybrid of VR-PC player and then disable VR components and that work. I don't know why it work, and i really don't want to know... it is traumatic for me i spend for this all week.
Thank you for help
0