Do photon client and server filter photon voices when the audio source listener is out of scope??

harlanharlan
edited July 2019 in Photon Voice
Case A:
Only person A and Person B are in a photon room, the max distance of 3d sound settings are all 500, and now the real distance of the two persons are 600, so they cannot hear each other, I want to know that the voice streams are transmitted to the photon server or not??

Case B:
100 persons are in a photon room, the max distance of 3d sound settings are all 500, in the scope of person A only have one person : B, so A can only hear B now, maybe photon server can receive 100 voice streams, but person A can receive all the voice streams or only receive the voice stream from person B??

Comments

  • Hi @harlan,

    Case A:
    I want to know that the voice streams are transmitted to the photon server or not??
    By default yes if the transmission is still enabled. You need to disable transmission yourself when the distance is higher than 500 (whatever unit you are using).

    Case B:
    100 players in one room is too many.
    Read about the recommended maximum number of players per room here.
    person A can receive all the voice streams or only receive the voice stream from person B??
    If you are transmitting to the default interest group 0 then person A will receive all voice streams. You need to filter using Interest Groups: subscribe and unsubscribe on the fly based on distance and persons inside the "voice range".

    If you are using Photon Voice 2, I have made an example, basic one, the distance is represented using a sphere collider inside which players can hear each other. Outside of the sphere the player will not transmit or hear others.

    Here is the logic behind the minimal proximity voice chat demo:

    The idea is to make use of "Interest Groups" to filter incoming voice streams and set target outgoing one(s).

    Set the local recorder's Interest Group to my ActorNumber.
    So each player's actor number will be bound to an interest group. Only players subscribed to that group will be able to hear the player with that ActorNumber.

    Each player can have a sphere or circle (distance/perimeter) or any other collider surrounding the player and moves with it.
    This collider represents the range of the player's voice.
    Whenever a player enters a collider, he needs to subscribe to the interest group of that player (interest group = player actor number).
    This way you can hear that player.
    If you move away far enough from the player and exits the collider, unsubscribe from the interest group to stop hearing the player.

    Download the demo here and import it in your Photon Voice 2 project.
    This was tested with Photon Voice 2.8.
    The demo is an extension to the PUN2 integration based on PhotonVoiceView attached to a PUN prefab (with PhotonView).
    The main component class that does the proximity voice chat is ProximityVoiceTrigger.
  • harlanharlan
    edited July 2019
    hi @JohnTube

    Thanks for your so detailed answers.

    About the player number in one room,I have read the link, but 8 persons in a room is not enough for us.We now use self hosted server.To increase the persons in a Photon room,I think the following measures may help, please help check :
    • Improve cloud machine performance(CPU,memory,network bandwidth etc.)
    • Let PUN2(for player action sync and so on ) and photon voice(only for voice) use different photon master servers(since they can be configured separately).
    • Take your suggestions, about voice we can use interest groups and set a smaller scope,But we will set a larger range for player instantiation and action sync etc.. which can be seen by eyes.
    BTW, I know that VRChat uses Photon in their products, that's right??What measures do they adopt to let photon room accommodate more people?
  • Hi @harlan,

    There is no strict hard limit for the number of players per room or the number of messages per room per second.
    We just give you pointers and soft limits.
    We also want to guarantee the fair usage of the shared public cloud.
    On the other hand, you could try to optimize your game and make it work for your needs.

    VRChat uses Photon yes.
    They have a private cloud as an Enterprise Customer.
Sign In or Register to comment.