Audio stream mode dynamic switching method, storage medium and electronic equipment

Through real -time monitoring of microphone status and Bluetooth headset connection status, dynamically adjust the audio flow mode, solve the problem of audio quality in existing technology and the problem of Bluetooth headset compatibility, and achieve higher audio quality and user experience.

CN119342393APending Publication Date: 2025-01-21GUIYANG YUWAN SCI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411442902.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The existing Android audio playback application selects a fixed audio streaming mode during initialization, and cannot switch dynamically, resulting in the inability to optimize audio quality and serious compatibility problems with Bluetooth headsets, resulting in Bluetooth no sound or speaker playback.

Method used

By monitoring the user's microphone state with the Bluetooth headset connection state in real time, the audio flow mode is dynamically adjusted. The specific implementation includes the target audio stream mode when the microphone state and/or the Bluetooth headset connection state change, and adjust the stream mode of the audio player according to this mode.

Benefits of technology

Improve the audio quality in multiplayer voice scenes, solve the problem of compatibility of Bluetooth headsets, and improve the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342393A_ABST
    Figure CN119342393A_ABST
Patent Text Reader

Abstract

The invention provides an audio stream mode dynamic switching method, a storage medium and electronic equipment, and is applied to an Android client in a multi-user voice scene, and the method comprises the following steps: in the multi-user voice scene, monitoring a microphone state and a Bluetooth earphone connection state of a current user in real time; when the microphone state and / or the Bluetooth headset connection state are / is changed, determining a target audio stream mode of the audio player based on the microphone state and the Bluetooth headset connection state of the current user; and adjusting the audio stream mode of the audio player based on the target audio stream mode. Therefore, the compatibility problem of the Bluetooth earphone can be solved, the audio quality in a multi-person voice scene can be improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of Android client development, and in particular to a method for dynamically switching audio streaming modes, a storage medium, and an electronic device. Background Art

[0002] When playing audio on a mobile device, the quality of the audio directly affects the user experience. The Android system provides a variety of audio streaming modes, such as media streaming, call streaming, system notification streaming, and other modes. These audio streaming modes have different priorities and sound quality performances in different application scenarios. However, current audio playback applications usually select an audio streaming mode during initialization, and cannot dynamically switch according to actual needs during playback, thereby limiting the optimization space for audio quality. In addition, some audio streaming modes will have compatibility issues when a Bluetooth headset is connected, resulting in problems such as no sound on Bluetooth and external speakers. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a method, storage medium and electronic device for dynamically switching audio streaming modes, so as to adjust the audio streaming mode of an audio player according to the connection status and microphone status of a Bluetooth headset, thereby improving the audio quality in multi-person voice scenarios and solving the compatibility problem of Bluetooth headsets.

[0004] In order to achieve the above purpose, the embodiments of the present application are implemented in the following manner:

[0005] In a first aspect, an embodiment of the present application provides a method for dynamically switching an audio streaming mode, which is applied to an Android client in a multi-person voice scenario, and the method includes: in a multi-person voice scenario, real-time monitoring of the microphone status and Bluetooth headset connection status of the current user; when the microphone status and / or the Bluetooth headset connection status changes, determining the target audio streaming mode of the audio player based on the microphone status and the Bluetooth headset connection status of the current user; and adjusting the audio streaming mode of the audio player based on the target audio streaming mode.

[0006] In combination with the first aspect, in a first possible implementation of the first aspect, before the current user enters a multi-person voice scene, the method also includes: when the current user enters the multi-person voice scene, obtaining the user's microphone status and Bluetooth headset connection status; determining the target audio stream mode of the audio player based on the user's microphone status and Bluetooth headset connection status; and initializing the audio player based on the target audio stream mode.

[0007] In combination with the first possible implementation method of the first aspect, in a second possible implementation method of the first aspect, the target audio stream mode of the audio player is determined according to the user's microphone status and the Bluetooth headset connection status, including: if the microphone status is mic-down, determining the media stream mode as the target audio stream mode of the audio player; if the microphone status is mic-up and the Bluetooth headset connection status is disconnected, determining the media stream mode as the target audio stream mode of the audio player; if the microphone status is mic-up and the Bluetooth headset connection status is connected, determining the call stream mode as the target audio stream mode of the audio player.

[0008] In combination with the first aspect, in a third possible implementation method of the first aspect, when the microphone state is switched from microphone down to microphone up, the target audio stream mode of the audio player is determined based on the microphone state of the current user and the connection state of the Bluetooth headset, including: correspondingly, based on the target audio stream mode, the audio stream mode of the audio player is adjusted, including: if the audio stream mode of the current audio player is the media stream mode, the audio player is recreated using the call stream mode; if the audio stream mode of the current audio player is the call stream mode, no adjustment is made; if the connection state of the Bluetooth headset is not connected, the media stream mode is determined to be the target audio stream mode of the audio player; correspondingly, based on the target audio stream mode, the audio stream mode of the audio player is adjusted, including: if the audio stream mode of the current audio player is the media stream mode, no adjustment is made; if the audio stream mode of the current audio player is the call stream mode, the audio player is recreated using the media stream mode.

[0009] In combination with the first aspect, in a fourth possible implementation method of the first aspect, when the microphone state is switched from microphone on to microphone off, the target audio stream mode of the audio player is determined based on the microphone state of the current user and the connection status of the Bluetooth headset, including: determining the media stream mode as the target audio stream mode of the audio player; correspondingly, based on the target audio stream mode, adjusting the audio stream mode of the audio player, including: if the audio stream mode of the current audio player is the media stream mode, no adjustment is made; if the audio stream mode of the current audio player is the call stream mode, recreating the audio player using the media stream mode.

[0010] In combination with the first aspect, in a fifth possible implementation of the first aspect, when the connection state of the Bluetooth headset switches from disconnected to connected, based on the microphone state of the current user and the connection state of the Bluetooth headset, the target audio stream mode of the audio player is determined, including: if the microphone state is microphone on, the call stream mode is determined to be the target audio stream mode of the audio player; correspondingly, based on the target audio stream mode, the audio stream mode of the audio player is adjusted, including: recreating the audio player using the call stream mode; if the microphone state is microphone off, the media stream mode is determined to be the target audio stream mode of the audio player; correspondingly, based on the target audio stream mode, the audio stream mode of the audio player is adjusted, including: if the audio stream mode of the current audio player is media stream mode, no adjustment is made; if the audio stream mode of the current audio player is call stream mode, the audio player is recreated using the media stream mode.

[0011] In combination with the first aspect, in a sixth possible implementation of the first aspect, when the connection state of the Bluetooth headset switches from connected to disconnected, based on the current user's microphone state and the Bluetooth headset connection state, the target audio stream mode of the audio player is determined, including: determining the media stream mode as the target audio stream mode of the audio player; correspondingly, based on the target audio stream mode, adjusting the audio stream mode of the audio player, including: if the audio stream mode of the current audio player is the media stream mode, no adjustment is made; if the audio stream mode of the current audio player is the call stream mode, recreating the audio player using the media stream mode.

[0012] In combination with the first aspect, in the seventh possible implementation of the first aspect, in a multi-person voice scenario, when the audio playback process of the audio player is restored after being interrupted, the method also includes: real-time monitoring of the current user's microphone status and Bluetooth headset connection status; if the microphone status is microphone down, determining the media stream mode as the target audio stream mode of the audio player; if the microphone status is microphone up and the Bluetooth headset connection status is disconnected, determining the media stream mode as the target audio stream mode of the audio player; if the microphone status is microphone up and the Bluetooth headset connection status is connected, determining the call stream mode as the target audio stream mode of the audio player; and recreating the audio player using the target audio stream mode.

[0013] In a second aspect, an embodiment of the present application provides a storage medium, which is arranged in an electronic device and includes a stored program, wherein when the program is running, the electronic device where the storage medium is located is controlled to execute the method for dynamically switching the audio stream mode as described in the first aspect or any one of the possible implementation methods of the first aspect.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, and when the program instructions are loaded and executed by the processor, the steps of the method for dynamically switching the audio stream mode described in the first aspect or any one of the possible implementation methods of the first aspect are implemented.

[0015] Beneficial effect: According to the research of the inventor of this scheme, in Android12 and above systems, when entering the multi-person chat room (multi-person voice scenario) of the Android client, the audio player is initialized to the call stream mode. If a Bluetooth headset is connected, and the sco mode (i.e. Bluetooth headset recording) is not started, it will cause external speaker problems: that is, the sound played does not come out of the Bluetooth headset, but is played from the speaker of the mobile phone; and the audio player in the call stream mode will have poor music quality when the music is live (such as music on demand in the room). If the audio player is initialized to media streaming mode when entering the room, then if some Android phones are connected to a Bluetooth headset and need to record the Bluetooth headset for a call, the Bluetooth headset will not hear any sound. Based on this situation, this scheme designs a method for dynamically switching audio streaming modes, which is applied to Android clients in multi-person voice scenarios. When entering a multi-person voice scenario, the user's microphone status and Bluetooth headset connection status are obtained; according to the user's microphone status and Bluetooth headset connection status, the target audio streaming mode of the audio player is determined; the audio player is initialized based on the target audio streaming mode. In a multi-person voice scenario, by monitoring the microphone status and Bluetooth headset connection status of the current user in real time, when the microphone status and / or Bluetooth headset connection status changes, the target audio stream mode of the audio player is determined based on the microphone status and Bluetooth headset connection status of the current user; thus, the audio stream mode of the audio player is adjusted based on the target audio stream mode. This can not only solve the compatibility problem of Bluetooth headsets, but also improve the audio quality in multi-person voice scenarios and enhance the user experience.

[0016] In multi-person voice scenarios, for various possible situations, such as the microphone state switching from mic-off to mic-on, the microphone state switching from mic-on to mic-off, the Bluetooth headset connection state switching from disconnected to connected, the Bluetooth headset connection state switching from connected to disconnected, and when the audio playback process of the audio player is interrupted and restored, etc., a targeted audio stream mode adjustment scheme for the audio player is designed to dynamically adjust the audio stream mode of the audio player in real time. In this way, in multi-person voice scenarios, various situations caused by Bluetooth compatibility issues can be avoided, the sound quality can be maintained as high as possible, the status is adjusted in real time, and users can have a better experience in multi-person voice scenarios.

[0017] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 The present invention provides a flowchart of a method for dynamically switching audio stream modes in a multi-person voice scenario according to an embodiment of the present application.

[0020] Figure 2 Flowchart for initializing the audio player.

[0021] Figure 3 The flowchart is for adjusting the audio stream mode when the microphone status is switched from mic-down to mic-up.

[0022] Figure 4 The flowchart is for adjusting the audio stream mode when the microphone status is switched from microphone-on to microphone-off.

[0023] Figure 5 A flowchart for adjusting the audio streaming mode when the Bluetooth headset connection state switches from unconnected to connected.

[0024] Figure 6 Flowchart for adjusting audio streaming mode when resuming the audio player after being interrupted. DETAILED DESCRIPTION

[0025] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0026] The inventor of this application has found that in Android 12 and above systems, when entering a multi-person chat room (multi-person voice scenario) of an Android client (applications developed by this unit such as Yuwan, Lemo, etc.), if the audio player is initialized to call stream mode, if a Bluetooth headset is connected and the SCO mode (i.e., Bluetooth headset recording) is not started, it will cause external speaker problems: that is, the sound played does not come out of the Bluetooth headset, but is played from the phone's built-in speakers; and the audio player in call stream mode has poor sound quality when the music is live (such as music on demand in the room). If the audio player is initialized to media streaming mode when entering the room, some Android phones will not hear any sound from the Bluetooth headset if they are connected to the Bluetooth headset and need to record the Bluetooth headset for a call.

[0027] Android 12 and above introduce some new features and improvements in audio management and Bluetooth connection. These features may affect the transmission method of audio streams and the compatibility of Bluetooth headsets. The following reasons may be the cause of the problem:

[0028] (1) SCO connection is not started: In a multi-person voice scenario, if the application does not start the SCO connection and only relies on the ordinary Bluetooth A2DP (Advanced Audio Distribution Profile) connection to transmit audio, it may cause audio playback problems due to the characteristics of the A2DP connection (such as high latency).

[0029] (2) Audio streaming mode setting: When the audio player is initialized to call streaming mode, the system may expect to transmit the audio through the SCO connection. If the SCO connection is not established, the system may fall back to using the phone's speakers to play the audio.

[0030] (3) System permissions and audio policies: The Android system has a complex set of permissions and policies for audio playback. If the application does not have sufficient permissions to set the audio policy, the audio may not be properly transmitted through the Bluetooth headset.

[0031] So, the above is an analysis of the problems and causes. In order to overcome the compatibility issues of Bluetooth headsets and consider improving the sound quality of users in multi-person chat rooms (media streaming mode has better sound quality than call streaming mode), this solution designs a method for dynamically switching audio streaming modes. Using this mechanism, considering various possible switching states in the scene, the audio streaming mode of the audio player is switched in real time to improve the user experience. The following will introduce the method for dynamically switching audio streaming modes from the perspective of the Android client.

[0032] See also Figure 1 , Figure 1 The flowchart of the method for dynamically switching the audio stream mode in a multi-person voice scenario provided by an embodiment of the present application. In this embodiment, the method for dynamically switching the audio stream mode may include step S10, step S20, and step S30.

[0033] Since steps S10-S30 of the audio stream mode dynamic switching method are applied in a multi-person voice scenario, and when the user enters the multi-person voice scenario, the audio stream mode initialization of the audio player is also involved. Therefore, before running step S10, that is, before the current user enters the multi-person voice scenario, the Android client also needs to perform the audio player initialization process.

[0034] See also Figure 2 , Figure 2 Flowchart for initializing the audio player.

[0035] Before the current user enters the multi-person voice scene, the Android client needs to monitor. When the current user enters the multi-person voice scene, the Android client can obtain the current user's microphone status (microphone on: the state of enabling microphone recording to talk with others is called microphone on. At this time, the user's own speech can be heard by others, and the user can also hear others talking; microphone off: the scene of not enabling microphone recording is called microphone off. At this time, the user's own speech cannot be heard by others, but can hear others talking) and Bluetooth headset connection status (connected and not connected).

[0036] Then, the Android client can determine the target audio stream mode of the audio player according to the user's microphone status and the Bluetooth headset connection status.

[0037] Exemplarily, if the microphone state is mic-off, the media stream mode is determined to be the target audio stream mode of the audio player. It should be noted that there are actually two subdivisions here: if the microphone state is mic-off and the Bluetooth headset connection state is not connected, the media stream mode is determined to be the target audio stream mode of the audio player; and if the microphone state is mic-off and the Bluetooth headset connection state is connected, the media stream mode is also determined to be the target audio stream mode of the audio player.

[0038] If the microphone status is on and the Bluetooth headset connection status is not connected, the media stream mode is determined to be the target audio stream mode of the audio player; if the microphone status is on and the Bluetooth headset connection status is connected, the call stream mode is determined to be the target audio stream mode of the audio player.

[0039] After determining the target audio stream mode of the audio player, the Android client can initialize the audio player based on the target audio stream mode. For example, when the target audio stream mode is the media stream mode, the audio player is initialized using the audio stream mode, that is, the audio player adopts the media stream mode; and when the target audio stream mode is the call stream mode, the audio player is initialized using the call stream mode, that is, the audio player adopts the call stream mode.

[0040] After entering the multi-person voice scenario, the Android client may execute step S10.

[0041] Step S10: In a multi-person voice scenario, monitor the microphone status and Bluetooth headset connection status of the current user in real time.

[0042] In this embodiment, the Android client can monitor the microphone status and Bluetooth headset connection status of the current user in real time. That is, the Android client needs to monitor in real time whether the microphone status of the current user is microphone up or microphone down, and whether the Bluetooth headset connection status is connected or not connected.

[0043] When a change in the microphone status and / or the Bluetooth headset connection status is detected, the Android client executes step S20.

[0044] Step S20: When the microphone state and / or the Bluetooth headset connection state changes, the target audio stream mode of the audio player is determined based on the microphone state and the Bluetooth headset connection state of the current user.

[0045] When the microphone state and / or the Bluetooth headset connection state changes, the Android client can determine the target audio stream mode of the audio player based on the microphone state and the Bluetooth headset connection state of the current user.

[0046] To facilitate a more logical introduction to the subsequent steps, a detailed introduction to the solution for determining the target audio stream mode of the audio player will not be expanded here, and will be introduced in detail later.

[0047] After determining the target audio streaming mode of the audio player, the Android client may execute step S30.

[0048] Step S30: Based on the target audio stream mode, adjust the audio stream mode of the audio player.

[0049] In this embodiment, the Android client can adjust the audio streaming mode of the audio player based on the target audio streaming mode.

[0050] Now, various situations when the microphone state and / or the Bluetooth headset connection state changes in step S20 are analyzed in detail:

[0051] Since changes in the microphone state and / or the Bluetooth headset connection state include not only a single state change but also simultaneous changes, but the state switching time is extremely short, and in a multi-person voice scenario, they usually change one after another (i.e. there are intervals), and simultaneous changes are rare. Therefore, this solution is designed based on a single state change and makes a comprehensive judgment (for example, if the microphone state changes, the Bluetooth headset connection state is also considered when determining the target audio stream mode) to determine the target audio stream mode of the audio player.

[0052] Therefore, this embodiment analyzes a single state change:

[0053] Case 1: When the microphone status is switched from mic-off to mic-on:

[0054] If the connection status of the Bluetooth headset is connected, the call stream mode is determined to be the target audio stream mode of the audio player.

[0055] Since the microphone status is switched from microphone down to microphone up, the previous microphone status is microphone down, and no matter what the Bluetooth headset connection status is, the current audio player should be in media streaming mode. Therefore, the corresponding step S30 is specifically: the Android client recreates the audio player using the call streaming mode.

[0056] If the connection state of the Bluetooth headset is not connected, the media stream mode is determined to be the target audio stream mode of the audio player.

[0057] Similarly, since the microphone state is switched from mic-down to mic-up, the previous microphone state is mic-down, and no matter what the Bluetooth headset connection state is, the current audio player should be in media streaming mode. Therefore, the corresponding step S30 is specifically: no adjustment is made.

[0058] Of course, if various unexpected situations are considered (such as continuous changes in microphone status in a short period of time) to improve the stability of audio stream mode switching, a complete judgment and adjustment process is required, such as Figure 3 As shown:

[0059] When the connection state of the Bluetooth headset is connected, the call stream mode is determined to be a target audio stream mode of the audio player.

[0060] Correspondingly, step S30 is specifically as follows: if the audio stream mode of the current audio player is the media stream mode, recreate the audio player using the call stream mode; if the audio stream mode of the current audio player is the call stream mode, do not make any adjustments.

[0061] When the connection state of the Bluetooth headset is not connected, the media stream mode is determined to be a target audio stream mode of the audio player.

[0062] Correspondingly, step S30 is specifically as follows: if the audio stream mode of the current audio player is the media stream mode, no adjustment is made; if the audio stream mode of the current audio player is the call stream mode, the audio player is recreated using the media stream mode.

[0063] Case 2: When the microphone status is switched from mic-up to mic-down:

[0064] Regardless of whether the Bluetooth headset connection state is connected or not connected, the media stream mode is determined to be a target audio stream mode of the audio player.

[0065] like Figure 4As shown, correspondingly, step S30 is specifically as follows: if the audio stream mode of the current audio player is the media stream mode, no adjustment is made; if the audio stream mode of the current audio player is the call stream mode, the audio player is recreated using the media stream mode.

[0066] Case 3: When the Bluetooth headset connection status changes from unconnected to connected:

[0067] If the microphone status is on, determine that the call stream mode is the target audio stream mode of the audio player.

[0068] Since the Bluetooth headset connection state is switched from unconnected to connected, the Bluetooth headset connection state is previously unconnected, and no matter what the microphone state is, the current audio player should be in media stream mode. Therefore, the corresponding step S30 is specifically: re-create the audio player in call stream mode.

[0069] If the microphone state is microphone down, determine that the media stream mode is the target audio stream mode of the audio player.

[0070] Similarly, since the Bluetooth headset connection state is switched from unconnected to connected, the Bluetooth headset connection state is previously unconnected, and no matter what the microphone state is, the current audio player should be in the media streaming mode. Therefore, the corresponding step S30 is specifically: no adjustment is made.

[0071] Similarly, if various unexpected situations are considered (such as the continuous change of the Bluetooth headset connection status in a short period of time), in order to improve the stability of the audio stream mode switching, a complete judgment and adjustment process is required, such as Figure 5 As shown:

[0072] If the microphone status is on, determine that the call stream mode is the target audio stream mode of the audio player.

[0073] Correspondingly, step S30 is specifically as follows: if the audio stream mode of the current audio player is the call stream mode, no adjustment is made; if the audio stream mode of the current audio player is the media stream mode, the audio player is recreated using the call stream mode.

[0074] If the microphone state is microphone down, determine that the media stream mode is the target audio stream mode of the audio player.

[0075] Correspondingly, step S30 is specifically as follows: if the audio stream mode of the current audio player is the media stream mode, no adjustment is made; if the audio stream mode of the current audio player is the call stream mode, the audio player is recreated using the media stream mode.

[0076] Case 4: When the Bluetooth headset connection status changes from connected to disconnected:

[0077] Regardless of whether the microphone state is microphone-up or microphone-down, the media stream mode is determined to be the target audio stream mode of the audio player.

[0078] Correspondingly, step S30 is specifically as follows: if the audio stream mode of the current audio player is the media stream mode, no adjustment is made; if the audio stream mode of the current audio player is the call stream mode, the audio player is recreated using the media stream mode.

[0079] In addition, in a multi-person voice scenario, the audio player in the room may be interrupted by various situations, such as interruptions caused by phone calls or other audio applications. In this case, there will be an interruption recovery situation.

[0080] Case 5: When resuming the audio playback process of the audio player after it is interrupted:

[0081] The Android client can monitor the current user's microphone status and Bluetooth headset connection status in real time.

[0082] like Figure 6 As shown, if the microphone state is mic-off, the media stream mode is determined to be the target audio stream mode of the audio player; if the microphone state is mic-on and the Bluetooth headset connection state is not connected, the media stream mode is determined to be the target audio stream mode of the audio player; if the microphone state is mic-on and the Bluetooth headset connection state is connected, the call stream mode is determined to be the target audio stream mode of the audio player. Then, the Android client can recreate the audio player using the target audio stream mode (e.g., media stream mode or call stream mode).

[0083] This solution uses the call stream mode for the audio player when the microphone is in the on state and the Bluetooth headset is in the connected state, and uses the media stream mode in other cases. This can effectively solve the compatibility problem of Bluetooth headsets. While avoiding the compatibility problem of Bluetooth headsets, it can switch the audio stream mode of the audio player in multi-person voice scenarios in real time, provide users with good sound quality as much as possible, and improve user experience.

[0084] This embodiment provides a storage medium, which is set in an electronic device and includes a stored program. When the program is running, the electronic device where the storage medium is located is controlled to execute the audio stream mode dynamic switching method of this embodiment.

[0085] In addition, this embodiment also provides an electronic device (a smart terminal, such as a smart phone, a tablet computer, etc., in which an Android client is installed), including a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, and when the program instructions are loaded and executed by the processor, the steps of the audio stream mode dynamic switching method of this embodiment are implemented.

[0086] In summary, the embodiments of the present application provide a method for dynamically switching audio streaming modes, a storage medium, and an electronic device. The present solution designs a method for dynamically switching audio streaming modes, which is applied to an Android client in a multi-person voice scenario. When entering a multi-person voice scenario, the user's microphone status and Bluetooth headset connection status are obtained; the target audio streaming mode of the audio player is determined according to the user's microphone status and Bluetooth headset connection status; and the audio player is initialized based on the target audio streaming mode. In a multi-person voice scenario, by real-time monitoring the current user's microphone status and Bluetooth headset connection status, when the microphone status and / or Bluetooth headset connection status changes, the target audio streaming mode of the audio player is determined based on the current user's microphone status and Bluetooth headset connection status; thereby adjusting the audio streaming mode of the audio player based on the target audio streaming mode. This can not only solve the compatibility problem of Bluetooth headsets, but also improve the audio quality in multi-person voice scenarios and enhance user experience.

[0087] In multi-person voice scenarios, for various possible situations, such as the microphone state switching from mic-off to mic-on, the microphone state switching from mic-on to mic-off, the Bluetooth headset connection state switching from disconnected to connected, the Bluetooth headset connection state switching from connected to disconnected, and when the audio playback process of the audio player is interrupted and restored, etc., a targeted audio stream mode adjustment scheme for the audio player is designed to dynamically adjust the audio stream mode of the audio player in real time. In this way, in multi-person voice scenarios, various situations caused by Bluetooth compatibility issues can be avoided, the sound quality can be maintained as high as possible, the status is adjusted in real time, and users can have a better experience in multi-person voice scenarios.

[0088] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for dynamically switching audio stream modes, characterized in that: Applied to an Android client in a multi-person voice scenario, the method includes: In multi-person voice scenarios, real-time monitoring of the current user's microphone status and Bluetooth headset connection status; When the microphone state and / or the Bluetooth headset connection state changes, determining a target audio stream mode of the audio player based on the microphone state and the Bluetooth headset connection state of the current user; Adjust the audio streaming mode of the audio player based on the target audio streaming mode.

2. The method for dynamically switching audio stream modes according to claim 1, characterized in that: Before the current user enters the multi-person voice scene, the method further includes: When the current user enters a multi-person voice scene, obtain the user's microphone status and Bluetooth headset connection status; Determine the target audio streaming mode of the audio player according to the user's microphone status and the Bluetooth headset connection status; Initializes the audio player based on the target audio streaming mode.

3. The method for dynamically switching audio stream modes according to claim 2, characterized in that: According to the user's microphone status and Bluetooth headset connection status, the target audio stream mode of the audio player is determined, including: If the microphone state is microphone down, determine the media stream mode to be the target audio stream mode of the audio player; If the microphone status is on and the Bluetooth headset connection status is not connected, determine that the media stream mode is the target audio stream mode of the audio player; If the microphone status is on and the Bluetooth headset connection status is connected, determine that the call stream mode is the target audio stream mode of the audio player.

4. The method for dynamically switching audio stream modes according to claim 1, characterized in that: When the microphone status is switched from microphone down to microphone up, the target audio stream mode of the audio player is determined based on the microphone status of the current user and the Bluetooth headset connection status, including: If the Bluetooth headset connection status is connected, determine that the call stream mode is a target audio stream mode of the audio player; Correspondingly, based on the target audio stream mode, the audio stream mode of the audio player is adjusted, including: If the audio stream mode of the current audio player is media stream mode, recreate the audio player using call stream mode; If the current audio player's audio stream mode is call stream mode, no adjustment is made; If the connection status of the Bluetooth headset is not connected, determine that the media stream mode is a target audio stream mode of the audio player; Correspondingly, based on the target audio stream mode, the audio stream mode of the audio player is adjusted, including: If the audio stream mode of the current audio player is media stream mode, no adjustment is made; If the audio stream mode of the current audio player is call stream mode, recreate the audio player using media stream mode.

5. The method for dynamically switching audio stream modes according to claim 1, characterized in that: When the microphone status is switched from microphone-up to microphone-down, the target audio stream mode of the audio player is determined based on the current user's microphone status and Bluetooth headset connection status, including: Determine the media stream mode as the target audio stream mode of the audio player; Correspondingly, based on the target audio stream mode, the audio stream mode of the audio player is adjusted, including: If the audio stream mode of the current audio player is media stream mode, no adjustment is made; If the audio stream mode of the current audio player is call stream mode, recreate the audio player using media stream mode.

6. The method for dynamically switching audio stream modes according to claim 1, characterized in that: When the Bluetooth headset connection state switches from unconnected to connected, the target audio stream mode of the audio player is determined based on the current user's microphone state and the Bluetooth headset connection state, including: If the microphone status is on, determine the call stream mode to be the target audio stream mode of the audio player; Correspondingly, based on the target audio stream mode, the audio stream mode of the audio player is adjusted, including: Recreate the audio player using call stream mode; If the microphone state is microphone down, determine the media stream mode to be the target audio stream mode of the audio player; Correspondingly, based on the target audio stream mode, the audio stream mode of the audio player is adjusted, including: If the audio stream mode of the current audio player is media stream mode, no adjustment is made; If the audio stream mode of the current audio player is call stream mode, recreate the audio player using media stream mode.

7. The method for dynamically switching audio stream modes according to claim 1, characterized in that: When the Bluetooth headset connection state switches from connected to disconnected, the target audio stream mode of the audio player is determined based on the current user's microphone state and the Bluetooth headset connection state, including: Determine the media stream mode as the target audio stream mode of the audio player; Correspondingly, based on the target audio stream mode, the audio stream mode of the audio player is adjusted, including: If the audio stream mode of the current audio player is media stream mode, no adjustment is made; If the audio stream mode of the current audio player is call stream mode, recreate the audio player using media stream mode.

8. The method for dynamically switching audio stream modes according to claim 1, characterized in that: In a multi-person voice scenario, when the audio player resumes the audio playback process after being interrupted, the method further includes: Monitor the current user's microphone status and Bluetooth headset connection status in real time; If the microphone state is microphone down, determine the media stream mode to be the target audio stream mode of the audio player; If the microphone status is on and the Bluetooth headset connection status is not connected, determine that the media stream mode is the target audio stream mode of the audio player; If the microphone status is on and the Bluetooth headset connection status is connected, determine that the call stream mode is the target audio stream mode of the audio player; Recreate the audio player using the target audio streaming mode.

9. A storage medium, characterized in that: The storage medium is set in the electronic device, and includes a stored program, wherein when the program is running, the electronic device where the storage medium is located is controlled to execute the audio stream mode dynamic switching method according to any one of claims 1 to 8.

10. An electronic device comprising a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, characterized in that: When the program instructions are loaded and executed by the processor, the steps of the method for dynamically switching the audio stream mode according to any one of claims 1 to 8 are implemented.