Help with Audio Groups

I can't seem to get the following to work.

3 players:
Player A - group 1
Player B - group 2
Player C - group 1

Player A should be able to hear Player C
Player B should be able to hear ALL Players
Player C should be able to hear Player A

This is how I believe it should work but it's not working for me:

Player A:
PhotonVoiceNetwork.Client.GlobalAudioGroup = 1;

Player B:
PhotonVoiceNetwork.Client.GlobalAudioGroup = 2;
// remove all audio groups, and allow player to hear group 1
PhotonVoiceNetwork.Client.ChangeAudioGroups(new byte[0], new byte[1] {1 });

Player C:
PhotonVoiceNetwork.Client.GlobalAudioGroup = 1;

Any ideas why that isn't working? Both Player A and C work fine, but B can't hear A or C even though I have added it.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @SniperED007,

    Thank you for choosing Photon!

    GlobalAudioGroup is meant for incoming and outgoing audio group to be the same.
    Voice Client can subscribe and hear multiple groups but talk to a single group.

    Please try subscribing player B to all audio groups:
    Player B:
    PhotonVoiceNetwork.Client.ChangeAudioGroups(null, new byte[0]);
    
  • I had already tried that, but it didn't work either.
    The wording is confusing, as you say "Voice Client can subscribe and hear multiple groups but talk to a single group"
    If I am in Group 1 and can only talk to a single group (Group 1) then how is it possible for other players in other groups to hear my group, if they could hear my group then surely their isn't actually a limit of talking to a single group?
  • SniperED007
    edited May 2017
    Ok, got it working, I changed the order like this, my previous one had it the other way around: (as in first setting the ChangeAudioGroups and then the GlobalAudioGroup)

    PhotonVoiceNetwork.Client.GlobalAudioGroup = 2;
    PhotonVoiceNetwork.Client.ChangeAudioGroups(new byte[0], new byte[0]);

  • Hi
    Sorry for the question but I'm new to photon. I am trying to develop a game in which 2 players get together in a room but the Audiogroup is being passed on to everyone by default.
    I set object Recorder is set to greater than 1 I will stop listening.

    Does anyone know where to put the code above so I can create the room and only two players can talk to each other?

    Thank you very much
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @rlima,

    Thank you for choosing Photon!

    I assume you are using Photon Voice 2.
    Audio Groups are now called Interest Groups to be consistent w/ the internally used Photon Realtime's Interest Groups.

    Anyway, if you want two players only in the room to have a private conversation then both need to set the same 'secretly shared' custom (> 0) interest group as their global group (see here). The group could either be shared between the two players outside of Photon or using Photon or it could be also calculated locally on each client using a deterministic way (e.g. sum of actor numbers % 256 + 1).
  • Thank you for your support.
    I have been trying but not working.

    Do you know any video as reference to see how to do??

    Thanks in advanced