Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by DeathPro · May 10 at 03:38 PM · apisunity3dsdksandroidwindows

Avoid hearing my own voice on PlayFab Party Voice Unity SDK with Photon - PUN 2

I have tested one user on Windows and the other on Android Device. I went away from my computer for making sure that my Laptop does not receive any audio. When I talk on my Android Device, I can hear my own voice and vice-versa. I think this makes echoes while on two applications I can hear my own voice.

How should I set the chat permission for that only the other persons on the same network can hear my voice?

Also if any player joins to a network that has already been created, let's say the fifth person joined for PlayFab Party Features, that fifth player calls "OnRemotePlayerJoined" callback for every other player in the same network.

(I am using Unity PlayFab SDK with Photon - PUN 2. And two players are in the same room and the same scene.)

Here is the OnRemotePlayerJoined function:

private void OnRemotePlayerJoined(object sender, PlayFabPlayer player)
{    
    SDK.PartyChatControlGetPermissions(PlayFabMultiplayerManager.Get().LocalPlayer._chatControlHandle, player._chatControlHandle,
        out PARTY_CHAT_PERMISSION_OPTIONS options);

    options = PARTY_CHAT_PERMISSION_OPTIONS.PARTY_CHAT_PERMISSION_OPTIONS_SEND_AUDIO |
              PARTY_CHAT_PERMISSION_OPTIONS.PARTY_CHAT_PERMISSION_OPTIONS_RECEIVE_AUDIO;
    
    SDK.PartyChatControlSetPermissions(PlayFabMultiplayerManager.Get().LocalPlayer._chatControlHandle, player._chatControlHandle,
        options);
}

Here is the OnNetworkJoined function:

private void OnNetworkJoined(object sender, string networkId)
{
    SDK.PartyChatControlSetAudioInput(PlayFabMultiplayerManager.Get().LocalPlayer._chatControlHandle,
    PARTY_AUDIO_DEVICE_SELECTION_TYPE.PARTY_AUDIO_DEVICE_SELECTION_TYPE_SYSTEM_DEFAULT, null, null);
SDK.PartyChatControlSetAudioOutput(PlayFabMultiplayerManager.Get().LocalPlayer._chatControlHandle,
    PARTY_AUDIO_DEVICE_SELECTION_TYPE.PARTY_AUDIO_DEVICE_SELECTION_TYPE_SYSTEM_DEFAULT, null, null);

SDK.PartyChatControlGetPermissions(PlayFabMultiplayerManager.Get().LocalPlayer._chatControlHandle, null,
    out PARTY_CHAT_PERMISSION_OPTIONS options);

options = PARTY_CHAT_PERMISSION_OPTIONS.PARTY_CHAT_PERMISSION_OPTIONS_SEND_AUDIO |
          PARTY_CHAT_PERMISSION_OPTIONS.PARTY_CHAT_PERMISSION_OPTIONS_RECEIVE_AUDIO;

SDK.PartyChatControlSetPermissions(PlayFabMultiplayerManager.Get().LocalPlayer._chatControlHandle, null,
    options);
}

If you have any additional info, please do not hesitate to ask.

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Rick Chen · May 11 at 06:59 AM

Please note that there are local chat control and remote chat control in the audio manipulation. For a local chat control, this is used to retrieve the microphone input; for a remote chat control, this is used to retrieve incoming voice audio. Please check if you have configured your local chat control. For more detail, please refer to Using real-time audio manipulation to apply custom voice effects - PlayFab | Microsoft Docs.

Comment

People who like this

0 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by DeathPro · May 11 at 04:00 PM

@Rick Chen Thank you for your kind support. I have managed to work on 2 Android devices.


Here is the OnRemotePlayerJoined function:

private void OnRemotePlayerJoined(object sender, PlayFabPlayer player)
{
    SDK.PartyChatControlGetPermissions(PlayFabMultiplayerManager.Get().LocalPlayer._chatControlHandle, player._chatControlHandle,
        out PARTY_CHAT_PERMISSION_OPTIONS options);

    options = PARTY_CHAT_PERMISSION_OPTIONS.PARTY_CHAT_PERMISSION_OPTIONS_RECEIVE_AUDIO |
              PARTY_CHAT_PERMISSION_OPTIONS.PARTY_CHAT_PERMISSION_OPTIONS_SEND_AUDIO;

    SDK.PartyChatControlSetPermissions(PlayFabMultiplayerManager.Get().LocalPlayer._chatControlHandle, player._chatControlHandle,
        options);
}
Here is the OnNetworkJoined function:
private void OnNetworkJoined(object sender, string networkID)
{
    SDK.PartyChatControlSetAudioInput(PlayFabMultiplayerManager.Get().LocalPlayer._chatControlHandle,
        PARTY_AUDIO_DEVICE_SELECTION_TYPE.PARTY_AUDIO_DEVICE_SELECTION_TYPE_SYSTEM_DEFAULT, null, null);
    SDK.PartyChatControlSetAudioOutput(PlayFabMultiplayerManager.Get().LocalPlayer._chatControlHandle,
        PARTY_AUDIO_DEVICE_SELECTION_TYPE.PARTY_AUDIO_DEVICE_SELECTION_TYPE_SYSTEM_DEFAULT, null, null);
}


This document (Platform support) says Real-time audio manipulation only works on Windows and Xbox. But this article is 2 years old. Is it still the same? Is the Audio Stream features available for Android and iOS with Unity3D?


If a player plays the game with a built-in speaker and microphone, the opponents hear their own voices because of the built-in microphone takes input from speaker. Is there anything we can do with PlayFab Party for it?


And while Bluetooth headphones were connected to one of the android devices, game voices suddenly stopped. But the other phone connected with wired headphones could hear game and chat voices. With Bluetooth headphones, I can listen to music and talk. It is working properly but I can not hear the game voices somehow. Is there something that I have missed?

Comment

People who like this

0 Show 1 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Rick Chen ♦ · May 16 at 06:47 AM 1
Share

The Real-time audio manipulation is not available for Android and iOS. PlayFab Party does not have feature to distinguish the noise and remove it.

For the issue that Bluetooth headphones cannot hear the game voice, it seems not related to the PlayFab Party. Please check your Bluetooth headphones and your System’s Audio setthings.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    13 People are following this question.

    avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

    Related Questions

    Apple (iOS) receipt validation in Unity IAP 1 Answer

    Timeout while buying huge bundle 2 Answers

    How to call advance drop tables? 1 Answer

    Using Custom Tags with Email verification rule 1 Answer

    Unauthorized error on LoginWithGoogleAccount 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges