FAQ - aopacloud/aopa-rtc GitHub Wiki

Why_Background_Music_Cannot_Be_Adjusted_Through_System_Volume

Problem description

In the mobile device, the user plays background music in the background. After joining the RTC channel, the user cannot change the volume of background music by adjusting the system volume.

Cause of the problem

The volume types of mobile devices include call volume and media volume. In general, call volume is used for audio and video calls, and media volume is used for background music.

After the user joins the RTC channel, the volume type controlled by the sound network RTC SDK determines the volume type of the system volume control. When the SDK controls the call volume and the background music uses the media volume, the system volume can only control the call volume and cannot adjust the background music volume.

Solution

Scheme I

Use 'startAudioMixing' to play background music and let the SDK control the background music and call sound at the same time. No matter whether the SDK uses call volume or media volume, users can adjust the volume of background music and call sound through the system volume.

Scheme II

Through the 'setAudioScenario' method, set the 'scenario' parameter to 'GAME_STREAMING'/'AgoraAudioScenario GameStreaming', that is, set the volume type used by the SDK to media volume. After successful setting, the user can adjust the volume of background music and call sound simultaneously through the system volume.

Scheme 3

How_to_deal_with_audio_jam

The problem may involve network, equipment, physical environment and other reasons. It is commonly caused by the poor network of the client.

Step 1: Self check operation

Check whether the network is in good condition. You can switch to a 4G or more stable Wi Fi environment and try again. You can also confirm whether the user's network and device CPU are in normal use through the crystal ball service provided by VoiceNet.

Step 2: Contact technical support

If the problem still exists, please contact technical support and provide the following information to quickly locate the problem:

Info Details
Necessary information The channel name of the user who heard the voice jam, which users heard the voice jam, provide their user ID, which users caused the voice jam, provide their user ID, recording files (if any)
Optional information If it is a live scene, whether the Carton is from the anchor. If the video is displayed in the channel, check whether the video is played smoothly and clearly

Step 3: Manage the background monitoring call quality

How_to_avoid_the_volume_change_of_live_broadcast

In order to ensure a better audio quality experience in different scenarios, by default, the SDK will adjust the settings of the underlying audio when users load and unload videos:

  • Media volume control will be used in non connected mode.
  • The call volume control is used in connected mode.

There are independent volume control mechanisms for media volume and call volume.

If you want to avoid the volume change when loading and unloading the microphone, the Voice Network recommends using 'AUDIO_SCENARIO_CHATROOM'. The SDK uses different volume types in different cases

Why_iOS_or_Android_devices_cannot_answer_calls_through_Bluetooth_devices_after_they_are_connected_to_Bluetooth_devices

问题描述

When an iOS or Android device is connected to a Bluetooth device, it cannot make sound through the Bluetooth device during a call. The specific phenomena are as follows:

  • After connecting the Bluetooth headset, no sound can be heard through the Bluetooth headset when answering the phone.
  • After connecting the Bluetooth speaker, you cannot record or play sound through the Bluetooth speaker during a call.

IOS device

Cause of the problem

The above problems may be caused by the following three reasons:

  1. The iOS system will select audio routing for system calls and VoIP calls. System calls include calls made using the phone, FaceTime, and CallKit framework apps.

    default settings for system calls**

    After connecting a Bluetooth device:

    • If the user presses the answer key on the iPhone device, the iPhone handset is used by default to answer the call;
    • If the user presses the answer key on the Bluetooth device, the Bluetooth device will be used by default to answer the call.

    System default settings for VoIP calls

    After connecting a Bluetooth device:

    • If a system call or VoIP call has been made, the audio route used for the last system call or VoIP call is used by default to answer the call.
    • If there is no system call, the Bluetooth device is used by default to answer the call.
  2. The input and output audio routes on iOS devices must be the same. Only when the user or app specifies the Bluetooth device as the input or output audio route, the system will set the output or input audio route as a Bluetooth device by default.

  3. The recording function of Bluetooth speakers can only be used during system calls. If the app does not use the CallKit framework, users streaming in the channel cannot use Bluetooth speakers to record or play sounds, and users not streaming can only use Bluetooth speakers to play sounds.

Solution

You can use the corresponding method to set the voice playback route according to the actual call scenario.

System call

  • Before starting a system call, modify the audio call mode in the * * Settings * * of iPhone: slide down to display the search bar, search for * * audio call mode * *, and set * * audio call mode * * to * * Bluetooth headset * *. In this way, even if you press the answer key on the phone when the system calls, the Bluetooth headset will be used by default to answer the call.

  • During the system call, the user can also switch Bluetooth, earpiece or external amplifier by himself through the external button on the call interface.

  • If the Bluetooth device connected during the call is a Bluetooth speaker, please ensure that the app uses the CallKit framework before using the above method to set the voice playback route.

VoIP call

  • Before starting a VoIP call, the user can switch the audio route to a Bluetooth device through the system control center. The app can call the iOS native API 'setPreferredInput' method to switch the audio route to a Bluetooth device.
  • When a system call is received during a VoIP call with a Bluetooth headset, click the answer button on the Bluetooth headset to answer the system call. After the system call ends, switch back to the App to keep using the Bluetooth headset for calls.

Android device

Cause of the problem

  1. If you use the SDK before v4.1.0, you need to add the permission to use Bluetooth devices in the 'AndroidManifest. xml' file.
  2. Only Bluetooth devices that support SCO protocol can support recording and playing audio. If the Bluetooth device only supports the A2DP protocol, the audio cannot be recorded, and the user cannot use the Bluetooth device to talk.
  3. Only Android devices support the use of Bluetooth SCO when no system call is made can voice routing be switched to Bluetooth devices.

Solution

  1. Add the following line in the 'AndroidManifest. xml' file to obtain the permission to use Bluetooth devices:

    Java

    <uses-permission android:name="android.permission.BLUETOOTH" />  
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />  
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />  
    <-- If you use Android 12.0 and above devices, you also need to add the following permissions: --><uses permission android: name="android. permission. BLUETOOTH_CONNECT"/>
    
    
  2. Confirm whether the Bluetooth device supports SCO protocol. If not, switch Bluetooth devices that support SCO protocol.

  3. Call the Android native API 'AudioManmager. isBluetoothScoAvailableOffCall' method to determine whether the Android device supports the use of Bluetooth SCO when there is no system call. If the device does not support this function, the audio route cannot be switched to a Bluetooth device, and only the default route of the system can be used to answer calls.