Bluetooth audio playback method, electronic device, and storage medium

By creating Track audio tracks in electronic devices and using hardware abstraction layer and Bluetooth protocol stack to manage audio state, the problem of playback abnormalities between Bluetooth devices between different applications is solved, and the consistency control of audio data and state is achieved.

CN116828100BActive Publication Date: 2025-09-02HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210304730.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-22
Publication Date
2025-09-02
Estimated Expiration
2042-03-22

AI Technical Summary

Technical Problem

When existing Bluetooth devices are connected to different applications, applications that do not register Mediasession cannot transmit audio status control instructions through AVRCP, resulting in abnormal playback.

Method used

Ensure consistency management of audio state by creating Track tracks in electronic devices and determining their number, using the hardware abstraction layer and Bluetooth protocol stack to send play or pause instructions.

Benefits of technology

It solves the problem of confusing audio status management between different applications, avoids playback abnormalities of Bluetooth devices, and realizes unified control of audio data and status.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116828100B_ABST
    Figure CN116828100B_ABST
Patent Text Reader

Abstract

The present application relates to a Bluetooth audio playback method, an electronic device and a storage medium. The method is applied in an electronic device, and the electronic device is communicatively connected to a Bluetooth device. The application of the electronic device obtains audio data according to a play command, creates a Track audio track of the audio data according to the play command, and determines the number of Track audio tracks. When it is determined that the number of the Track audio tracks has increased, a play instruction is sent to the Bluetooth device, and the play instruction is used to set the audio state of the Bluetooth device to play. When it is determined that the number of the Track audio tracks has decreased, a pause instruction is sent to the Bluetooth device, and the pause instruction is used to set the audio state of the Bluetooth device to pause. The present application can solve the problem of unstable playback when a Bluetooth device plays audio data due to the chaotic management of audio states by different applications in an electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Bluetooth communications, and more specifically, to a Bluetooth audio playback method, electronic device, and storage medium. Background Art

[0002] When existing mobile phone applications use Bluetooth devices to play audio, audio data and audio status control commands are transmitted using two protocols. Audio status control commands are transmitted using the Audio / Video Remote Control Profile (AVRCP), while audio data is transmitted using the Audio / Video Distribution Transport Protocol (AVDTP). Typically, on Android, applications can only transmit audio status via AVRCP after registering for a multimedia session. However, the current situation is that applications registered with Mediasession can send audio data through AVDTP and transmit audio status control instructions through AVRCP. However, applications not registered with Mediasession can only send audio data through AVDTP and cannot transmit audio status control instructions through AVRCP. As a result, the audio status control instructions sent to Bluetooth devices by applications registered with Mediasession and applications not registered with Mediasession are inconsistent, causing Bluetooth devices to be incompatible with applications registered with Mediasession and applications not registered with Mediasession, resulting in playback anomalies when Bluetooth devices play audio data from applications not registered with Mediasession. For example, a mobile phone music player application registered with Mediasession sends audio status control instructions to a Bluetooth device, and the Bluetooth device can receive the audio status control instructions sent by the mobile phone music player application to control the played audio data. However, when a Bluetooth device is connected to a car audio application that has not registered with Mediasession, the car audio application cannot send audio status control instructions to the Bluetooth device, making it impossible for the Bluetooth device to play the audio data of the car audio application. Summary of the Invention

[0003] In view of the above, it is necessary to provide a Bluetooth audio playback method, electronic device and storage medium to solve the problem of unstable playback when Bluetooth devices play audio data due to confusion in the management of audio status by different applications.

[0004] In the first aspect, an embodiment of the present application provides a Bluetooth audio playback method, which is applied in an electronic device, and the electronic device is communicatively connected to a Bluetooth device, and the method includes: an application of the electronic device obtains audio data according to a play command; creates a Track audio track of the audio data according to the play command, and determines the number of Track audio tracks; when it is determined that the number of Track audio tracks increases, sends a play instruction to the Bluetooth device, wherein the play instruction is used to set the audio state of the Bluetooth device to play; when it is determined that the number of Track audio tracks decreases, sends a pause instruction to the Bluetooth device, wherein the pause instruction is used to set the audio state of the Bluetooth device to pause. The above technical solution, when it is determined that the number of Track audio tracks increases, sends a play instruction to the Bluetooth device to set the audio state of the Bluetooth device to play, and when it is determined that the number of Track audio tracks decreases, sends a pause instruction to the Bluetooth device to set the audio state of the Bluetooth device to pause, thereby avoiding abnormal playback problems of the Bluetooth device due to chaotic audio state management of different applications.

[0005] In one embodiment of the present application, creating a Track track for the audio data according to the play command and determining the number of Track tracks includes: the audio manager obtaining the play command from the application, creating a Track track for the audio data according to the play command, and determining the number of Track tracks. The above technical solution can create a Track track for the audio data and determine the number of Track tracks through the audio manager.

[0006] In one embodiment of the present application, when it is determined that the number of Track audio tracks has increased, sending a play instruction to the Bluetooth device includes: the hardware abstraction layer of the electronic device obtains the number of Track audio tracks from the audio framework layer; when the hardware abstraction layer determines that the number of Track audio tracks has increased, sending the audio status of the playback to the Bluetooth protocol stack of the hardware abstraction layer; and the Bluetooth protocol stack sends the play instruction to the Bluetooth device in response to the audio status of the playback. In the above technical solution, when the hardware abstraction layer determines that the number of Track audio tracks has increased, the play instruction is sent to the Bluetooth device via the Bluetooth protocol stack.

[0007] In one embodiment of the present application, when determining that the number of Track audio tracks has decreased, sending a pause instruction to the Bluetooth device includes: when the hardware abstraction layer determines that the number of Track audio tracks has decreased, sending a paused audio state to the Bluetooth protocol stack; and the Bluetooth protocol stack sending the pause instruction to the Bluetooth device in response to the paused audio state. In the above technical solution, when the hardware abstraction layer determines that the number of Track audio tracks has decreased, the pause instruction is sent to the Bluetooth device via the Bluetooth protocol stack.

[0008] In one embodiment of the present application, determining the number of Track tracks includes: the audio manager obtaining a pause command from the application; and deleting the Track track according to the pause command. The above technical solution can delete the Track track according to the pause command.

[0009] In one embodiment of the present application, the determining the number of Track tracks includes: the audio manager deleting the Track tracks when determining that the playback of the audio data has ended. In the above technical solution, the audio manager can delete the Track tracks when the audio data has finished playing.

[0010] In one embodiment of the present application, determining the number of Track audio tracks includes: in response to an operation of switching the audio data of the first playback scene of the application to the audio data of the second playback scene, the audio manager deleting the Track audio track of the audio data of the first playback scene, and creating a Track audio track of the audio data of the second playback scene, wherein the audio data of the first playback scene and the audio data of the second playback scene are discontinuous. The above technical solution can achieve the deletion of the Track audio track of the audio data of the first playback scene and the creation of the Track audio track of the audio data of the second playback scene when the user switches the audio data of the first playback scene to the audio data of the second playback scene.

[0011] In one embodiment of the present application, the determining of the number of Track audio tracks includes: the audio manager responding to the user clicking the previous button or the next button on the music playback interface of the music player, deleting the Track audio track of the audio data of the music currently playing on the music player, and creating a Track audio track of the audio data of the music pressed by the previous button or the next button. The above technical solution can achieve the deletion of the Track audio track of the audio data of the music currently playing on the music player and the creation of the Track audio track of the audio data of the music pressed by the previous button or the next button when the user clicks the previous button or the next button.

[0012] In one embodiment of the present application, the application includes a music player, and the application layer application obtaining audio data according to a play command includes: the music player generating a play command in response to a user clicking a play button on a music playback interface of the music player, and obtaining the audio data according to the play command. The above technical solution enables the acquisition of audio data when the user clicks the play button on the music playback interface, facilitating user operation.

[0013] In one embodiment of the present application, the Bluetooth protocol stack sends a play instruction to the Bluetooth device according to the playing audio state or sends a pause instruction to the Bluetooth device according to the paused audio state, including: the Bluetooth protocol stack sends a play instruction or a pause instruction to the Bluetooth device through the Audio / Video Remote Control Profile (Audio / Video Remote Control Profile, AVRCP).

[0014] In one embodiment of the present application, when the hardware abstraction layer determines that the number of Track audio tracks increases, sending the audio status of playback to the Bluetooth protocol stack of the hardware abstraction layer includes: when the hardware abstraction layer determines that the number of Track audio tracks changes from 0 to 1, sending the audio status of playback to the Bluetooth protocol stack of the hardware abstraction layer. In the above technical solution, when the hardware abstraction layer determines that the number of Track audio tracks changes from 0 to 1, a play instruction is sent to the Bluetooth device via the Bluetooth protocol stack to set the audio status of the Bluetooth device to playback.

[0015] In one embodiment of the present application, when the hardware abstraction layer determines that the number of Track audio tracks decreases, sending the paused audio state to the Bluetooth protocol stack includes: when the hardware abstraction layer determines that the number of Track audio tracks changes from 1 to 0, sending the paused audio state to the Bluetooth protocol stack. In the above technical solution, when it is determined that the number of Track audio tracks changes from 1 to 0, a pause instruction is sent to the Bluetooth device via the Bluetooth protocol stack to set the audio state of the Bluetooth device to pause.

[0016] In a second aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory; wherein the processor is coupled to the memory; the memory is used to store program instructions; and the processor is used to read the program instructions stored in the memory to implement the above-mentioned Bluetooth audio playback method.

[0017] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores program instructions. When the program instructions are executed by a processor, the above-mentioned Bluetooth audio playback method is executed.

[0018] In addition, the technical effects brought about by the second to third aspects can be found in the descriptions of the methods of each design in the above method section, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings in the embodiments 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 relevant drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1A-1B Schematic diagram of an electronic device playing audio data stream and audio status in one embodiment of the present application.

[0021] Figure 2 This is a software structure block diagram of an electronic device in one embodiment of the present application.

[0022] Figure 3 This is a diagram of the application environment of the Bluetooth audio playback method in one embodiment of the present application.

[0023] Figure 4 This is a flowchart of a Bluetooth audio playback method in one embodiment of the present application.

[0024] Figure 5 This is a schematic diagram of a music player acquiring audio data in one embodiment of the present application.

[0025] Figure 6 Schematic diagram of determining a Track audio track in one embodiment of the present application.

[0026] Figure 7 Schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0027] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.

[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are for the purpose of describing specific embodiments only and are not intended to limit this application. It should be understood that, unless otherwise specified in this application, " / " means or. For example, A / B can mean A or B. "And / or" in this application is merely a way to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. "Multiple" means two or more than two. For example, at least one of a, b or c can mean: a, b, c, a and b, a and c, b and c, a, b and c.

[0029] To facilitate the description of each embodiment below, a brief description of the user interface (UI) involved in the embodiments of the present application is first given. UI is a medium interface for interaction and information exchange between an application or operating system and a user, which can realize the conversion between the internal form of information and the form acceptable to the user. The user interface of an application is a source code written in a specific computer language such as JAVA and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device, and finally presented as content that the user can recognize, such as pictures, text, buttons and other controls. Controls are the basic elements of the user interface. Typical controls include buttons, widgets, toolbars, menu bars, text boxes, scroll bars, images and text. The properties and contents of controls in the interface are defined by tags or nodes, such as XML through <textview> 、 <imgview> 、 <videoview>The controls contained in the interface are specified by nodes such as <head> and <body>. A node corresponds to a control or attribute in the interface, and the node is presented as user-visible content after parsing and rendering. In addition, many applications, such as hybrid applications, usually also contain web pages in their interfaces. A web page, also known as a page, can be understood as a special control embedded in the application interface. A web page is a source code written in a specific computer language, such as hypertext markup language (HTML), cascading style sheets (CSS), JAVA scripts (JavaScript, JS), etc. The web page source code can be loaded and displayed as user-recognizable content by a browser or a web page display component with similar functions to a browser. The specific content contained in a web page is also defined by tags or nodes in the web page source code, such as HTML through <body>. 、 、 <video> 、 <canvas>To define the elements and attributes of a web page.

[0030] A common form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operations that uses graphics to display. It can be an icon, window, control, or other interface element displayed on the display of an electronic device.

[0031] When an existing audio application or video application plays audio data, it creates a Track in the audio management system in the audio framework layer. The number of Tracks can be controlled by the audio application or video application. Figure 1A-1B , which is a schematic diagram of an electronic device playing audio data stream and audio status in one embodiment of the present application.

[0032] Figure 1A Schematic diagram of the audio data stream and audio status played by an application registered with Mediasession in an electronic device. In this embodiment, when playing a Track audio track, the audio management system of the application registered with Mediasession sends audio data to the Bluetooth device through the Audio / Video Distribution Transport Protocol (AVDTP) for transmission between Bluetooth devices, and sends audio status control instructions to the Bluetooth device through the Audio / Video Remote Control Profile (AVRCP). For example, when transmitting audio data, the application registered with Mediasession sends a play instruction T1 to the Bluetooth device through AVRCP or sends a pause instruction T2 to the Bluetooth device through AVRCP.

[0033] Figure 1B This diagram illustrates the audio data stream and audio status of an unregistered Mediasession application in an electronic device. In this embodiment, when playing a Track, the audio management system of an unregistered Mediasession application only sends audio data to the Bluetooth device via AVDTP and cannot send audio status control instructions to the Bluetooth device via AVRCP. This results in inconsistent audio status and audio data streams when the electronic device plays audio data from different applications, causing playback anomalies on the Bluetooth device.

[0034] In view of this, the present application provides a Bluetooth audio playback method to keep the audio data and audio status consistent. The Bluetooth audio playback method is applied in the electronic device 100. Figure 2 , which is a software structure block diagram of the electronic device 100 in one embodiment of the present application. The layered architecture divides the software into the application layer, application framework layer, hardware abstraction layer (HAL), and kernel layer from top to bottom.

[0035] The application layer can include a series of application packages. Figure 2 As shown, the application package may include an audio application or a video application.

[0036] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions. As shown in Figure 1, the application framework layer can include a Bluetooth framework layer and an audio framework layer.

[0037] The hardware abstraction layer provides a unified access interface for different hardware devices. Figure 2 As shown, the HAL may include a Bluetooth protocol stack.

[0038] The kernel layer is the layer between hardware and software. The kernel layer includes at least various drivers, e.g. Figure 2 The Bluetooth driver shown.

[0039] refer to Figure 3 , which is an application environment diagram of a Bluetooth audio playback method in an embodiment of the present application. The Bluetooth audio playback method is applied in an electronic device 100. The electronic device 100 is communicatively connected to a Bluetooth device 200 via a Bluetooth communication module. In one embodiment, the electronic device 100 includes, but is not limited to, a smartphone, a laptop, a desktop, a handheld PC, a personal digital assistant, an embedded processor, a digital signal processor (DSP), a graphics device, a video game device, a set-top box, a microcontroller, a cellular phone, a portable media player, a handheld device, a wearable device (e.g., display glasses or goggles, a head-mounted display (HMD), a watch, a head-mounted device, an armband, jewelry, etc.), a virtual reality (VR) and / or augmented reality (AR) device, an Internet of Things (IoT) device, a smart audio system, an in-vehicle infotainment device, a streaming client device, an e-book reading device, a POS machine, a control system for an electric vehicle, and various other electronic devices. In one embodiment, the Bluetooth device 200 includes a Bluetooth device with Bluetooth audio playback capability, such as a Bluetooth headset and a Bluetooth speaker.

[0040] Please refer to Figure 4 FIG. 1 is a flow chart of a Bluetooth audio playback method according to an embodiment of the present invention. The method comprises the following steps.

[0041] Step S401: An application at the application layer obtains audio data according to a play command.

[0042] In this embodiment, the application of the application layer includes an audio application or a video application. The following describes the Bluetooth audio playback method provided by this application by taking the application as a music player, the electronic device 100 as a mobile phone, and the Bluetooth device 200 as a Bluetooth headset as an example.

[0043] refer to Figure 5 As shown, when the user clicks the play / pause button 51 on the music player interface 50 of the mobile phone, the music player generates a play command in response to the user's operation of clicking the play / pause button 51 on the music player interface 50. The music player obtains audio data according to the play command.

[0044] Step S402: The audio manager of the audio framework layer obtains a play or pause command from the application, creates a Track audio track of the audio data according to the play or pause command, and determines the number of Track audio tracks.

[0045] In this embodiment, the determination of the number of Track tracks includes: the audio manager deleting the Track track when determining that the playback of the audio data has ended. In this embodiment, the Track track is created when the audio data is acquired; and the Track track is deleted when the audio data has finished playing. For example, when the music player of a mobile phone acquires a play command for a song, the audio manager of the audio framework layer creates the Track track, and when the music player finishes playing the audio data of the song, the audio manager of the audio framework layer deletes the Track track.

[0046] In one embodiment, determining the number of Track tracks includes: the audio manager obtaining a pause command from the application, and deleting the Track track according to the pause command. Figure 5 When the user clicks the play / pause button 51 on the music player interface 50 of the mobile phone, the music player generates a pause command in response to the user clicking the play / pause button 51 on the music player interface 50. The audio manager obtains the pause command from the music player and deletes the Track audio track according to the pause command.

[0047] In one embodiment, determining the number of Track audio tracks includes: in response to an operation of switching the audio data of a first playback scene of an audio application or a video application to the audio data of a second playback scene, deleting the Track audio track of the audio data of the first playback scene, and creating a Track audio track of the audio data of the second playback scene, wherein the audio data of the first playback scene is discontinuous with the audio data of the second playback scene.

[0048] For example, reference Figure 6 As shown, the music playback interface 50 includes a previous button 52 and a next button 53, wherein the audio data of the currently playing music is the audio data of the first playback scene, and the audio data of the music played by the previous button 52 or the next button 53 is the audio data of the second playback scene. When the user clicks the previous button 52 or the next button 53 on the music playback interface 60 of the mobile phone's music player, the audio manager responds to the user's operation of clicking the previous button 52 or the next button 53 on the music playback interface 50, deletes the Track of the audio data of the currently playing music, and creates the Track of the audio data of the music played by the previous button 52 or the next button 53. The audio data of the currently playing music is not continuous with the audio data of the music played by the previous button 52 or the next button 53.

[0049] Step S403: The Hal layer obtains the number of Track audio tracks from the audio framework layer.

[0050] In one embodiment, the audio manager generates Track track quantity update information when creating a Track track or deleting a Track track, and the audio framework layer sends the Track track quantity update information to the Hal layer. The Hal layer obtains the Track track quantity update information sent by the audio framework layer to determine the number of Track tracks.

[0051] Step S404: The Hal layer determines whether the number of Track audio tracks is increased or decreased according to the number of Track audio tracks.

[0052] In this embodiment, if it is determined that the number of Track tracks is increased, step S405 is executed; otherwise, if it is determined that the number of Track tracks is decreased, step S406 is executed.

[0053] Step S405: The Hal layer determines that the audio state of the audio data is playing, and sends the playing audio state to the Bluetooth protocol stack of the Hal layer.

[0054] In one embodiment, the Hal layer determines that the audio status of the audio data is playing, and sends the playing audio status to the Bluetooth protocol stack of the Hal layer, including: when it is determined that the number of the Track audio track changes from 0 to 1, the Hal layer determines that the audio status of the audio data is playing, and sends the playing audio status to the Bluetooth protocol stack of the Hal layer.

[0055] Step S406: The Hal layer determines that the audio state of the audio data is paused, and sends the paused audio state to the Bluetooth protocol stack of the Hal layer.

[0056] In one embodiment, the Hal layer determines that the audio state of the audio data is paused, and sends the paused audio state to the Bluetooth protocol stack of the Hal layer, including: when the Hal layer determines that the number of Track audio tracks changes from 1 to 0, the paused audio state is sent to the Bluetooth protocol stack.

[0057] In step S407, the Bluetooth protocol stack sends a play instruction to the Bluetooth device 200 according to the audio state of the playing audio, or sends a pause instruction to the Bluetooth device 200 according to the audio state of the paused audio. The play instruction is used to set the audio state of the Bluetooth device 200 to the play state, and the pause instruction is used to set the audio state of the Bluetooth device 200 to the pause state.

[0058] In this embodiment, the Bluetooth protocol stack sends a play instruction or a pause instruction to the Bluetooth device 200 through AVRCP.

[0059] In this application, when the Hal layer detects that the number of Track audio tracks increases by one, a play instruction is sent to the Bluetooth device through the Bluetooth protocol stack to set the audio state of the Bluetooth device to play, and when the Hal layer detects that the number of Track audio tracks decreases by one, a pause instruction is sent to the Bluetooth device through the Bluetooth protocol stack to set the audio state of the Bluetooth device to pause, thereby avoiding abnormal playback problems of the Bluetooth device due to chaotic audio state management of different applications.

[0060] It should be noted that, in another embodiment of the present application, after the Hal layer obtains the number of Track tracks from the audio framework layer, it sends the number of Track tracks to the Bluetooth protocol stack. When the Bluetooth protocol stack determines that the number of Track tracks has increased based on the number of Track tracks, it determines that the audio state of the audio data is playing, and sends a play instruction to the Bluetooth device 200 based on the playing audio state; when the Bluetooth protocol stack determines that the number of Track tracks has decreased based on the number of Track tracks, it determines that the audio state of the audio data is paused, and sends a pause instruction to the Bluetooth device 200 based on the paused audio state.

[0061] The electronic device 100 involved in the embodiment of the present application is introduced below. Figure 7 , which is a schematic diagram of the hardware structure of an electronic device 100 in an embodiment of the present application. The electronic device 100 can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device, and / or a smart city device. Some embodiments of the present application do not impose any special restrictions on the specific type of the electronic device 100. In other embodiments, the electronic device 100 includes a calling terminal 10 and / or a called terminal 20.

[0062] In this embodiment, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0063] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0064] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0065] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0066] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0067] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0068] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the electronic device 100.

[0069] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.

[0070] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0071] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.

[0072] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0073] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0074] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices 100, such as AR devices.

[0075] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0076] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device 100 via the power management module 141.

[0077] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0078] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0079] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0080] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0081] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0082] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0083] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0084] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0085] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0086] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0087] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0088] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0089] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0090] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0091] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0092] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0093] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation of DDR SDRAM is generally referred to as DDR5 SDRAM), etc.

[0094] Non-volatile memory may include disk storage devices and flash memory.

[0095] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage cell potential level; universal flash storage (UFS) and embedded multi media card (eMMC) can be divided into UFS and embedded multi media card according to the storage specification.

[0096] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.

[0097] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .

[0098] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 via the external memory interface 120 to implement data storage. For example, files such as music and videos can be stored in the external non-volatile memory.

[0099] The internal memory 121 or the external memory interface 120 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 110. The one or more computer programs include multiple instructions. When the multiple instructions are executed by the processor 110, the Bluetooth audio playback method in the above embodiment can be executed on the electronic device 100 to prevent Bluetooth audio track jitter.

[0100] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0101] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0102] The speaker 170A, also called a "speaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 170A.

[0103] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be heard by placing the receiver 170B close to the human ear.

[0104] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to realize sound signal collection, noise reduction, and identification of sound sources, and realize directional recording function, etc.

[0105] The headphone jack 170D is used to connect a wired headphone and can be a USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0106] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force acts on pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.

[0107] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0108] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.

[0109] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Based on the detected opening and closing status of the case or flip cover, features such as automatic unlocking of the flip cover can be configured.

[0110] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic device 100, enabling applications such as switching between landscape and portrait modes and pedometers.

[0111] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0112] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0113] Ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touches.

[0114] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0115] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the electronic device 100 from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.

[0116] The touch sensor 180K is also referred to as a "touch device." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also referred to as a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to an application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a location different from that of the display screen 194.

[0117] The bone conduction sensor 180M can obtain vibration signals. In some embodiments, the bone conduction sensor 180M can obtain vibration signals from the vibrating bones of the human body. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure pulse signals. In some embodiments, the bone conduction sensor 180M can also be set in headphones to form bone conduction headphones. The audio module 170 can parse out voice signals based on the vibration signals of the vibrating bones of the human body obtained by the bone conduction sensor 180M to implement voice functions. The application processor can parse heart rate information based on the blood pressure pulse signals obtained by the bone conduction sensor 180M to implement heart rate detection functions.

[0118] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0119] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0120] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0121] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0122] This embodiment further provides a computer storage medium, which stores computer instructions. When the computer instructions are executed on the electronic device 100, the electronic device 100 executes the above-mentioned related method steps to implement the Bluetooth audio playback method in the above-mentioned embodiment.

[0123] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the Bluetooth audio playback method in the above-mentioned embodiment.

[0124] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the Bluetooth audio playback method in the above-mentioned method embodiments.

[0125] Among them, the electronic device 100, computer storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0126] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0127] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0128] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0129] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0130] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0131] The above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit the present application. Although the present application has been described in detail with reference to the above preferred embodiments, those skilled in the art should understand that modifications or equivalent replacements of the technical solutions of the present application should not depart from the spirit and scope of the technical solutions of the present application.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. A Bluetooth audio playback method, applied in an electronic device, wherein the electronic device is communicatively connected with a Bluetooth device, characterized in that: The method comprises: receiving an operation instruction from a user on the electronic device; If the operation instruction is a play instruction, in a case where the number of Track audio tracks increases, the play instruction is sent to the Bluetooth device, wherein the play instruction is used to set the audio state of the Bluetooth device to play, and the case where the number of Track audio tracks increases includes: the number of Track audio tracks changes from 0 to 1; If the operation instruction is a pause instruction, when the number of the Track audio tracks decreases, the pause instruction is sent to the Bluetooth device, and the pause instruction is used to set the audio state of the Bluetooth device to pause. The situation where the number of the Track audio tracks decreases includes: the number of the Track audio tracks changes from 1 to 0.

2. The Bluetooth audio playback method according to claim 1, wherein: The receiving of an operation instruction from a user on the electronic device includes: The audio manager of the electronic device obtains a play command from an application of the electronic device, creates the Track audio track of the audio data according to the play command, and determines the number of the Track audio tracks.

3. The Bluetooth audio playback method according to claim 2, wherein: When the number of Track tracks increases, sending a play instruction to the Bluetooth device includes: The hardware abstraction layer of the electronic device obtains the number of the Track audio tracks from the audio framework layer of the electronic device; When the hardware abstraction layer determines that the number of the Track audio tracks increases, sending the audio status of the playback to the Bluetooth protocol stack of the hardware abstraction layer; The Bluetooth protocol stack sends the play instruction to the Bluetooth device in response to the audio state of the play.

4. The Bluetooth audio playback method according to claim 1, wherein: When the number of the Track audio tracks decreases, sending a pause instruction to the Bluetooth device includes: The hardware abstraction layer of the electronic device obtains the number of the Track audio tracks from the audio framework layer of the electronic device; When the hardware abstraction layer of the electronic device determines that the number of the Track audio tracks is reduced, sending the paused audio state to the Bluetooth protocol stack of the hardware abstraction layer; The Bluetooth protocol stack sends the pause instruction to the Bluetooth device in response to the paused audio state.

5. The Bluetooth audio playback method according to claim 1, wherein: The receiving of an operation instruction from a user on the electronic device includes: The audio manager of the electronic device obtains a pause command from an application of the electronic device; The audio manager of the electronic device deletes the Track audio track according to the pause command and determines the number of the Track audio tracks.

6. The Bluetooth audio playback method according to claim 2, wherein: Determining the number of Track audio tracks includes: The audio manager deletes the Track audio track when determining that the playback of the audio data is finished.

7. The Bluetooth audio playback method according to claim 1, wherein: The receiving of an operation instruction from a user on the electronic device includes: In response to the operation of switching the audio data of the first playback scene of the application of the electronic device to the audio data of the second playback scene, the audio manager of the electronic device deletes the Track audio track of the audio data of the first playback scene and creates the Track audio track of the audio data of the second playback scene; wherein, the audio data of the first playback scene is not continuous with the audio data of the second playback scene.

8. The Bluetooth audio playback method according to claim 1, wherein: When the number of Track tracks increases, sending a play instruction to the Bluetooth device includes: When the number of the Track audio track changes from 0 to 1, the play instruction is sent to the Bluetooth device.

9. The Bluetooth audio playback method according to claim 1, wherein: When the number of the Track audio tracks decreases, sending a pause instruction to the Bluetooth device includes: When the number of the Track audio track changes from 1 to 0, the pause instruction is sent to the Bluetooth device.

10. An electronic device, characterized in that: comprising a processor and a memory; wherein the processor is coupled to the memory; The memory is used to store program instructions; The processor is configured to read the program instructions stored in the memory to implement the Bluetooth audio playback method according to any one of claims 1 to 9.

11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores program instructions, and when the program instructions are executed by a processor, the Bluetooth audio playback method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Methods, systems, and program products for controlling the playback of music

    CN102339626A

  • Multitone trace digital recording / playback device, method and program

    CN1341933A