Audio switching method and device and storage medium

By delaying sending audio playback permissions after the electronic device call is over until the connection status and audio playback mode status of the external device are switched, the sound playback problem caused by the rapid transfer of audio playback permissions is solved, and the user experience is improved.

CN119484693APending Publication Date: 2025-02-18BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310994255.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-08
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

When the electronic device switches from the call state to the audio playback state, the audio playback permission is transferred too quickly, causing the sound to be played from the handset of the electronic device, affecting the user experience.

Method used

After the electronic device call is over, determine the connection status and audio playback mode status of the external device, and delay sending audio playback permissions until the connection status and audio playback mode status are switched to the appropriate state.

Benefits of technology

By delaying sending audio playback permission, ensure that the sound is output from the external device after the connection state and audio playback mode switch is completed, avoiding sound playback and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484693A_ABST
    Figure CN119484693A_ABST
Patent Text Reader

Abstract

The invention relates to an audio switching method and device and a storage medium. The audio switching method comprises the following steps: in response to an audio playing permission released when a call of the electronic equipment is ended, determining a connection state and an audio mode playing state of external playing equipment of the electronic equipment; based on the connection state and the audio mode playing state, sending an audio playing permission to a first application program operated by the electronic equipment; the first application program is an application program having an audio playing permission before the electronic equipment executes the call. According to the invention, a sound playing phenomenon generated by audio switching between a call and an application program can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of audio control, and in particular to an audio switching method, device and storage medium. Background Art

[0002] It has become a common phenomenon that electronic devices use external devices to prevent the sound generated when using audio and video playback applications from being played externally. If only audio and video playback applications are used, external devices can indeed be used to prevent the sound from being played externally. However, when the user uses the audio and video playback application to make a call, and returns to the audio playback application to play the audio after the call ends, the sound may be played from the earpiece of the electronic device, affecting the user experience. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the present disclosure provides an audio switching method, device and storage medium.

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an audio switching method, comprising: in response to releasing the audio playback permission when a call on an electronic device ends, determining the connection status of an external playback device of the electronic device and the audio mode playback status; based on the connection status and the audio mode playback status, sending the audio playback permission to a first application running on the electronic device; the first application is an application that holds the audio playback permission before the electronic device executes the call.

[0005] In one embodiment, the sending of the audio playback permission to the first application running on the electronic device based on the connection status and the audio mode playback status includes: if the connection status is a call connection status, or the audio mode playback status is a status of playing the call, then delaying sending the audio playback permission to the first application running on the electronic device.

[0006] In one embodiment, the delay in sending the audio playback permission to the first application running on the electronic device includes: determining the connection status and the audio mode playback status after delaying according to the delay time; if the connection status is the audio playback connection status and the audio mode playback status is the status of playing the audio of the first application, sending the audio playback permission to the first application running on the electronic device.

[0007] In one embodiment, the delay of sending the audio playback permission to the first application running on the electronic device includes: at the i-th delay, after the i-th delay time, determining the connection status and the audio mode playback status, where i is a positive integer greater than or equal to 1; if the connection status is a call connection status, or the audio mode playback status is a status of playing the call, performing the i+1th delay; at the i+1th delay, after the i+1th delay time, repeatedly determining the connection status and the audio mode playback status until the connection status is a connection status, and the audio mode playback status is a status of playing the audio of the first application; the duration corresponding to the i+1th delay time is less than the duration corresponding to the i-th delay time; if the connection status is an audio playback connection status, and the audio mode playback status is a status of playing the audio of the first application, sending the audio playback permission to the first application running on the electronic device.

[0008] In one embodiment, sending the audio playback permission to the first application running on the electronic device includes: during the i-th delay, if i is equal to a delay number threshold, sending the audio playback permission to the first application running on the electronic device after delaying for the i-th delay time.

[0009] In one embodiment, the sending of the audio playback permission to the first application running on the electronic device based on the connection status and the audio mode playback status includes: if the connection status is an audio playback connection status, and the audio mode playback status is a status of playing the audio of the first application, sending the audio playback permission to the application running on the electronic device.

[0010] In one embodiment, the method further includes: in response to a second application of the electronic device requesting the audio playback permission, sending the audio playback permission to a second application running on the electronic device; the second application is an application other than the first application.

[0011] In one embodiment, the electronic device call includes a call initiated by an application and a call initiated by the electronic device's own call program, the external playback device of the electronic device is a Bluetooth external device, the connection state is a Bluetooth connection state, and the first application is an audio and video playback application.

[0012] According to a second aspect of an embodiment of the present disclosure, an audio switching device is provided, including: a detection unit, for determining a connection status of an external playback device of the electronic device and an audio mode playback status in response to releasing an audio playback permission when a call on the electronic device ends; a processing unit, for sending the audio playback permission to a first application running on the electronic device based on the connection status and the audio mode playback status; the first application is an application that holds the audio playback permission before the electronic device executes the call.

[0013] In one embodiment, the processing unit sends the audio playback permission to the first application running on the electronic device based on the connection status and the audio mode playback status in the following manner: if the connection status is a call connection status, or the audio mode playback status is a status of playing the call, then delay sending the audio playback permission to the first application running on the electronic device.

[0014] In one embodiment, the processing unit delays sending the audio playback permission to the first application running on the electronic device in the following manner: after delaying according to the delay time, determining the connection status and the audio mode playback status; if the connection status is the audio playback connection status, and the audio mode playback status is the status of playing the audio of the first application, sending the audio playback permission to the first application running on the electronic device.

[0015] In one embodiment, the processing unit delays sending the audio playback permission to the first application running on the electronic device in the following manner: at the i-th delay, after the i-th delay time, determining the connection status and the audio mode playback status, where i is a positive integer greater than or equal to 1; if the connection status is a call connection status, or the audio mode playback status is a status of playing the call, performing the i+1th delay; at the i+1th delay, after the i+1th delay time, repeatedly determining the connection status and the audio mode playback status until the connection status is a connection status, and the audio mode playback status is a status of playing the audio of the first application; the duration corresponding to the i+1th delay time is less than the duration corresponding to the i-th delay time; if the connection status is an audio playback connection status, and the audio mode playback status is a status of playing the audio of the first application, sending the audio playback permission to the first application running on the electronic device.

[0016] In one embodiment, the processing unit sends the audio playback permission to the first application running on the electronic device in the following manner: during the i-th delay, if i is equal to a delay number threshold, the audio playback permission is sent to the first application running on the electronic device after delaying the i-th delay time.

[0017] In one embodiment, the processing unit sends the audio playback permission to the first application running on the electronic device based on the connection status and the audio mode playback status in the following manner: if the connection status is an audio playback connection status and the audio mode playback status is a status of playing the audio of the first application, the audio playback permission is sent to the application running on the electronic device.

[0018] In one embodiment, the processing unit is further used to: in response to a second application of the electronic device requesting the audio playback permission, send the audio playback permission to a second application running on the electronic device; the second application is an application other than the first application.

[0019] In one embodiment, the electronic device call includes a call initiated by an application and a call initiated by the electronic device's own call program, the external playback device of the electronic device is a Bluetooth external device, the connection state is a Bluetooth connection state, and the first application is an audio and video playback application.

[0020] According to a third aspect of an embodiment of the present disclosure, there is provided an audio playback device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to: execute the method described in the first aspect or any one of the implementations of the first aspect.

[0021] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, in which instructions are stored. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the method described in the first aspect or any one of the implementations of the first aspect.

[0022] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: by transferring the audio playback authority after determining the connection status and audio playback mode status between the electronic device and the external device after the call on the electronic device ends, the phenomenon of external sound playback caused by the transfer of audio playback authority being faster than the switching of the connection status and the audio playback mode status is avoided.

[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0025] Figure 1 The figure is a flow chart of an audio switching method according to an exemplary embodiment.

[0026] Figure 2 The invention is a flowchart showing delayed audio switching according to an exemplary embodiment.

[0027] Figure 3 The invention is a flowchart showing a method of delaying the sending of audio playing permission according to a delay time according to an exemplary embodiment.

[0028] Figure 4 The invention is a flowchart showing one or more delayed sending of audio playing permission according to an exemplary embodiment.

[0029] Figure 5 The present invention is a flowchart of performing audio switching according to an exemplary embodiment.

[0030] Figure 6 The figure is a block diagram of an audio switching device according to an exemplary embodiment.

[0031] Figure 7 It is a block diagram showing a device for audio switching according to an exemplary embodiment. DETAILED DESCRIPTION

[0032] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure.

[0033] The audio switching method provided by the present disclosure is applied to the scenario where an electronic device is connected to an external audio playback device for audio playback. When using an electronic device for audio playback, it is often necessary to connect an external device to meet the user's usage needs. When an electronic device runs an audio playback program for audio playback, it is usually necessary to assign audio playback permissions to the corresponding audio playback application. When using an electronic device to make calls and switch between audio playback applications, the audio playback permissions of the electronic device will be transferred, and the connection status with the external device and the audio playback mode will change. Because the transfer of audio playback permissions is usually faster than the change of the connection status of the external device and the audio playback mode, switching between calls and audio playback applications at this time may cause the sound on the electronic device to be played externally.

[0034] The electronic devices in the embodiments of the present disclosure include mobile phones, computers, televisions and other electronic devices that can be connected to external devices for audio playback. The external devices include LAN connection devices, wired connection devices, Bluetooth connection devices and other external devices, such as Bluetooth headsets, wired headsets, etc.

[0035] For example, when a mobile phone is connected to a Bluetooth headset and an audio and video playback application is used, the audio playback permission will be occupied, and the connection status between the mobile phone and the Bluetooth headset will change to the A2DP (Advanced Audio Distribution Profile, Bluetooth audio transmission model protocol) state. At this time, if a call is received, the audio playback permission will be transferred to the call application when answering the call, and the connection status between the mobile phone and the Bluetooth headset will change to the SCO (Synchronous Connection Oriented link, connection-oriented synchronous link, usually used for voice data transmission) state. When the call is over, the system of the electronic device will automatically transfer the music playback permission to the previously used audio and video playback program, and switch the connection status and audio mode to the corresponding state of audio playback. However, due to the system's own processing method, the music playback permission is transferred to the previously used audio and video playback program before the connection status and audio mode are switched, and because there is a time interval in the process of switching the connection status from SCO to A2DP and the audio mode has not been switched, the sound will be emitted from the mobile phone instead of from the external Bluetooth headset, resulting in the phenomenon of external sound.

[0036] In view of this, the present disclosure proposes an audio switching method, device and storage medium. The connection status between the electronic device and the external device and the audio mode playback status are determined when the audio playback permission is released after the voice call of the electronic device ends, and then the audio playback permission is transferred. The audio playback permission is transferred after the connection status and the audio mode playback status are switched, thereby solving the problem of external sound caused by the too fast transfer of audio playback permission.

[0037] The following describes how to switch audio.

[0038] Figure 1 is a flow chart of an audio switching method according to an exemplary embodiment. Figure 1 As shown, the audio switching method is used in an electronic device and includes the following steps.

[0039] In step S11, in response to the electronic device releasing the audio play permission when a call ends, the connection state of an external play device of the electronic device and the audio mode play state are determined.

[0040] In the disclosed embodiment, the audio playback permission is the permission allowed by the electronic device system to play audio, and the audio and video playback application needs to obtain the audio playback permission to play audio. During a call, the call application will occupy the audio playback permission, and when the call ends, the audio playback permission will be released, at which time the audio playback permission can be occupied again. The connection status of the external playback device of the electronic device has different corresponding connection states according to different external playback devices and different applications. The audio mode playback state may also have different audio mode playback states corresponding to different applications.

[0041] In step S12, based on the connection state and the audio mode play state, the audio play permission is sent to the first application running on the electronic device, where the first application is the application that holds the audio play permission before the electronic device executes the call.

[0042] In the disclosed embodiment, the audio playback permission is released after the call is over and is not occupied by other applications. After determining the connection status and the audio mode playback status, the electronic device system will send the music playback permission to the application that occupied the audio playback permission before the call, thereby avoiding the phenomenon of external sound playback caused by the system sending the music playback permission before the connection status and the audio mode playback status are switched.

[0043] In one implementation, when a call on an electronic device ends, the audio playback permission is released, and the electronic device system determines the connection status of an external playback device of the electronic device and the audio mode playback status, and makes a judgment based on the connection status and the audio mode playback status to decide whether to send the audio playback permission to the application before the call to achieve audio switching.

[0044] Figure 2 The invention is a flowchart showing delayed audio switching according to an exemplary embodiment.

[0045] In step S21, in response to the electronic device releasing the audio play permission when a call ends, the connection state of an external play device of the electronic device and the audio mode play state are determined.

[0046] In the embodiment of the present disclosure, step S21 is the same as step S11 in the above embodiment, so it will not be described again.

[0047] In step S22, if the connection state is a call connection state, and the audio mode playing state is a call playing state, then sending the audio playing permission to the first application running on the electronic device is delayed.

[0048] In the embodiment of the present disclosure, if the connection state is a call connection state, and the audio mode playback state is a call playback state, it means that the connection state and the audio mode playback state have not switched to the state required by the audio playback application. Therefore, it is necessary to delay sending the audio playback permission to the audio playback application to avoid the phenomenon of external sound playback.

[0049] In one embodiment, when a call of the electronic device ends, if the connection state is the call connection state and the audio mode playback state is the call playback state, the audio playback permission cannot be transferred. The sending of the audio playback permission can be delayed so that the transfer of the audio playback permission is after the switching of the connection state and the audio mode playback state, thereby avoiding the phenomenon of external sound playback.

[0050] In the above embodiment, it is mentioned that the phenomenon of sound being played outward can be avoided by delaying the sending of audio playback permission. The following describes the process of how to delay the sending of audio playback permission to achieve delayed audio switching.

[0051] Figure 3 The invention is a flowchart showing a method of delaying the sending of audio playing permission according to a delay time according to an exemplary embodiment.

[0052] In step S31, after delaying according to the delay time, the connection status and the audio mode playing status are determined.

[0053] In the embodiment of the present disclosure, the delay time is a fixed time duration pre-set according to actual needs. Determining the connection state and the audio mode playing state is to determine the connection state and the audio mode playing state after delaying the sending of the audio playing permission.

[0054] In step S32, if the connection state is an audio playing connection state, and the audio mode playing state is a state of playing the audio of the first application, an audio playing permission is sent to the first application running on the electronic device.

[0055] In the disclosed embodiment, if the connection state is an audio playback connection state, and the audio mode playback state is a state of playing the audio of the first application, the transfer of audio playback authority by the electronic device system will not cause the electronic device to produce sound externally.

[0056] In one implementation, after releasing the audio playback permission in response to the end of a call, the sending of the audio playback permission is delayed according to a preset delay time. After the delay, the connection status and the audio mode playback status are determined. If the connection status is the audio playback connection status, and the audio mode playback status is the status of playing the audio of the audio playback program before the call, the system sends the audio playback permission to the audio of the audio playback program before the call. By setting the delay time for delay, the phenomenon of sound being played outward can be prevented.

[0057] Sometimes after the delay time, the connection status and audio mode playback status may not be switched. In this case, it is necessary to delay sending the audio playback permission to avoid the sound being played out. The following will explain how to delay sending the audio playback permission once or multiple times.

[0058] Figure 4 The invention is a flowchart showing one or more delayed sending of audio playing permission according to an exemplary embodiment.

[0059] In step S41, at the i-th delay, after delaying for the i-th delay time, the connection state and the audio mode playing state are determined, where i is a positive integer greater than or equal to 1.

[0060] In the disclosed embodiment, determining the connection status and the audio mode playing status is to judge the connection status and the audio mode playing status after the i-th delayed sending of the audio playing permission to determine the subsequent processing. The i-th delay time is obtained by repeated test experience and is preset in the electronic device system.

[0061] In step S42, if the connection state is a call connection state or the audio mode playback state is a call playback state, an (i+1)th delay is performed.

[0062] In the disclosed embodiment, if the connection state is a call connection state, or the audio mode playback state is a call playback state, sending the audio playback permission at this time will cause the sound to be played outward, so a delay is required.

[0063] In step S43, during the i+1th delay, after delaying for the i+1th delay time, the connection status and the audio mode playback status are repeatedly determined until the connection status is the audio playback connection status, and the audio mode playback status is the status of playing the first application audio, and the duration corresponding to the i+1th delay time is less than the duration corresponding to the i-th delay time.

[0064] In the disclosed embodiment, the connection state is the audio playback connection state, and the audio mode playback state is the state of playing the audio of the first application, which means that the connection state and the audio mode playback state have both switched to the state of the corresponding application for audio playback. At this time, the transfer of audio playback authority will not cause the sound to be played out, and no delay is required. The delay time of each delay is less than the delay time of the previous delay.

[0065] In step S44, if the connection state is an audio playback connection state, and the audio mode playback state is a state of playing the audio of the first application, an audio playback permission is sent to the first application running on the electronic device.

[0066] In the disclosed embodiment, the state of playing the audio of the first application is determined by the system and the first application, and the corresponding audio mode playback state is determined according to the corresponding state when the first application is running. The audio playback permission is sent by the electronic device system. If the connection state is the audio playback connection state, and the audio mode playback state is the state of playing the audio of the first application, it means that the requirements for sending the audio playback permission are met. At this time, the audio playback permission is sent to the first application running on the electronic device to avoid the phenomenon of external sound.

[0067] In one implementation, when the sending of audio playback permission is delayed, after a certain delay, it is determined whether the connection state and the audio mode playback state meet the conditions. If the connection state is a call connection state or the audio mode playback state is a state of playing a call, it means that the conditions are not fully met, and the next delay will be performed at this time. Among them, the delay time of the next delay is less than the delay time of the delay of this delay. If after the next delay, the connection state is a call connection state or the audio mode playback state is a state of playing a call, the above delay process is repeated, and the next delay is performed again until the connection state and the audio mode playback state are switched to the state corresponding to the audio playback. After determining that the connection state and the audio mode playback state are switched to the state corresponding to the audio playback, the electronic device system sends the audio playback permission to the application running before the call, thereby avoiding the phenomenon of sound being played outward. In the above-mentioned delayed sending of audio playback permission, by setting shorter and shorter delay times, the delay time before sending the audio playback permission can be minimized to improve the user experience.

[0068] In one implementation, if the audio mode playback state corresponding to the first application is the same as during a call, there is no need to wait for the audio mode playback state to switch after the call ends, and the audio playback permission is sent to the first application after determining that the connection state has switched.

[0069] In one implementation, if the connection state corresponding to the first application is the same as that during the call, there is no need to wait for the connection mode to switch after the call ends, and the audio playback permission is sent to the first application after determining that the audio mode playback state has switched.

[0070] In one implementation, if the connection status and audio mode playback status corresponding to the first application are the same as during a call, the audio playback permission is directly sent to the first application.

[0071] In one implementation of the audio switching method provided by the present disclosure, in the process of delaying the sending of audio playback permission, when the number of delays reaches a delay number threshold, the audio playback permission is sent to the first application running on the electronic device after the delay ends.

[0072] In the disclosed embodiment, the delay times threshold is a preset threshold value, which is determined by the empirical value of repeated tests. By presetting the delay times threshold value, it is possible to avoid the audio mode playback state and the connection state not switching normally due to the system or the electronic device hardware, thereby avoiding excessive delays and affecting the user experience. The audio playback permission is sent by the electronic device system.

[0073] In one implementation, during the process of delaying the audio playback permission, if the number of delays reaches a preset delay number threshold, after the delay ends, no further delay will be performed, and the system will send the audio playback permission to the first application.

[0074] In one implementation, during the process of delaying the audio playback permission, if the number of delays reaches a preset delay threshold, after the delay ends, the audio mode playback status and connection status will no longer be judged, and the system will send the audio playback permission to the first application.

[0075] In one implementation of the audio switching method provided by the present disclosure, if the connection state is an audio playback connection state, and the audio mode playback state is a state of playing the audio of the first application, an audio playback permission is sent to the first application running on the electronic device.

[0076] In one embodiment, after the call is over, it is determined whether the connection status between the electronic device and the external device and the audio mode playback status have been switched accordingly. If the connection status is an audio playback connection status, and the audio mode playback status is a status of playing the audio of the first application, the system sends the audio playback permission to the first application running on the electronic device to switch the audio. Sending the audio playback permission at this time can avoid the phenomenon of external sound playback.

[0077] In one implementation of the audio switching method provided by the present disclosure, in response to a second application of the electronic device requesting audio playback permission, the audio playback permission is sent to the second application running on the electronic device, where the second application is an application other than the first application.

[0078] In the disclosed embodiment, sending the audio playback permission to the second application is an operation before sending the audio playback permission to the first application, and there is no delay. The second application requests the audio playback permission, and the audio playback permission is sent to the second application running on the electronic device without delay, thereby increasing the speed of system switching applications, preventing system freezes caused by delays, and improving user experience.

[0079] In one implementation, after the call ends, if the connection status between the electronic device and the external device and the audio mode playback status have completed the corresponding switching, there is no need to delay sending the audio playback permission to the first application, i.e., the application running before the call. Before sending the audio playback permission to the first application, if a new application requests the audio playback permission at this time, the system sends the audio playback permission to the new application requesting the audio playback permission, and the new application, i.e., the second application, performs the audio playback.

[0080] In one implementation, after the call ends, if the connection status between the electronic device and the external device and the audio mode playback status have not completed the corresponding switching, it is necessary to delay sending the audio playback permission. If a new application requests the audio playback permission at this time, the system sends the audio playback permission to the new application requesting the audio playback permission, and the new application, i.e., the second application, performs the audio playback.

[0081] In one implementation of the audio switching method provided by the present disclosure, electronic device calls include calls initiated by an application and calls initiated by the electronic device's own call program, the external playback device of the electronic device is a Bluetooth external device, the connection state is a Bluetooth connection state, and the first application is an audio and video playback application.

[0082] In one implementation, the electronic device call may also include a call initiated by a default call application of the electronic device system or a third-party call application. The external playback device may include a Bluetooth external device, a wired connection device, a local area network external device, etc. When the electronic device is connected to the external playback device, audio playback is performed from the external playback device. The connection status is jointly determined by the external device, the electronic device system, and the running application, including a wireless connection status, a wired connection status, etc.

[0083] In one implementation, when the connection state is a Bluetooth connection state, the call connection state may be a SCO connection state, and the audio playback connection state may be an A2DP connection state. Which Bluetooth connection state to use is determined by the Bluetooth external device, the electronic device system, and the running application.

[0084] In the embodiments of the present disclosure, the audio switching method involved in the above embodiments is described below by taking the electronic device as a mobile phone terminal and the external device as a Bluetooth headset as an example.

[0085] Figure 5 The present invention is a flowchart of performing audio switching according to an exemplary embodiment.

[0086] In one embodiment, if Figure 5As shown, when using a Bluetooth headset, in response to the end of a call, the audio focus is released, and it is determined whether the Bluetooth is in a call. Among them, the audio focus is the audio playback permission occupied by the application. Determining whether the Bluetooth is in a call is to determine whether it is the Bluetooth connection state and audio mode playback state corresponding to the call state. If the Bluetooth is not in a call, it means that the Bluetooth connection state and the audio mode playback state have been set to the audio playback state corresponding to the audio and video playback application, and the system will allocate the audio focus to the audio and video playback application. At this time, the Bluetooth headset can normally perform the audio playback of the corresponding audio and video playback application, and the sound will not be played out. If the Bluetooth is still in a call, it means that the Bluetooth connection state and the audio mode playback state have not been fully set, and the system will delay the allocation of the audio focus. If a new application makes a new audio focus application during the delay time, the system will process the new application normally, that is, the audio focus is allocated to the new application. If there is no new application to apply for audio focus and the single delay ends, the relevant state will be judged. Among them, the relevant state includes the Bluetooth connection state, the audio mode playback state, and the delay number state. If the Bluetooth and audio mode are not set, that is, the Bluetooth connection state and the audio mode playback state have not completed the corresponding settings, the above-mentioned delayed allocation of audio focus process is repeated. If the Bluetooth and audio modes are set up, that is, the Bluetooth connection status and the audio mode playback status are set up accordingly, the system will assign the audio focus to the corresponding audio and video playback application to complete the audio switching. Among them, when the delay times are equal to the preset delay times threshold, after this delay ends, there is no need to determine whether the Bluetooth and audio modes are set up, and the system will assign the audio focus to the corresponding audio and video playback application.

[0087] Through the audio switching method in the above embodiment, after the corresponding settings of the Bluetooth connection state and the audio mode playback state are completed, the audio playback permission is sent to avoid the phenomenon of external sound when the call and the application transfer the audio playback permission. By setting multiple delays with different delay times, the delay time is minimized to improve the user experience. And set a preset delay number threshold to prevent system or hardware problems from making the Bluetooth connection state and the audio mode playback state unable to complete the corresponding settings, and avoid the situation of no response causing the delay state.

[0088] Based on the same concept, an embodiment of the present disclosure also provides an audio switching device.

[0089] It is understandable that in order to realize the above functions, the audio switching device provided by the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function. In combination with the units and algorithm steps of each example disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present disclosure.

[0090] Figure 6 FIG. 1 is a block diagram of an audio switching device according to an exemplary embodiment. Figure 6 , the device includes a detection unit 101 and a processing unit 102.

[0091] The detection unit 101 is configured to determine the connection status of an external playback device of the electronic device and the audio mode playback status in response to the electronic device releasing the audio playback permission when a call ends.

[0092] The processing unit 102 is configured to send audio playback permission to a first application running on the electronic device based on the connection status and the audio mode playback status; the first application is an application that holds the audio playback permission before the electronic device executes a call.

[0093] In an implementation manner provided by an embodiment of the present disclosure, the processing unit 102 sends audio playback permission to a first application running on the electronic device based on the connection status and the audio mode playback status in the following manner: if the connection status is a call connection status, or the audio mode playback status is a call playback status, then delay sending the audio playback permission to the first application running on the electronic device.

[0094] In one implementation provided by an embodiment of the present disclosure, the processing unit 102 delays sending audio playback permission to a first application running on an electronic device in the following manner: after delaying according to a delay time, determining a connection status and an audio mode playback status; if the connection status is an audio playback connection status, and the audio mode playback status is a status for playing audio of the first application, sending audio playback permission to the first application running on the electronic device.

[0095] In an implementation manner provided by an embodiment of the present disclosure, the processing unit 102 delays sending audio playback permission to a first application running on an electronic device in the following manner: at the i-th delay, after delaying for the i-th delay time, determining the connection status and the audio mode playback status, where i is a positive integer greater than or equal to 1; if the connection status is a call connection status, or the audio mode playback status is a call playback status, performing an i+1-th delay; at the i+1-th delay, after delaying for the i+1-th delay time, repeatedly determining the connection status and the audio mode playback status until the connection status is a connection status, and the audio mode playback status is a status of playing the audio of the first application; the duration corresponding to the i+1-th delay time is less than the duration corresponding to the i-th delay time; if the connection status is an audio playback connection status, and the audio mode playback status is a status of playing the audio of the first application, sending the audio playback permission to the first application running on the electronic device.

[0096] In one implementation provided by an embodiment of the present disclosure, the processing unit 102 sends audio playback permission to the first application running on the electronic device in the following manner: at the i-th delay, if i is equal to the delay number threshold, after the i-th delay time, the audio playback permission is sent to the first application running on the electronic device.

[0097] In one implementation provided by an embodiment of the present disclosure, the processing unit 102 sends audio playback permission to a first application running on the electronic device based on the connection status and the audio mode playback status in the following manner: if the connection status is an audio playback connection status, and the audio mode playback status is a status of playing the audio of the first application, the audio playback permission is sent to the application running on the electronic device.

[0098] In an implementation provided by an embodiment of the present disclosure, the processing unit 102 is further used to: in response to a second application of the electronic device requesting audio playback permission, send audio playback permission to a second application running on the electronic device; the second application is an application other than the first application.

[0099] In an implementation provided by an embodiment of the present disclosure, electronic device calls include calls initiated by an application and calls initiated by the electronic device's own call program, the external playback device of the electronic device is a Bluetooth external device, the connection status is a Bluetooth connection status, and the first application is an audio and video playback application.

[0100] Regarding the device in the above embodiment, the specific manner in which each module unit performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0101] Figure 72 is a block diagram of an apparatus 200 for audio switching according to an exemplary embodiment. For example, the apparatus 200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0102] Reference Figure 7 , the device 200 may include one or more of the following components: a processing component 202 , a memory 204 , a power component 206 , a multimedia component 208 , an audio component 210 , an input / output (I / O) interface 212 , a sensor component 214 , and a communication component 216 .

[0103] The processing component 202 generally controls the overall operation of the device 200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 202 may include one or more processors 220 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 202 may include one or more modules to facilitate interaction between the processing component 202 and other components. For example, the processing component 202 may include a multimedia module to facilitate interaction between the multimedia component 208 and the processing component 202.

[0104] The memory 204 is configured to store various types of data to support operations on the device 200. Examples of such data include instructions for any application or method operating on the device 200, contact data, phone book data, messages, pictures, videos, etc. The memory 204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0105] The power component 206 provides power to the various components of the device 200. The power component 206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 200.

[0106] The multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 208 includes a front camera and / or a rear camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0107] The audio component 210 is configured to output and / or input audio signals. For example, the audio component 210 includes a microphone (MIC), and when the device 200 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 204 or sent via the communication component 216. In some embodiments, the audio component 210 also includes a speaker for outputting audio signals.

[0108] I / O interface 212 provides an interface between processing component 202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0109] The sensor assembly 214 includes one or more sensors for providing various aspects of the status assessment of the device 200. For example, the sensor assembly 214 can detect the open / closed state of the device 200, the relative positioning of components, such as the display and keypad of the device 200, the sensor assembly 214 can also detect the position change of the device 200 or a component of the device 200, the presence or absence of user contact with the device 200, the orientation or acceleration / deceleration of the device 200 and the temperature change of the device 200. The sensor assembly 214 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 214 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 214 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.

[0110] The communication component 216 is configured to facilitate wired or wireless communication between the device 200 and other devices. The device 200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0111] In an exemplary embodiment, the apparatus 200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0112] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 204 including instructions, and the instructions can be executed by the processor 220 of the device 200 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0113] It is to be understood that in the present disclosure, "plurality" refers to two or more than two, and other quantifiers are similar. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. The singular forms "a", "the" and "the" are also intended to include plural forms, unless the context clearly indicates other meanings.

[0114] It is further understood that the terms "first", "second", etc. are used to describe various information, but such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other, and do not indicate a specific order or degree of importance. In fact, the expressions "first", "second", etc. can be used interchangeably. For example, without departing from the scope of the present disclosure, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information.

[0115] It can be further understood that, unless otherwise specified, “connection” includes a direct connection without other components between the two, and also includes an indirect connection with other components between the two.

[0116] It is further understood that, although the operations are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood as requiring the operations to be performed in the specific order shown or in a serial order, or requiring the execution of all the operations shown to obtain the desired results. In certain environments, multitasking and parallel processing may be advantageous.

[0117] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modifications, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.

[0118] It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the scope of the appended claims.

Claims

1. An audio switching method, characterized in that: include: In response to the electronic device releasing the audio playback permission when a call ends, determining a connection state of an external playback device of the electronic device and an audio mode playback state; Based on the connection status and the audio mode playback status, sending the audio playback permission to a first application running on the electronic device; The first application is an application that holds the audio playback permission before the electronic device executes the call.

2. The method according to claim 1, characterized in that The sending the audio playback permission to the first application running on the electronic device based on the connection state and the audio mode playback state includes: If the connection state is a call connection state, or the audio mode playing state is a state of playing the call, sending the audio playing permission to the first application running on the electronic device is delayed.

3. The method according to claim 2, characterized in that The delaying sending the audio play permission to the first application running on the electronic device includes: After delaying according to the delay time, determining the connection state and the audio mode playing state; If the connection state is the audio playback connection state, and the audio mode playback state is the state of playing the audio of the first application, the audio playback permission is sent to the first application running on the electronic device.

4. The method according to claim 2, characterized in that: The delaying sending the audio play permission to the first application running on the electronic device includes: During the i-th delay, after the i-th delay time, the connection state and the audio mode playing state are determined, where i is a positive integer greater than or equal to 1; If the connection state is a call connection state, or the audio mode playback state is a state of playing the call, then the (i+1)th delay is performed; During the (i+1) delay, after the (i+1) delay time, repeatedly determine the connection state and the audio mode playback state until the connection state is an audio playback connection state, and the audio mode playback state is a state of playing the audio of the first application; The duration corresponding to the (i+1)th delay time is less than the duration corresponding to the (i)th delay time; If the connection state is the audio playback connection state, and the audio mode playback state is the state of playing the audio of the first application, the audio playback permission is sent to the first application running on the electronic device.

5. The method according to claim 4, characterized in that The sending the audio playback permission to the first application running on the electronic device includes: During the i-th delay, if i is equal to the delay times threshold, the audio playback permission is sent to the first application running on the electronic device after the i-th delay time.

6. The method according to claim 1, characterized in that The sending the audio playback permission to the first application running on the electronic device based on the connection state and the audio mode playback state includes: If the connection state is an audio playback connection state, and the audio mode playback state is a state of playing the audio of the first application, the audio playback permission is sent to the first application running on the electronic device.

7. The method according to claim 1, characterized in that The method further comprises: In response to a second application of the electronic device requesting the audio play permission, sending the audio play permission to the second application running on the electronic device; The second application is an application other than the first application.

8. According to the method described in claim 1, the electronic device call includes a call initiated by an application and a call initiated by the electronic device's own call program, the external playback device of the electronic device is a Bluetooth external device, the connection status is a Bluetooth connection status, and the first application is an audio and video playback application.

9. An audio switching device, characterized in that: include: A detection unit, configured to release the audio playback permission of the electronic device in response to the end of a call, and determine the connection status of an external playback device of the electronic device and the audio mode playback status; A processing unit, based on the connection state and the audio mode playing state, sends the audio playing permission to a first application running on the electronic device; The first application is an application that holds the audio playback permission before the electronic device executes the call.

10. The device according to claim 9, characterized in that The processing unit sends the audio playback permission to the first application running on the electronic device based on the connection status and the audio mode playback status in the following manner: If the connection state is a call connection state, or the audio mode playing state is a state of playing the call, sending the audio playing permission to the first application running on the electronic device is delayed.

11. The device according to claim 10, characterized in that The processing unit delays sending the audio playback permission to the first application running on the electronic device in the following manner: After delaying according to the delay time, determining the connection state and the audio mode playing state; If the connection state is the audio playback connection state, and the audio mode playback state is the state of playing the audio of the first application, the audio playback permission is sent to the first application running on the electronic device.

12. The device according to claim 10, characterized in that The processing unit delays sending the audio playback permission to the first application running on the electronic device in the following manner: During the i-th delay, after the i-th delay time, the connection state and the audio mode playing state are determined, where i is a positive integer greater than or equal to 1; If the connection state is a call connection state, or the audio mode playback state is a state of playing the call, then the (i+1)th delay is performed; During the (i+1)th delay, after the (i+1)th delay time, repeatedly determine the connection state and the audio mode playback state until the connection state is a connected state, and the audio mode playback state is a state of playing the audio of the first application; The duration corresponding to the (i+1)th delay time is less than the duration corresponding to the (i)th delay time; If the connection state is an audio playback connection state, and the audio mode playback state is a state of playing the audio of the first application, the audio playback permission is sent to the first application running on the electronic device.

13. The device according to claim 12, characterized in that The processing unit sends the audio playback permission to the first application running on the electronic device in the following manner: During the i-th delay, if i is equal to the delay times threshold, the audio playback permission is sent to the first application running on the electronic device after the i-th delay time.

14. The device according to claim 9, characterized in that The processing unit sends the audio playback permission to the first application running on the electronic device based on the connection status and the audio mode playback status in the following manner: If the connection state is an audio playback connection state, and the audio mode playback state is a state of playing the audio of the first application, the audio playback permission is sent to the application running on the electronic device.

15. The device according to claim 9, characterized in that The processing unit is also used for: In response to a second application of the electronic device requesting the audio play permission, sending the audio play permission to the second application running on the electronic device; The second application is an application other than the first application.

16. The device according to claim 9, characterized in that The electronic device call includes a call initiated by an application and a call initiated by the electronic device's own call program. The external playback device of the electronic device is a Bluetooth external device, the connection state is a Bluetooth connection state, and the first application is an audio and video playback application.

17. An audio switching device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: execute the method described in any one of claims 1 to 8.

18. A storage medium, characterized in that: The storage medium stores instructions, and when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 8.