Cannot get it working... (no audio)
Options
Mick
✭
I've been trying for a week now to get voice chat working, please can anyone help...
Here are the main scripts I'm using...
The first is attached to a gameobject in my main scene
I've taken the debug messages out , but I can see that I've joined A Photon Room, I can see that my voice prefab has been created, I can see that the voice seems to be started up, If I look in my analytics on the photon site I can see that I've joined the room (three different players), I can also see in the analytics that I've joined a voice room, and have sent around 2Mb of traffic
However, PhotonVoiceRecorder.IsTransmitting never appears to be set to true:
PhotonVoiceSpeaker.IsPlaying never appears to be set to true
(I check with this code attached to update on the voice object:
I cannot hear anything:
Here are the main scripts I'm using...
The first is attached to a gameobject in my main scene
public class VoiceNetwork : PunBehaviour { public GameObject VoicePrefab; // Use this for initialization void Start () { PhotonNetwork.ConnectUsingSettings("v1.0"); } public override void OnConnectedToMaster() { base.OnConnectedToMaster(); RoomOptions roomOptions = new RoomOptions() { isVisible = false, maxPlayers = 4 }; PhotonNetwork.JoinOrCreateRoom("MyRoom", roomOptions, TypedLobby.Default); } public override void OnJoinedRoom() { PhotonVoiceNetwork.Connect(); Vector3 pos = Vector3.zero; PhotonNetwork.Instantiate(VoicePrefab.name, pos, Quaternion.identity, 0); } }The prefab contains Audio Source, Photon Voice Speakerm Photon Voice Recorder, and PHoton View
I've taken the debug messages out , but I can see that I've joined A Photon Room, I can see that my voice prefab has been created, I can see that the voice seems to be started up, If I look in my analytics on the photon site I can see that I've joined the room (three different players), I can also see in the analytics that I've joined a voice room, and have sent around 2Mb of traffic
However, PhotonVoiceRecorder.IsTransmitting never appears to be set to true:
PhotonVoiceSpeaker.IsPlaying never appears to be set to true
(I check with this code attached to update on the voice object:
void Update () { PhotonVoiceRecorder rec = this.GetComponentInChildren<PhotonVoiceRecorder>(); PhotonVoiceSpeaker play = this.GetComponentInChildren<PhotonVoiceSpeaker>(); if (rec.IsTransmitting) { transmit.GetComponent<Renderer>().material = greenmat; } else { transmit.GetComponent<Renderer>().material = redmat; } if (play.IsPlaying) { receive.GetComponent<Renderer>().material = greenmat; } else { receive.GetComponent<Renderer>().material = redmat; } }(my indicators turn red, but never turn green)
I cannot hear anything:
0
Comments
-
- please use a "speaking" heading
- please use code formatting in your post
thanks-1 -
please get rid of the smiley popup menu that gets in the way all the time and leads to inadvertant smilies!0
-
I am sorry, but for an admin to just criticize irrelevant details of style and not provide a single shred of actual help on the problem is making me think I've made a very bad mistake in choosing Photon.0
-
I did not criticize, but asked you nicely to improve your post, so it is easier for us or someone else to provide feedback and help, without wasting time.
Feel free to send me detailed feedback for improvement via PM.
thanks0 -
just for your convenience I improved your post for you0
-
Voice Settings:
- Auto Connect: On
- Auto Disconnect: On
- Auto Transmit: On
- Sampling Rate: 24000
- Delay: 20ms
- Bit Rate: 30000
- Voice Detection: On
- Voice Detection Threshold: 0.01
- Play Delay ms: 200
- Debug Info: Off
0 - Auto Connect: On
-
Hi Mick! Did you get anything to work yet? Also working in VR here (Unity SteamVR) and also not hearing any audio. Thanks!0
-
Hi,
The code looks good.
We need to see your logs to tell what's wrong. Set 'Debug Info' to 'on' before logging.
But first try to disable 'Voice Detection'. Mic signal level may be not high enough to trigger transmission.
You may enable it back and set 'Voice Detection Threshold' to the value which works for you later if needed. Or use voice detection calibration feature.
Do other applications using microphone work on your hardware, by the way?
0