Cannot get it working... (no audio)

Mick
Mick
edited May 2016 in Photon Voice
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

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:

Comments

  • - please use a "speaking" heading
    - please use code formatting in your post

    thanks
  • please get rid of the smiley popup menu that gets in the way all the time and leads to inadvertant smilies!
  • 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.
  • 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.
    thanks
  • just for your convenience I improved your post for you
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Mick,

    Does the demo work for you?

    What are the logs you are getting?

    What are the PhotonVoiceSettings you have? Is AutoTransmit enabled?
  • Mick
    Mick
    edited May 2016
    Voice Settings:
    1. Auto Connect: On
    2. Auto Disconnect: On
    3. Auto Transmit: On
    4. Sampling Rate: 24000
    5. Delay: 20ms
    6. Bit Rate: 30000
    7. Voice Detection: On
    8. Voice Detection Threshold: 0.01
    9. Play Delay ms: 200
    10. Debug Info: Off
    Can't try the demo, and wouldn't prove anything really anyway as my app is so different from the Demo (this is a VR application and on my development PC I don't have a microphone)

  • Hi Mick! Did you get anything to work yet? Also working in VR here (Unity SteamVR) and also not hearing any audio. Thanks!
  • JohnTube
    JohnTube ✭✭✭✭✭
    @Mick: I apologize about the long delay. I really missed this discussion.
    @Mick @Philipp: can you please provide logs? any information on how to reproduce this would be helpful.
  • 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?
  • JohnTube
    JohnTube ✭✭✭✭✭
    And if nothing works, please try this workaround described here. I suspect both issues are related if not the same.