Search Unity

Bug Trouble getting Bluetooth to work with Vivox SDK (15.1.200000-pre.1) on Android and iOS

Discussion in 'Vivox (Voice & Text Chat)' started by cf-ie, May 27, 2023.

  1. cf-ie

    cf-ie

    Joined:
    Feb 2, 2022
    Posts:
    13
    Hi everyone,

    I’m having trouble getting Bluetooth to work with the Vivox SDK (15.1.200000-pre.1) on both Android and iOS platforms. When the application initializes the Vivox client, connects to Vivox servers, and enables the microphone, all audio stops working through the Bluetooth device and instead uses the phone’s speakers and microphone. Otherwise, the game audio plays through the Bluetooth device just fine.

    When I query for the list of devices using the Client.AudioOutputDevices.AvailableDevices API after Vivox initializes, the Bluetooth device never shows up. I have also followed the instructions provided here: https://support.unity.com/hc/en-us/articles/4418155032724, but it did not help.

    Has anyone else experienced this issue or have any suggestions on how to resolve it?

    Thank you in advance for your help!
     
  2. cf-ie

    cf-ie

    Joined:
    Feb 2, 2022
    Posts:
    13
    I was able to fully get both game and communication audio through the Bluetooth device by interfacing with the Android layer directly. In short, I needed to enforce NORMAL mode and setting the communication device to use Bluetooth SCO. It's baffling that the Vivox SDK does not include a working implementation of this with its API.

    In getting this implemented, there's still some confusion around the Vivox implementation when a Vivox communication channel is joined. It appears that Vivox tries to dynamically set the device mode and also communication device. This is important to understand since I'd like to manually handle the device switches myself, since letting Vivox handle it automatically gives inconsistent results, especially when connecting and disconnecting Bluetooth devices.

    Does anyone know the details of how Vivox is supposed to handle the underlying Android device confiugrations, if they work as intended, and how to successfully manage those devices dynamically while in a Vivox communication channel?
     
  3. miraz_tiger

    miraz_tiger

    Joined:
    Mar 21, 2023
    Posts:
    4
    Is it possible to share your implementation? I am facing similar issue. Vivox voice chat always using loud-speaker instead of bluetooth head phone that I connect. Normally unity does use bluetooth but after connecting to voice channel loudspeaker becomes active.

    I have hardly any knowledge of android/iOS native. So could you share your implementation as an example to show how it can be done?

    Currently using vivox 15.1.210000-pre.1. Issue still exist.