Audio processing method, device, electronic device and computer-readable medium
By pre-establishing an audio data transmission channel between the wireless audio playback device and the electronic device, the delay problem of the wireless audio playback device is solved, and the user experience is improved, especially when short audio playback is frequently triggered.
Patent Information
- Application Number
- CN202110502392.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-08
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-05-08
AI Technical Summary
Wireless audio playback devices experience delays when receiving and playing audio data, resulting in a poor user experience. This delay is particularly prominent when short audio playback is frequently triggered.
Before receiving a play request, an audio data transmission channel is established between the electronic device and the wireless audio playback device in advance to avoid establishing a channel again when a play request is received. An asynchronous connectionless link such as an ACL link and the A2DP protocol is used for audio data transmission.
By pre-establishing an audio data transmission channel, the audio playback delay is reduced and the user experience is improved, especially when short audio playback is frequently triggered.
Smart Images

Figure CN115314865B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio technology, and more specifically, to an audio processing method, device, electronic device, and computer-readable medium. Background Art
[0002] With the advancement of science and technology, electronic devices have become one of the most commonly used electronic products in people's daily lives. Furthermore, users often use wireless audio players connected to these electronic devices to receive and play audio data from these devices. However, if the latency when wireless audio players receive and play audio data is too high, the user experience can be poor. Summary of the Invention
[0003] This application proposes an audio processing method, device, electronic device and computer-readable medium to improve the above-mentioned defects.
[0004] In a first aspect, an embodiment of the present application provides an audio processing method, applied to an electronic device, the method comprising: obtaining a playback request for target audio data to be played; in response to the playback request for the target audio data, sending the target audio data to the wireless audio playback device through a pre-established audio data transmission channel between the electronic device and the wireless audio playback device, instructing the wireless audio playback device to play the target audio data, wherein the audio data transmission channel is established based on a wireless link between the electronic device and the wireless audio playback device before obtaining the playback request.
[0005] In a second aspect, an embodiment of the present application further provides an audio processing device for use in an electronic device, the audio processing device comprising: an acquisition unit and a playback unit. The acquisition unit is configured to acquire a playback request for target audio data to be played. The playback unit is configured to respond to the playback request for the target audio data by sending the target audio data to the wireless audio playback device via a pre-established audio data transmission channel between the electronic device and the wireless audio playback device, thereby instructing the wireless audio playback device to play the target audio data, wherein the audio data transmission channel is established based on a wireless link between the electronic device and the wireless audio playback device before the playback request is acquired.
[0006] In a third aspect, an embodiment of the present application also provides an electronic device, comprising: one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the above method.
[0007] In a fourth aspect, an embodiment of the present application also provides an audio processing method, which is applied to an electronic device, and the method includes: when it is determined that the preset interface of the electronic device meets the preset conditions, transmitting preset audio data to the wireless unit of the electronic device; the wireless unit triggers the establishment of an audio data transmission channel between the electronic device and the audio playback device based on the established wireless link based on the preset audio data.
[0008] In the fifth aspect, an embodiment of the present application also provides an audio processing device, which is applied to an electronic device, and the audio processing device includes: a determination unit, which is configured to transmit preset audio data to a wireless unit of the electronic device when it is determined that the preset interface of the electronic device meets a preset condition; the wireless unit is configured to trigger the establishment of an audio data transmission channel between the electronic device and the audio playback device based on the established wireless link based on the preset audio data.
[0009] In a sixth aspect, an embodiment of the present application further provides a computer-readable medium, wherein the computer-readable storage medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the above method.
[0010] The audio processing method, device, electronic device, and computer-readable medium provided by the present application establish an audio data transmission channel based on the wireless link between the electronic device and the wireless audio playback device before obtaining the playback request. Then, when a playback request for the target audio data to be played is obtained, the target audio data is sent to the wireless audio playback device through the pre-established audio data transmission channel, instructing the wireless audio playback device to play the target audio data. Therefore, it is possible to avoid establishing an audio data transmission channel only when a playback request for the target audio data is obtained, and further avoid delaying the playback of the target audio data due to the delay in establishing the audio data transmission channel, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0012] Figure 1 A module diagram of a voice system provided by an embodiment of the present application is shown;
[0013] Figure 2 A module diagram of a speech system provided by another embodiment of the present application is shown;
[0014] Figure 3 A module diagram of a speech system provided by another embodiment of the present application is shown;
[0015] Figure 4 A schematic diagram of a designated interface provided by an embodiment of the present application is shown;
[0016] Figure 5 A schematic diagram of a designated interface provided by another embodiment of the present application is shown;
[0017] Figure 6 A schematic diagram of an audio playback module provided in an embodiment of the present application is shown;
[0018] Figure 7 A schematic diagram showing a process for establishing an audio data transmission channel provided by an embodiment of the present application is shown;
[0019] Figure 8 A flowchart of an audio processing method provided by an embodiment of the present application is shown;
[0020] Figure 9 A flowchart of an audio processing method provided by another embodiment of the present application is shown;
[0021] Figure 10 A schematic diagram of a designated interface provided by another embodiment of the present application is shown;
[0022] Figure 11 Shown Figure 10 Method flow chart of S910;
[0023] Figure 12 A flowchart of an audio processing method provided by another embodiment of the present application is shown;
[0024] Figure 13 A schematic diagram of a payment interface provided in an embodiment of the present application is shown;
[0025] Figure 14 A diagram showing changes in a designated interface provided by an embodiment of the present application is shown;
[0026] Figure 15 A flowchart of an audio processing method provided by yet another embodiment of the present application is shown;
[0027] Figure 16 A flowchart of an audio processing method provided by yet another embodiment of the present application is shown;
[0028] Figure 17 A diagram showing the interaction between an electronic device and a wireless audio playback device provided in an embodiment of the present application is shown;
[0029] Figure 18A module block diagram of an audio processing device provided by an embodiment of the present application is shown;
[0030] Figure 19 A module block diagram of an audio processing device provided by another embodiment of the present application is shown;
[0031] Figure 20 A schematic diagram of an electronic device provided in an embodiment of the present application is shown;
[0032] Figure 21 A storage unit provided in an embodiment of the present application for storing or carrying program code for implementing the audio processing method according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0034] As the variety of audio playback devices increases and audio quality improves, more and more users choose to output the audio to be played on electronic devices such as mobile phones and tablets to audio playback devices for playback. Among them, common audio playback devices include car music players, speakers, and headphones.
[0035] Audio playback devices can be divided into wired audio playback devices and wireless audio playback devices according to different connection methods. Electronic devices can interact with wireless audio playback devices through a wireless network to transmit signals, wherein the wireless network can be Bluetooth, WiFi, LTE network or NFC, etc.
[0036] For example, Figure 1 As shown, a module diagram of the voice system 1 provided in an embodiment of the present application is shown. Specifically, the voice system 1 includes an electronic device, a first wireless audio playback device 210 and a second wireless audio playback device 220, and the electronic device can be connected to the first wireless audio playback device 210 and the second wireless audio playback device 220 at the same time. As an embodiment, the electronic device can be a smart phone, a tablet computer, an e-book, a smart wearable device, or other device that can run applications. The first wireless audio playback device 210 and the second wireless audio playback device 220 constitute a true wireless stereo (True Wireless Stereo, TWS) headset, wherein the left and right earphones of the TWS headset are independent of each other and do not need to be connected by a cable, thereby achieving wireless separation of the left and right channels.
[0037] In an embodiment of the present invention, a mobile terminal 10 (an embodiment of an electronic device 1) is installed with an application capable of playing audio. Specifically, the application may be audio playback software, video playback software, call software, or other software capable of triggering audio playback. The mobile terminal 10 sends the audio to be played to the first wireless audio playback device 210 or the second wireless audio playback device 220, which then plays the audio.
[0038] In an embodiment of the present invention, the first wireless audio playback device 210 and the second wireless audio playback device 220 can both be Bluetooth speakers or Bluetooth headphones. The first wireless audio playback device 210 and the second wireless audio playback device 220 can be connected to the mobile terminal 10 by turning on the Bluetooth function. After the connection is established, the mobile terminal 10 sends the voice to be played to the Bluetooth speaker, and the Bluetooth speaker plays the voice.
[0039] When the first wireless audio playback device 210 and the second wireless audio playback device 220 are both Bluetooth devices, the mobile terminal 10 can be connected to the first wireless audio playback device 210 and the second wireless audio playback device 220 at the same time through the Bluetooth module. As an embodiment, the Bluetooth module in the electronic device can support multi-point connection, thereby enabling Figure 1 The electronic device shown is connected to the first wireless audio playback device 210 and the second wireless audio playback device 220 respectively. After the connection is established, the mobile terminal 10 can obtain the identification of the first wireless audio playback device 210 and the second wireless audio playback device 220, which can be a MAC address. Specifically, when the Bluetooth function of the electronic device is turned on, the electronic device will scan for Bluetooth devices within a certain distance range. Specifically, after the Bluetooth chip or other underlying network module of the electronic device receives the scan command, it scans according to a preset channel scan order, such as first scanning commonly used channels 1, 7, and 13, and then scanning other less commonly used channels, thereby obtaining the identification of all Bluetooth devices in the current range and displaying them in the Bluetooth list interface of the electronic device.
[0040] If there is a Bluetooth device that has been connected and has good signal strength among the scanned Bluetooth device identifiers, the electronic device will automatically connect to the Bluetooth device, thereby establishing a wireless link between the electronic device and the wireless audio playback device.
[0041] As another embodiment, Figure 2As shown, the mobile terminal 10 is connected to the first wireless audio playback device 210 via Bluetooth, and then the first wireless audio playback device 210 is connected to the second wireless audio playback device 220 via Bluetooth. Thus, the mobile terminal 10, the first wireless audio playback device 210 and the second wireless audio playback device 220 are simultaneously connected through networking, that is, the first wireless audio playback device 210 acts as a repeater for the mobile terminal 10 and the second wireless audio playback device 220.
[0042] As an implementation method, a designated interface is displayed on the screen of the electronic device, and a designated operation component is set in the designated interface. When the user triggers the designated operation component, the wireless audio playback device can play the audio corresponding to the designated operation component. Figure 1 and 2 As shown, the designated interface may be a dialing interface of a call application, where a user can enter a call number and call the terminal corresponding to the call number. The designated operation component may be a button capable of triggering a key tone, for example, a numeric key 101 in the interface.
[0043] like Figure 3 The electronic device may also be a smart wearable device 20, which may also establish a wireless link with the first wireless audio playback device 210 and the second wireless audio playback device 220. The smart wearable device 20 may also display a specified interface, and when the user triggers a specified operation component displayed on the smart wearable device 20, the wireless audio playback device may play the audio corresponding to the specified operation component.
[0044] like Figure 4 As shown, the designated interface may also be an information input interface, in which an input component 102 is displayed, such as Figure 4 As shown, the input component 102 can be a keyboard, and the designated operation component in the designated interface is the input component 102. When the user triggers each key on the keyboard, the electronic device can play the key tone corresponding to the key. When the electronic device is connected to the wireless audio playback device, the key tone can be played through the wireless audio playback device.
[0045] As another embodiment, the designated interface may also be a multimedia playback interface, which may be an interface for playing audio or video, such as Figure 5 As shown, the designated interface may be an audio playback interface, and the designated operation component is the play button 103 in the audio playback interface. When the user triggers the play button 103, the audio corresponding to the button 103 can be played. For example, the button tone corresponding to the button 103.
[0046] Currently, after an electronic device establishes a wireless link with a wireless audio player, when the electronic device requests to play audio data through the wireless audio player, the electronic device and the wireless audio player need to establish an audio data transmission channel on the basis of maintaining the wireless link. The electronic device sends the audio data to the wireless audio player through the audio data transmission channel, and the wireless audio player plays the audio data. Specifically, Figure 6 As shown, assuming Figure 6 The application in the example is a call application. When the user taps the numeric keys on the dial pad in the call application's dialing interface, a prompt tone is generated. The electronic device's audio subsystem then notifies the user that audio data needs to be played. Since a wireless link has been established between the electronic device and the wireless audio playback device, the audio subsystem sends the audio stream to the electronic device's wireless unit, triggering the wireless unit to establish an audio data transmission channel. The wireless unit can communicate with various networks, such as the Internet, an intranet, or a wireless network, or with other devices via a wireless network. The wireless network described above may include a cellular telephone network, a wireless local area network, or a metropolitan area network. The wireless networks may utilize various communication standards, protocols, and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), wideband code division multiple access (W-CDMA), code division multiple access (CDMA), time division multiple access (TDMA), Wireless Fidelity (WiFi) (e.g., Institute of Electrical and Electronics Engineers standards IEEE 802.10A, IEEE 802.11b, IEEE 802.11g, and / or IEEE 802.11n), Voice over Internet Protocol (VoIP), Worldwide Interoperability for Microwave Access (Wi-Max), Bluetooth, other protocols for email, instant messaging, and short messaging, and any other suitable communication protocols.
[0047] In an embodiment of the present application, the wireless link is a Bluetooth communication channel, and the wireless unit is a Bluetooth module (Bluetooth framework). The electronic device preferably uses Bluetooth to output the wireless audio player. Then, the audio system sends the audio stream to the Bluetooth module of the electronic device. Specifically, the audio hardware abstraction layer (Audio A2dp Hal) of the audio system sends the audio stream to the Bluetooth interface (audio bt interface) of the Bluetooth module, and the audio stream can trigger the establishment of an audio data transmission channel between the Bluetooth module and the wireless audio player. Wherein, streaming media data (Stream) is transmitted between the electronic device and the wireless audio player via Bluetooth media audio transmission protocol (Advanced Audio Distribution Profile, A2DP). Wherein, Stream refers to streaming media data transmitted point-to-point between two Bluetooth devices. The audio data transmission channel is the Stream transmission channel established based on the A2DP protocol between the Bluetooth module and the wireless audio player.
[0048] like Figure 7 As shown, Figure 7 The process of establishing an audio data transmission channel between an electronic device and a wireless audio playback device is shown, wherein the electronic device sends a transmission start request to the wireless audio playback device based on the audio stream. After the electronic device receives the transmission response request replied by the wireless audio playback device, an audio data transmission channel is established between the electronic device and the wireless audio playback device. The electronic device sends the audio stream to the wireless audio playback device through the audio data transmission channel, and the wireless audio playback device plays the audio stream. The transmission start request is AVDTP_Start, and the transmission response request is AVDTP_Start_Resp. AVDTP is the Audio / Video Distribution Transport Protocol, which defines the parameter negotiation, establishment and transmission process of data stream handles between Bluetooth devices, as well as the form of signaling entities exchanged with each other. This protocol is the basic protocol of the A2DP framework.
[0049] The inventor found in the study that when a user receives audio data of an electronic device through a wireless audio playback device connected to the electronic device and plays it, the wireless audio playback device will encounter a playback delay when receiving and playing the audio data, which will result in a poor user experience. This is because after the electronic device establishes a wireless communication connection with the wireless audio playback device, only when the electronic device requests to play audio, the audio system of the electronic device will inform the Bluetooth module that there is currently streaming media that needs to be played. The Bluetooth module, i.e., the SRC end, will then notify the SNK end that there is an audio stream to be transmitted. Only after receiving a reply from the SNK end and establishing an audio data transmission channel, can the mobile phone end start transmitting the audio stream. Among them, the SRC (Source) end is the audio source output side defined by the Bluetooth A2DP protocol, and the SNK (Sink) end is the audio source receiver defined by the Bluetooth A2DP protocol.
[0050] Since electronic devices and wireless audio playback devices use the above-mentioned audio streaming transmission logic, the audio data transmission channel will only be established when the audio is playing, and the audio data transmission channel will be disconnected when the playback ends. Therefore, after the user triggers the audio playback, it is necessary to wait for the audio data transmission channel to be established before the audio can be played. In addition, when an audio is played, an audio data transmission channel will be established. When the audio playback ends, the audio data transmission channel will be disconnected. The audio data transmission channel will be established again when the audio is played next time. All of these will cause audio playback delays, especially for audio that is relatively short and triggered frequently, such as the prompt tone generated by the dial pad / keyboard tapping. The delay problem is particularly prominent, and the user experience is poor.
[0051] Therefore, in order to overcome the above-mentioned defects, the embodiments of the present application provide an audio processing method device and an electronic device, which can pre-establish an audio data transmission channel before obtaining the playback request, and can avoid establishing the audio data transmission channel only when the playback request of the target audio data is obtained, so that the playback of the target audio data is delayed due to the establishment of the audio data transmission channel, resulting in a delay in audio playback, thereby improving the user experience.
[0052] See also Figure 8 , Figure 8 An audio processing method provided in an embodiment of the present application is shown. The method can be applied to the above-mentioned electronic device. Specifically, the method can include: S801 and S802.
[0053] S801: Obtain a play request for target audio data to be played.
[0054] As an embodiment, the target audio data may be the above-mentioned Figures 4 to 6The audio data corresponding to the designated operation component in the designated interface shown may be, for example, a key tone, or audio or video data corresponding to a play button.
[0055] As another embodiment, the target video data may also be audio data triggered by the user in a manner other than touching the screen. For example, the target video data may be data requested for playback by the user through a voice command, or may be audio data actively triggered by the user through biometric information, or other triggering conditions set by the user. The biometric information may be the user's facial features or iris features, and the other triggering conditions may be triggering events pre-set by the user. For example, the triggering event may be a specified condition trigger, wherein the specified condition trigger may include a specified time or a specified operating state of the electronic device as a condition for triggering audio playback.
[0056] As an embodiment, the target audio data is characterized by a short duration and a high triggering frequency, wherein the short duration may be a duration less than a specified time length, and the specified time length can be set according to actual needs. For example, it can be 0.5-3 seconds, specifically, it can be 1 second. The duration can be the duration of a single play, and the duration can be the length of time from when the audio is started to play until the play ends or the play is paused. The high triggering frequency can be that the number of times the target audio data is played within the specified time length is higher than the specified number, or that the number of times the audio data of the same audio type as the target audio data is played within the specified time length is higher than the specified number. For example, if the target audio data is audio triggered by a key, then the type of the target audio data is a key tone type. If the number of times all key tones are played within the specified time length is higher than the specified number, it can be determined that the triggering frequency of the target audio data is high.
[0057] In addition, if the target audio data is a song type, if the number of times the song type audio data is played within the specified time length is higher than the specified number, it can be determined that the target audio data trigger frequency is high. Among them, switching from the pause or end of play state to the start play state is recorded as one time. For example, the user Figure 5 In the interface shown, if the user clicks the play button multiple times within the specified time, the song selected by the user will be paused and started multiple times, and the number of times the song selected by the user is played within the specified time length exceeds the specified number of times. In addition, if the user clicks play multiple times and the duration of each click is relatively short, for example, less than the specified time length, then the song selected by the user meets both the short duration and high trigger frequency requirements. Therefore, it can be determined that the song selected by the user belongs to the target audio data.
[0058] S802: In response to a request to play the target audio data, the target audio data is sent to the wireless audio playback device through a pre-established audio data transmission channel between the electronic device and the wireless audio playback device, and the wireless audio playback device is instructed to play the target audio data.
[0059] The audio data transmission channel is established based on a wireless link between the electronic device and the wireless audio playback device before the playback request is obtained. Specifically, the wireless link can be a physical link between the electronic device and the wireless audio playback device, and the physical link between the electronic device and the wireless audio playback device can be an asynchronous connectionless (ACL) link, wherein the ACL link is a connection-oriented logical link for Bluetooth asynchronous transmission.
[0060] The process of establishing a wireless link between an electronic device and a wireless audio playback device can be that the electronic device acts as a master device and the wireless audio playback device acts as a slave device. The master device pages the slave device. Specifically, the master device pages the slave device in a frequency hopping manner. The slave device scans for external paging at fixed intervals. When an external paging request is scanned, it responds to the paging request. In this way, a physical link connection, such as an ACL link connection, is established between the two devices, thereby completing the wireless link between the electronic device and the wireless audio playback device.
[0061] Once the ACL link is established, the master device can initiate an audio data transmission channel to the wireless audio playback device. For example, this audio data transmission channel can be the aforementioned A2DP protocol transmission channel. A2DP is an audio protocol established on the ACL link. A2DP defines the protocol and process for transmitting mono or stereo audio data over the ACL channel.
[0062] As an embodiment, the audio data transmission channel can be pre-established before a playback request for the target audio data to be played is received. Specifically, when a pre-establishment condition for the audio data transmission channel is met, the audio data transmission channel is established between the electronic device and the wireless audio playback device. The pre-establishment condition for the audio data transmission channel is used to indicate that a playback request for the target audio data is about to be received, that is, the electronic device predicts that a playback request for the target audio data to be played is about to be received.
[0063] As an implementation method, the electronic device may determine whether the pre-established conditions for the audio data transmission channel are met based on the electronic device's usage status, the current time period, or the electronic device's location information. The electronic device's usage status may include an unused state and an used state. In this embodiment of the present application, it is possible to predict whether a playback request for the target audio data is about to be received based on the current moment and the electronic device's location information and usage status.
[0064] In some embodiments, it is determined whether the current moment is within a specified time period, wherein the specified time period can be a time period determined in advance based on the user's habit of using the electronic device or the user's behavioral data, and the possibility that the user will operate the above-mentioned specified operation component within the time period is greater than a specified threshold. For example, the operation time and the location information of the electronic device are counted each time the user operates the specified operation component within the specified time period, and the period in which the frequency of the operation is greater than the specified frequency is taken as the specified time period, and the location information of the electronic device within the specified time period is recorded, and the concentrated distribution area of the location information is obtained, and the concentrated distribution area is taken as the specified location. Therefore, when it is determined that the current moment is the specified time period, the current location information of the electronic device is at the specified location, and the electronic device is in use, it is determined that a playback request for the target audio data is about to be obtained, then an audio data transmission channel between the electronic device and the wireless audio playback device can be established in advance.
[0065] As another implementation, the electronic device may determine whether the pre-established conditions for the audio data transmission channel are met based on the application currently running on the electronic device or the interface displayed on the screen.
[0066] It should be noted that in addition to the two aforementioned implementations, other implementations may be used to predict whether a request to play the target audio data is about to be received. For example, based on a scheduled task set by a user that triggers the playback of audio data, a determination is made as to whether a request to play the target audio data is about to be received at a preset time before the response time of the scheduled task.
[0067] Therefore, the method provided in the embodiment of the present application can avoid establishing an audio data transmission channel only when a playback request for the target audio data is obtained, so that the playback of the target audio data is delayed due to the establishment of the audio data transmission channel, resulting in a delay in audio playback, thereby improving the user experience.
[0068] See also Figure 9 , Figure 9 An audio processing method provided in an embodiment of the present application is shown. The method can be applied to the above-mentioned electronic device. Specifically, the method can include: S910 and S960.
[0069] S910: When it is detected that the designated application is in the foreground running state, an audio data transmission channel is established between the electronic device and the wireless audio playback device.
[0070] In an embodiment of the present application, satisfying the channel pre-establishment condition includes detecting that a designated application is in the foreground running state. The designated application is used to trigger the playback of the target audio data, that is, the designated application has the function of audio playback or has an operation button or program that can trigger audio playback. Specifically, the designated application can control the display of a designated interface, and specifically, the user can open the designated interface by operating the designated application. In some embodiments, the interface of the designated application includes a designated interface. In other embodiments, the designated interface is the interface of other applications, and the designated application can call the designated interface of the other application.
[0071] As an implementation method, the running state of the specified application includes a foreground running state, a background running state and a non-running state. The foreground running state means that the application is running on the screen by the interface, and the user can interact with the application through the interface, for example, inputting execution instructions or observing some information through the interface. The background running state means that the application is running in the system's resource manager, but generally there is no interface. When the user starts the application for the first time, the application runs on the screen of the first screen, that is, it is in the foreground running state. When the user clicks the home button, or switches other applications to the foreground or locks the mobile terminal, the state of the application changes to the background running state. The non-running state means that the application is not started, that is, it is not in the foreground running state, nor in the background running state. Specifically, when the application is running in the foreground or background, the process of the application is killed, and at this time the application is in the non-running state, also called the closed state.
[0072] The implementation method of detecting that the specified application is running may be to detect that the running state of the specified application is foreground running or background running.
[0073] As another embodiment, the designated application triggers the playback of the target audio data based on a user triggering operation on the designated application. For example, the user opens a designated interface through the designated application, triggering a designated operation component of the designated interface to trigger a request to play the target audio data. Therefore, the designated application needs to be displayed on the screen of the electronic device so that the user can operate the designated application. In other words, the designated application needs to be in the foreground running state before the designated application is detected and the audio data transmission channel is established.
[0074] Specifically, when a designated interface is displayed on the screen, the audio corresponding to the audio and video identifier displayed in the designated interface or the background sound of the designated interface is automatically played, wherein the audio identifier can be the name of the audio and video data. For example, a video playback window is displayed in some interfaces. When the interface is displayed, the video in the video playback window is automatically played, and then the audio is output. The audio and video identifier can be the identifier of the playback component corresponding to the audio and video (for example, the aforementioned playback window), or the name of the audio and video. In the case where the audio data is automatically played when the designated interface is displayed on the screen, an audio data transmission channel is established when the designated application is detected to be running.
[0075] As an implementation method, although the designated application has the function of playing audio data, not every interface of the designated application belongs to the designated interface. For example, Figure 10 As shown, assuming that the designated application is a call application, Figure 10 The interface shown is a call interface. The buttons in the call interface will not trigger the playback of audio data. When the user presses the "Keyboard" button, the Figure 1 、 2 3, each button in the dialing interface will trigger the playback of audio data, so the dialing interface is a designated interface.
[0076] In some embodiments, when a specified application is running on the screen, the operation of establishing an audio data transmission channel may not be performed first. When it is detected that the specified interface of the specified application is in a display state, the operation of establishing an audio data transmission channel is performed, wherein the specified interface includes a specified operation component, and the specified operation component is used to trigger the playback of the target audio data. Specifically, for the specified interface, please refer to the above description and will not be repeated here.
[0077] As an implementation method, the implementation method of establishing the audio data transmission channel can refer to Figure 11 , then S910 includes: S911 to S917.
[0078] S911: Triggering a playback request for preset audio data.
[0079] As an implementation method, the target audio data may be audio data based on user triggering, wherein the user triggering may include the user triggering through a designated operation component of a designated interface and the user triggering through setting a task execution condition. For example, the task specified condition may include the execution time, etc. In the embodiment of the present application, the target audio data is the audio data generated by the user triggering the designated operation component of the designated interface, and the preset audio data is the audio data played independently of the user triggering. Specifically, the triggering condition of the preset audio data is that it is predicted that a playback request for the target audio data will be obtained. Specifically, the triggering condition may be the aforementioned satisfaction of the channel pre-establishment condition, that is, when the channel pre-establishment condition is satisfied, the playback request of the preset audio data is triggered. Specifically, it may be detecting that the designated application is running in the foreground or detecting that the designated interface is in a display state, etc.
[0080] Specifically, when a wireless link (e.g., the aforementioned ACL link) has been established between the electronic device and the wireless audio playback device, and it is predicted that a playback request for the target audio data will be obtained soon, a playback request for the preset audio data is automatically triggered. That is, the audio system writes the preset audio data to the Bluetooth module, which triggers the Bluetooth module to establish an audio data transmission channel between the electronic device and the wireless audio playback device. At this time, the electronic device first determines whether the electronic device and the wireless audio playback device are in low power consumption mode, that is, executes S912.
[0081] As an implementation method, given that in the current operating system, the audio system requires a playback request for audio data to trigger notification of Bluetooth to establish an audio data transmission channel, therefore, Bluetooth can be triggered to establish an audio data transmission channel by triggering a playback request for preset audio data.
[0082] As another implementation, the operating system may also set a specified message within itself to trigger Bluetooth to establish an audio data transmission channel. The specified message may be pre-agreed upon, and upon Bluetooth receiving the specified message, the operation of establishing the audio data transmission channel is triggered. S911 may then be replaced by sending the specified message to the Bluetooth module, triggering the Bluetooth module to establish the audio data transmission channel.
[0083] S912: Determine whether the electronic device and the wireless audio playback device are in a low power consumption mode.
[0084] Among them, the low power mode is also called the sniff mode. This mode saves power by reducing the number of time slots in which the master device sends data and correspondingly reducing the number of time slots in which the slave device monitors.
[0085] S913: Exit low power mode.
[0086] In this low-power mode, the data transmission speed between the electronic device and the wireless audio playback device is low. If audio data is transmitted in this mode, the audio data transmission time will be too long, resulting in excessive delay in audio playback. Therefore, it is determined whether the electronic device and the wireless audio playback device are in low-power mode. If at least one of the electronic device and the wireless audio playback device is in low-power mode, it is controlled to exit the low-power mode. Only when both the electronic device and the wireless audio playback device exit the low-power mode, the operation of establishing the audio data transmission channel is performed, that is, S914 and subsequent operations are executed.
[0087] S914: Determine whether an audio data transmission channel has been established between the electronic device and the wireless audio playback device.
[0088] If an audio data transmission channel has been established between the electronic device and the wireless audio player, then S920 is executed, that is, the target audio data is transmitted using the established audio data transmission channel. If an audio data transmission channel has not been established between the electronic device and the wireless audio player, then S915 is executed.
[0089] S915: Send a transmission start request to the wireless audio playback device.
[0090] As an implementation method, assuming that the electronic device is the SRC end, the wireless audio playback device is the SNK end, and the transmission start request is AVDTP_Start, if an audio data transmission channel is not established between the electronic device and the wireless audio playback device, the SRC end will send an AVDTP_Start command to the SNK end.
[0091] S916: Obtain the transmission response request returned by the wireless audio playback device.
[0092] The SNK end receives the AVDTP_Start and returns a transmission response request (ie, AVDTP_Start_Resp) if the audio data transmission channel is allowed to be established with the electronic device.
[0093] S917: Establishing an audio data transmission channel between the electronic device and the wireless audio playback device.
[0094] After obtaining the transmission response request, the electronic device establishes an audio data transmission channel between the electronic device and the wireless audio playback device.
[0095] S920: Obtain a playback request of the target audio data triggered by the user based on the designated operation component.
[0096] As an implementation manner, when a designated interface of a designated application is running on the screen, the user triggers a request to play the target audio data based on the designated interface. For details, please refer to the aforementioned embodiment.
[0097] S930: In response to the playback request of the target audio data, the target audio data is sent to the wireless audio playback device through the pre-established audio data transmission channel between the electronic device and the wireless audio playback device, and the wireless audio playback device is instructed to play the target audio data.
[0098] S940: Determine whether the specified application is in the foreground running state.
[0099] After the target audio data is sent to the wireless audio playback device, specifically, after the target audio data is played, the running status of the designated application is obtained, and it is determined whether the running status is closed. If so, it is determined that the designated application is closed; if the running status is not closed, it is determined that the designated application is not closed.
[0100] As an embodiment, it can be after the specified application is run, judge whether the specified application is closed according to the specified monitoring period.As another embodiment, it can also be when finishing playing audio data at each time, judge whether the specified application is closed.
[0101] In some embodiments, if the designated application is determined to be running when the designated interface of the designated application is detected to be in a displayed state, then the designated application being closed may mean that the designated interface is closed, that is, the designated interface is not in a displayed state. Therefore, upon determining that the designated interface of the designated application is closed, the designated application is determined to be closed. In other embodiments, the designated application may be determined to be closed only when the designated application is in a closed state, that is, when the designated application is neither running in the foreground nor in the background. In other words, even if the designated interface is detected to be closed, as long as the designated application is not in a closed state, the designated application is determined to be not closed.
[0102] S950: Keep the audio data transmission channel connected.
[0103] If the designated application is in the foreground running state, S950 is executed, that is, during the time period when the designated application is in the foreground running state, the audio data transmission channel is kept in a connected state, and new audio data triggered by the subsequent designated application can still be sent to the wireless audio playback device through the audio data transmission channel, avoiding the audio data transmission channel being disconnected immediately after the audio data is played, and the need to establish a new audio data transmission channel when playing new audio data again.
[0104] S960: Disconnect the audio data transmission channel.
[0105] As an embodiment, when an audio data transmission channel is established between an electronic device and a wireless audio playback device using the above-mentioned preset audio data, the preset audio data triggers a play request. After the audio data transmission channel is established, the electronic device will play the preset audio data to the wireless audio playback device through the audio data transmission channel. In order to avoid the wireless audio playback device disturbing the user by playing the preset audio data, a volume parameter can be set for the preset audio data. Specifically, after the audio data transmission channel between the electronic device and the wireless audio playback device is established based on the permission request, the preset audio data is sent to the wireless audio playback device through the audio data transmission channel, instructing the wireless audio playback device to play the preset audio data based on the volume parameter corresponding to the preset audio data, wherein the volume parameter is less than the specified volume value.
[0106] As an embodiment, the preset audio data corresponds to a volume parameter. The volume parameter can be a playback volume pre-configured by an electronic device for the preset audio data. The volume parameter is sent to the wireless audio playback device together with the preset audio data. The wireless audio playback device plays the preset audio data based on the volume parameter. For example, the volume at which the wireless audio playback device plays the preset audio data is the volume corresponding to the volume parameter. In an embodiment of the present application, the volume parameter is less than the specified volume value. The specified volume value is a smaller value. For example, the volume parameter can be a mute volume, so that the wireless audio playback device can play the preset audio data in silence, thereby not causing interference to the user.
[0107] As another embodiment, after automatically triggering a request to play the preset audio data, an audio data transmission channel may be established between the electronic device and the wireless audio playback device based on the request to play the preset audio data, and playback of the preset audio data may be canceled. In other words, the preset audio data is only used to trigger the electronic device to establish the audio data transmission channel, but the wireless audio playback device will not play the preset audio data.
[0108] As an embodiment, after the electronic device establishes an audio data transmission channel based on the playback request of the preset audio data, it will not send the preset audio data to the wireless audio playback device, and will keep the audio data transmission channel in a connected state. It should be noted that keeping the audio data transmission channel in a connected state here means keeping the connection state during the time period between the establishment of the audio data transmission channel and the end of the playback of the target audio data. After the playback of the target audio data ends, the electronic device determines whether to keep the audio data transmission channel connected based on the connection maintenance condition. Among them, the connection maintenance condition may include that the specified application is in the foreground running state, and may also include other conditions. Please refer to the subsequent description for details.
[0109] As an implementation method, the electronic device pre-sets corresponding ban information for the preset audio data. The ban information can be a pre-set information. The electronic device sends the preset audio data carrying the ban information to the wireless audio playback device. The wireless audio playback device recognizes that the preset audio data includes the ban information, and prohibits the execution of the playback operation of the preset audio data.
[0110] Therefore, before playing the target audio data, the audio data transmission channel can be triggered to be established based on the preset audio data, and the playing of the preset audio data will not interfere with the user.
[0111] See also Figure 12 , Figure 12 An audio processing method provided in an embodiment of the present application is shown. The method can be applied to the above-mentioned electronic device. Specifically, the method may include: S1201 and S1206.
[0112] S1201: When it is detected that the designated interface is in the display state, an audio data transmission channel is established between the electronic device and the wireless audio playback device.
[0113] As an embodiment, the designated interface may be an interface with designated content, wherein the designated content may be the aforementioned designated operating component. That is, the interface including the designated operating component may be recorded as the designated interface. Then, it is detected whether the interface displayed on the screen of the electronic device includes the designated operating component. If so, it is determined that the designated interface is detected. The designated operating component may include a button capable of triggering audio playback. Specifically, the button may be the aforementioned play button corresponding to the audio or video or a numeric button.
[0114] As an implementation method, after detecting that the interface displayed on the screen of the electronic device includes a designated operating component, the interface is used as a pending confirmation interface to determine whether the pending confirmation interface has the permission to play audio. If it has the permission to play audio, the pending confirmation interface is determined to be a designated interface. Specifically, taking the key tone as an example, although the system has enabled the permission of the keyboard key tone, some interfaces may actively block the key tone. Figure 13 As shown, this interface is a payment interface, in which a number key is displayed. Figures 1 to 3 Compared to the numeric keys in Figure 13 The numeric keys in the interface will not trigger the key tone, that is, the payment interface does not have the permission to play the key tone, so it cannot be used as a designated interface.
[0115] As another implementation method, determining whether the interface to be confirmed has permission to play audio can be implemented by determining the application corresponding to the interface and determining whether the application has permission to play audio. If so, determining that the interface to be confirmed has permission to play audio.
[0116] S1202: Obtain a playback request for the target audio data triggered by the user based on the designated operation component.
[0117] S1203: In response to the playback request of the target audio data, the target audio data is sent to the wireless audio playback device through the pre-established audio data transmission channel between the electronic device and the wireless audio playback device, and the wireless audio playback device is instructed to play the target audio data.
[0118] like Figure 14 As shown, Figure 14 In (a), when the designated interface is detected to be in the display state, a playback request of the preset audio data is automatically triggered; based on the playback request of the preset audio data, an audio data transmission channel is established between the electronic device and the wireless audio playback device. The specific implementation method of establishing the audio data transmission channel can refer to the above embodiment and will not be repeated here. Specifically, Figure 14 As shown in (a), taking the designated interface as an information input interface as an example, the information input interface includes an input component 102, which is a designated operation component. Figure 14 In (a), the user has not yet operated the input component 102. When the information input interface is displayed on the screen, the electronic device automatically triggers the sending of preset audio data to the wireless audio playback device. The preset audio data triggers the electronic device to establish an audio data transmission channel. Figure 14 As shown in (b), the establishment of the audio data transmission channel is completed. Figure 14As shown in (c), the user touches the input component 102 on the information input interface to input information. The input component 102 corresponds to a key tone, and the key tone audio data is sent to the wireless audio playback device through a pre-established audio data transmission channel as the target audio data, and is then played by the wireless audio playback device.
[0119] Therefore, by Figure 14 It can be seen that the audio data transmission channel between the electronic device and the wireless audio playback device has been established before the user triggers the key tone of the input component 102. S1204: Determine whether the designated interface is in a display state.
[0120] S1205: Keep the audio data transmission channel connected.
[0121] As an embodiment, the aforementioned condition for maintaining connection may be that the designated interface is in a display state. Specifically, if the designated interface is in a display state, S1205 is executed, that is, the audio data transmission channel is kept in a connected state during the time period when the designated interface is displayed on the screen of the electronic device.
[0122] S1206: Disconnect the audio data transmission channel.
[0123] In addition, in an embodiment of the present application, after establishing an audio data transmission channel between the electronic device and the wireless audio playback device based on the permission request, the preset audio data can be sent to the wireless audio playback device via the audio data transmission channel, instructing the wireless audio playback device to play the preset audio data based on a volume parameter corresponding to the preset audio data, wherein the volume parameter is less than the specified volume value. Alternatively, based on the playback request for the preset audio data, an audio data transmission channel can be established between the electronic device and the wireless audio playback device, and playback of the preset audio data can be canceled. For details, please refer to the aforementioned embodiment, which will not be repeated here.
[0124] As another embodiment, the aforementioned connection maintaining condition may also be that the current time is within a specified interval time period. Figure 15 , Figure 15 An audio processing method provided in an embodiment of the present application is shown. The method can be applied to the above-mentioned electronic device. Specifically, the method can include: S1501 to S1504.
[0125] S1501: Obtain a play request for target audio data to be played.
[0126] S1502: In response to a request to play the target audio data, the target audio data is sent to the wireless audio playback device through a pre-established audio data transmission channel between the electronic device and the wireless audio playback device, and the wireless audio playback device is instructed to play the target audio data.
[0127] S1503: Determine whether a new audio data playback request is obtained within a specified interval time period.
[0128] Wherein, the starting point of the specified interval time period may be the moment when the target audio data ends playing, and the specified interval time period takes the moment when the target audio data ends playing as the starting point and the duration as the specified duration. During the specified interval time period, the audio data transmission channel is in a connected state. That is to say, when the target audio data ends playing, the audio data transmission channel is kept in a connected state for a continuous specified interval time period. Wherein, the specified interval time period may be set based on the time interval between two adjacent playbacks when the target audio data is played continuously. As an embodiment, the time difference between two adjacent playback requests when the user plays the target audio data multiple times in a row may be counted in advance, thereby obtaining multiple time differences, and determining the time interval based on the multiple time differences. For example, the average value of the multiple time differences may be used as the time interval. The specified interval time period may then be set based on the time interval, for example, it may be N times the time interval, where N is a positive integer.
[0129] If new audio data is acquired again within the specified interval time period, the new audio data will be used as the new target audio data, and the new audio data can be sent to the wireless audio playback device for playback based on the audio data transmission channel, and the specified interval time period will be reset, that is, the starting point of the specified interval time period will be changed to the end time of playback of the new audio data.
[0130] S1504: Disconnect the audio data transmission channel.
[0131] If no new audio data playback request is obtained within a specified interval time period, the audio data transmission channel may be disconnected to save system resources of the electronic device and reduce power consumption.
[0132] As an implementation method, if an audio data transmission channel is established between the electronic device and the wireless audio playback device when a specified application is detected to be running, then after no new audio data playback request is obtained within a specified interval time period, it is determined whether the specified application is closed. If it is closed, the audio data transmission channel is disconnected; otherwise, the audio data transmission channel remains connected.
[0133] As another embodiment, if when it is detected that the designated interface of the designated application is in a display state, an audio data transmission channel is established between the electronic device and the wireless audio playback device, then after no new audio data playback request is obtained within a specified interval time period, it is determined whether the designated interface is in a display state, and if it is not in a display state, the audio data transmission channel is disconnected, otherwise, the audio data transmission channel is kept in a connected state.
[0134] It should be noted that, for the parts of the above steps that are not described in detail, reference can be made to the aforementioned embodiments and will not be repeated here.
[0135] Therefore, the embodiment of the present application can establish an audio data transmission channel between the electronic device and the wireless audio playback device before playing the target audio data, and send the target audio data to the wireless audio playback device through the audio data transmission channel for playback. Specifically, if the Bluetooth is in sniff mode before the SNK and SRC ends establish the audio transmission channel, the delay time will be longer. Generally, it takes 200 to 300 ms to exit the sniff mode, which aggravates the delay problem of audio playback. In addition, the time it takes for the SRC and SNK ends to establish the audio data transmission channel is about 100 to 800 ms. If the surrounding environment interference is more serious, this time will be even longer. When the user pauses in the process of operating the button, once the system prompt tone (i.e., the target audio data) triggered by the last button operation has been played, the audio data transmission channel between the Bluetooth SRC and SNK will be destroyed because there is no audio data to be transmitted. If the user operates the button again, the audio data transmission channel needs to be re-established.
[0136] In the present application, an audio data transmission channel will be pre-established when a designated application is started or a designated interface is started. The user can use the pre-established audio data transmission channel to send audio data based on the audio triggered by the application or the designated interface. Therefore, by pre-establishing the audio data transmission channel, it is possible to avoid the time required to wait for the exit of the low power mode and the time spent on establishing the audio data transmission channel when the user triggers the playback of audio data.
[0137] In addition, after the audio data is played, the audio data transmission channel will not be closed immediately. The subsequent audio data playback can still continue to use the audio data transmission channel. Even if the user pauses briefly in the middle of operating the button, there is no need to re-establish the audio data transmission channel when operating again.
[0138] See also Figure 16 , Figure 16 A feasible embodiment is shown, which provides an audio processing method applied to an electronic device, including: S1601 and S1602.
[0139] S1601: When it is determined that the preset interface of the electronic device meets the preset condition, transmit preset audio data to the wireless unit of the electronic device.
[0140] S1602: The wireless unit triggers, based on the preset audio data, the establishment of an audio data transmission channel between the electronic device and the audio playback device based on the established wireless link.
[0141] It should be noted that when it is determined that the preset interface of the electronic device meets the preset conditions, it can be the Audio unit of the electronic device, such as the audio system (Audio Sub System) mentioned above, which transmits the preset audio data to the wireless unit of the electronic device, or it can be the processor or other control unit of the electronic device (not limited here) that transmits the preset audio data to the wireless unit of the electronic device to inform the wireless unit that there is currently streaming media that needs to be played; in the above manner, an audio data transmission channel can be established in advance before the user performs relevant operations on the preset interface, thereby avoiding the audio data transmission channel being established when the user performs relevant operations on the preset interface (such as inputting characters), resulting in a delay in the playback of audio data triggered by the relevant operations. The description of the electronic device and audio playback device in this embodiment can refer to the description in the previous text and will not be repeated here.
[0142] It is understood that the preset interface may include: a key interface or an audio playback interface. Specifically, the preset interface may be the aforementioned designated interface. It should be noted that the key interface may be a character input interface, an application interface for users to input numbers, symbols, text, etc., such as the keyboard interface of a mobile phone or the input interface of an installed related input method app; the audio playback interface may be an operating interface for users to control audio playback, such as a music app, and may include interfaces for video playback and audio playback.
[0143] It is understandable that determining that the preset interface of the electronic device meets the preset conditions includes:
[0144] The preset interface is in the display state, in the foreground running state, or in the focus state. Among them, the description of the display state and the foreground running state can refer to the aforementioned embodiment and will not be repeated here. The focus state means that the preset interface (for example, as an Activity) is at the top of the Activity stack and has the user input focus. When jumping to another Activity or exiting the current Activity, the Activity will lose focus. For example, executing unsaved changes to the data of the preset interface, stopping animation, and other operations that may consume CPU, the preset interface loses focus at this time, that is, it is not in the focus state.
[0145] It should be noted that when the preset interface is in the display state or the foreground running state or the focus state, it means that the preset interface may be used by the user or is being used by the user. Therefore, the audio data transmission channel is established in advance through the preset audio trigger, thereby reducing the delay in the keyboard sound output when typing, or the delay in music playback. Among them, the preset audio data can be silent data, or other audio data, such as audio data that is difficult for the human ear to detect or other user-friendly audio data. Specifically, the silent data can correspond to a preset volume parameter, and the preset volume parameter is less than the specified volume value mentioned in the aforementioned embodiment. Therefore, when the wireless audio playback device plays the silent data, it is difficult for the human ear to detect and is user-friendly.
[0146] It can be understood that the wireless unit is a Bluetooth unit, such as the Bluetooth module mentioned above. Specifically, it can also be a chip with Bluetooth transceiver functions. Accordingly, the wireless link is a Bluetooth link, such as a Bluetooth physical link, including but not limited to an asynchronous connectionless (ACL) link. Accordingly, the audio data transmission channel is a streaming data stream channel for Bluetooth point-to-point transmission.
[0147] It should be noted that the principle of establishing a stream channel can be found in the previous description, and you can also refer to the relevant provisions of the Bluetooth protocol. Figure 7 and 17 , further gives the relevant interaction diagram and flow chart, specifically, the key prompt tone is used as the target audio data, Figure 17 The implementation of each interaction step in can refer to the above embodiment and will not be repeated here.
[0148] In a related embodiment, when preset conditions are met on a dial pad or keyboard interface, the electronic device will proactively play a segment of preset audio data, such as a silent sound, and pre-establish a streaming channel between the SRC and SNK. This ensures that when the user begins tapping the dial pad or keyboard, data transmission can proceed directly without the time required to exit sniff and negotiate the stream channel between the Bluetooth SRC and SNK. This reduces the listening latency on the SNK end and provides a better user experience.
[0149] It is understandable that after the wireless unit triggers the establishment of an audio data transmission channel between the electronic device and the audio playback device based on the established wireless link based on the preset audio data, the method further includes:
[0150] The target audio data is sent to the audio playback device through the audio data transmission channel, and the target audio data is triggered based on the user's operation on the preset interface.
[0151] That is to say, after the audio data transmission channel is established, the electronic device and the audio playback device can directly transmit the target audio data, thereby reducing the playback delay. For example, when the user taps the virtual keyboard on the electronic device to input characters, the virtual interface serves as the aforementioned designated operation component, and the keyboard sound serves as the target audio data through the established stream channel to be transmitted to the audio playback device for playback, thereby reducing the playback delay.
[0152] It can be understood that after sending the target audio data to the audio playback device through the audio data transmission channel, the method further includes: when the preset interface meets the preset conditions, maintaining the audio data transmission channel by wirelessly sending the preset audio data to the audio playback device.
[0153] It should be noted that when the user inputs characters or other actions, a "short and fast" key prompt sound is generated. When the user pauses in the process of operating the key, once the system prompt sound triggered by the previous key operation has finished playing (usually a few hundred milliseconds), the stream channel between the Bluetooth SRC and SNK will be destroyed. When the user operates the key again to trigger the key prompt sound, the stream channel needs to be re-established. To avoid the above situation, when the preset conditions are met in the preset interface, the audio data transmission channel can be maintained by wirelessly sending preset audio data to the audio playback device. For example, mute data can be embedded between each key tone to maintain the stream channel. The embedded mute data can be continuous, or it can be played according to the time when the stream channel is disconnected, thereby ensuring the maintenance of the stream channel.
[0154] It is understandable that when the preset interface does not meet the preset conditions, the wireless transmission of the preset audio data to the audio playback device is stopped to disconnect the audio data transmission channel.
[0155] It should be noted that in this case, it can be understood that the user does not need to input characters or operate the preset interface, so there will be no "short and fast" type of key prompt sound, and there is no need to maintain the audio data transmission channel.
[0156] See also Figure 18 A feasible embodiment provides an audio processing device 1800 applied to an electronic device. The audio processing device includes: a determination unit 1801 and a wireless unit 1802.
[0157] a determining unit configured to transmit preset audio data to a wireless unit of the electronic device when it is determined that the preset interface of the electronic device meets a preset condition;
[0158] The wireless unit 1802 is configured to trigger, based on the preset audio data, the establishment of an audio data transmission channel between the electronic device and the audio playback device based on the established wireless link.
[0159] It should be noted that when it is determined that the preset interface of the electronic device meets the preset conditions, it can be the Audio unit of the electronic device, such as the audio system (Audio Sub System) mentioned above, which transmits the preset audio data to the wireless unit of the electronic device, or it can be the processor or other control unit of the electronic device (not limited here) that transmits the preset audio data to the wireless unit of the electronic device to inform the wireless unit that there is currently streaming media that needs to be played; through the above-mentioned device, an audio data transmission channel can be established in advance before the user performs relevant operations on the preset interface, thereby avoiding the situation where the audio data transmission channel is established only when the user performs relevant operations on the preset interface (such as entering characters), resulting in delays in the playback of audio data triggered by the relevant operations.
[0160] It can be understood that the preset interface may include: a button interface or an audio playback interface.
[0161] It should be noted that the key interface can be a character input interface, an application interface for users to input numbers, symbols, text, etc., such as the keyboard interface of a mobile phone or the input interface of a related input method APP installed; the audio playback interface can be an operating interface such as a music APP for users to control audio playback, and may include an interface containing video playback and audio playback.
[0162] It can be understood that the determining unit 1801 is configured to:
[0163] When the preset interface is in a display state, a foreground running state, or a focus state, the preset audio data is transmitted to a wireless unit of the electronic device.
[0164] It should be noted that when a preset interface is in a display state, a foreground running state, or a focus state, it indicates that the preset interface may be used by the user or is currently being used. Therefore, the preset audio data transmission channel is triggered in advance by the preset audio, thereby reducing the delay in the keyboard sound output when typing or the delay in music playback. The preset audio data can be silent data or other audio data, such as audio data that is difficult for the human ear to detect or other user-friendly audio data.
[0165] It can be understood that the wireless unit 1802 is a Bluetooth unit, and accordingly, the wireless link is a Bluetooth link, such as a Bluetooth physical link, including but not limited to an asynchronous connectionless (ACL) link, and accordingly, the audio data transmission channel is a Bluetooth point-to-point transmission streaming data stream channel.
[0166] It should be noted that the principle of establishing a stream channel can be found in the previous description, and you can also refer to the relevant provisions of the Bluetooth protocol. Figure 7 and 17 , further gives the relevant interaction diagrams and flow charts, which will not be repeated here.
[0167] In a related embodiment, when preset conditions are met on a dial pad or keyboard interface, the electronic device will proactively play a segment of preset audio data, such as a silent sound, and pre-establish a streaming channel between the SRC and SNK. This ensures that when the user begins tapping the dial pad or keyboard, data transmission can proceed directly without the time required to exit sniff and negotiate the stream channel between the Bluetooth SRC and SNK. This reduces the listening latency on the SNK end and provides a better user experience.
[0168] It can be understood that the wireless unit 1802 is further configured to: send target audio data to the audio playback device through the audio data transmission channel, and the target audio data is triggered based on the user's operation on the preset interface.
[0169] That is to say, after the audio data transmission channel is established, the electronic device and the audio playback device can directly transmit the target audio data, thereby reducing the playback delay. For example, when the user types characters on the keyboard of the electronic device, the keyboard sound is transmitted as the target audio data through the established stream channel to the audio playback device for playback, thereby reducing the playback delay.
[0170] It can be understood that the wireless unit 1802 is further configured to: when the preset interface meets the preset conditions, wirelessly send preset audio data to the audio playback device to maintain the audio data transmission channel.
[0171] It should be noted that when the user inputs characters or other actions, a "short and fast" key prompt sound is generated. When the user pauses in the process of operating the key, once the system prompt sound triggered by the previous key operation has finished playing (usually a few hundred milliseconds), the stream channel between the Bluetooth SRC and SNK will be destroyed. When the user operates the key again to trigger the key prompt sound, the stream channel needs to be re-established. To avoid the above situation, when the preset conditions are met in the preset interface, the audio data transmission channel can be maintained by wirelessly sending preset audio data to the audio playback device. For example, mute data can be embedded between each key tone to maintain the stream channel. The embedded mute data can be continuous, or it can be played according to the time when the stream channel is disconnected, thereby ensuring the maintenance of the stream channel.
[0172] It can be understood that the wireless unit 1802 is further configured to: when the preset interface does not meet the preset conditions, stop wirelessly sending the preset audio data to the audio playback device to disconnect the audio data transmission channel.
[0173] It should be noted that in this case, it can be understood that the user does not need to input characters or operate the preset interface, so there will be no "short and fast" type of key prompt sound, and there is no need to maintain the audio data transmission channel.
[0174] It should be emphasized that the various embodiments, implementation methods and corresponding technical features can be combined and explained with each other without conflict, and this application does not impose any restrictions on this; in each embodiment, there may be different expressions for the same feature, which can be explained with each other without conflict.
[0175] See also Figure 19 , which shows a structural block diagram of an audio processing device 1900 provided in an embodiment of the present application. The device may include: an acquisition unit 1901 and a playback unit 1902.
[0176] The acquiring unit 1901 is configured to acquire a play request for target audio data to be played.
[0177] As an embodiment, the acquisition unit 1901 is also used to establish an audio data transmission channel between the electronic device and the wireless audio playback device when it is detected that a specified application is running, and the specified application is used to trigger the playback of the target audio data; and obtain the playback request of the target audio data triggered by the specified application.
[0178] Furthermore, the acquisition unit 1901 is also used to determine that the specified application is running when it is detected that the specified interface is in a display state, wherein the specified interface includes a specified operation component, and the specified operation component is used to trigger the playback of the target audio data; and obtain the user's playback request for the target audio data triggered by the specified operation component.
[0179] Furthermore, the acquisition unit 1901 is also used to determine whether the specified application is closed after sending the target audio data to the wireless audio playback device; if it is not closed, keep the audio data transmission channel in a connected state; if it is closed, disconnect the audio data transmission channel.
[0180] Furthermore, the acquisition unit 1901 is also used to determine whether the designated interface is in a display state after sending the target audio data to the wireless audio playback device; if it is in a display state, keep the audio data transmission channel in a connected state; if it is not in a display state, disconnect the audio data transmission channel.
[0181] Furthermore, the acquiring unit 1901 is further configured to automatically trigger a request to play preset audio data; and establish an audio data transmission channel between the electronic device and the wireless audio playback device based on the request to play the preset audio data.
[0182] Furthermore, the acquisition unit 1901 is also used to establish an audio data transmission channel between the electronic device and the wireless audio playback device based on the permission request, and then send the preset audio data to the wireless audio playback device through the audio data transmission channel, instructing the wireless audio playback device to play the preset audio data based on the volume parameter corresponding to the preset audio data, wherein the volume parameter is less than the specified volume value.
[0183] Furthermore, the acquiring unit 1901 is further configured to establish an audio data transmission channel between the electronic device and the wireless audio playback device based on the playback request of the preset audio data, and cancel the playback of the preset audio data.
[0184] The playback unit 1902 is configured to respond to a playback request for the target audio data, send the target audio data to the wireless audio playback device through a pre-established audio data transmission channel between the electronic device and the wireless audio playback device, and instruct the wireless audio playback device to play the target audio data, wherein the audio data transmission channel is established based on a wireless link between the electronic device and the wireless audio playback device before the playback request is obtained.
[0185] Furthermore, the device also includes a delay unit, which is used to determine whether a new audio data playback request is obtained within a specified interval time period when it is detected that the target audio data playback is finished, wherein within the specified interval time period, the audio data transmission channel is in a connected state; if no new audio data playback request is obtained, the audio data transmission channel is disconnected.
[0186] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0187] In several embodiments provided in this application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0188] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.
[0189] Please refer to Figure 20 , which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 100 can be an electronic device capable of running applications, such as a smartphone, a tablet computer, an e-book, etc. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more programs are configured to execute the method as described in the aforementioned method embodiment.
[0190] The processor 110 may include one or more processing cores. The processor 110 utilizes various interfaces and circuits to connect various components within the electronic device 100. It executes instructions, programs, code sets, or instruction sets stored in the memory 120, as well as accesses data stored in the memory 120, to perform various functions of the electronic device 100 and process data. Optionally, the processor 110 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 110 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem handles wireless communications. It is understood that the modem may not be integrated into the processor 110 and may be implemented separately via a communications chip.
[0191] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data created by the terminal during use (such as a phone book, audio and video data, chat record data), etc.
[0192] Please refer to Figure 21 , which shows a block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 2100 stores program code, which can be called by a processor to execute the method described in the above method embodiment.
[0193] The computer-readable storage medium 2100 can be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 2100 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 800 has storage space for program code 2110 for executing any of the method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code 2110 can be compressed, for example, in a suitable form.
[0194] In summary, in the present application, before obtaining a playback request for the target audio data, an audio data transmission channel is pre-established based on the wireless link between the electronic device and the wireless audio playback device. Then, when a playback request for the target audio data to be played is obtained, the target audio data is sent to the wireless audio playback device through the pre-established audio data transmission channel, instructing the wireless audio playback device to play the target audio data. Therefore, it is possible to avoid establishing an audio data transmission channel only when a playback request for the target audio data is obtained, so that the playback of the target audio data is delayed due to the establishment of the audio data transmission channel, resulting in a delay in audio playback. Therefore, it is possible to improve the user experience.
[0195] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An audio processing method, characterized in that: Applied to electronic equipment, the method includes: Obtain a playback request for the target audio data to be played; In response to a request to play the target audio data, the target audio data is sent to the wireless audio playback device through a pre-established audio data transmission channel between the electronic device and the wireless audio playback device, instructing the wireless audio playback device to play the target audio data, wherein the audio data transmission channel is established based on a wireless link between the electronic device and the wireless audio playback device before obtaining the play request, the wireless link is a Bluetooth link, and the audio data transmission channel is a Bluetooth point-to-point transmission streaming media data stream channel.
2. The method according to claim 1, characterized in that Before obtaining a playback request for target audio data to be played, the method further includes: When the channel pre-establishment condition is met, an audio data transmission channel is established between the electronic device and the wireless audio playback device.
3. The method according to claim 2, characterized in that The satisfying of the channel pre-establishment condition includes detecting that a designated interface is in a display state, the designated interface includes a designated operation component, and the designated operation component is used to trigger the playback of the target audio data.
4. The method according to claim 3, characterized in that After sending the target audio data to the wireless audio playback device, the method further includes: During the time period when the designated interface is displayed on the screen of the electronic device, the audio data transmission channel is kept in a connected state.
5. The method according to claim 2, characterized in that The channel pre-establishment condition is met including detecting that a designated application is in a foreground running state, the designated application is used to control the display of a designated interface, the designated interface includes a designated operation component, and the designated operation component is used to trigger the playback of the target audio data.
6. The method according to claim 5, characterized in that After sending the target audio data to the wireless audio playback device, the method further includes: During the time period when the designated application is in the foreground running state, the audio data transmission channel is kept in the connected state.
7. The method according to claim 2, characterized in that The establishing of the audio data transmission channel between the electronic device and the wireless audio playback device includes: Trigger a playback request for preset audio data; Based on the playback request of the preset audio data, an audio data transmission channel is established between the electronic device and the wireless audio playback device.
8. The method according to claim 7, characterized in that After establishing an audio data transmission channel between the electronic device and the wireless audio playback device based on the playback request of the preset audio data, the method further includes: The preset audio data is sent to the wireless audio playback device through the audio data transmission channel, and the wireless audio playback device is instructed to play the preset audio data based on a volume parameter corresponding to the preset audio data, wherein the volume parameter is less than a specified volume value.
9. The method according to claim 7, characterized in that After establishing an audio data transmission channel between the electronic device and the wireless audio playback device based on the playback request of the preset audio data, the method further includes: While keeping the audio data transmission channel in a connected state, cancel playing of the preset audio data.
10. An audio processing device, characterized in that: Applied to electronic equipment, the audio processing device includes: An acquiring unit, configured to acquire a playback request for target audio data to be played; A playback unit is configured to respond to a playback request for the target audio data, send the target audio data to the wireless audio playback device through a pre-established audio data transmission channel between the electronic device and the wireless audio playback device, and instruct the wireless audio playback device to play the target audio data, wherein the audio data transmission channel is established based on a wireless link between the electronic device and the wireless audio playback device before obtaining the playback request, the wireless link is a Bluetooth link, and the audio data transmission channel is a Bluetooth point-to-point transmission streaming media data stream channel.
11. An audio processing method, characterized in that: Applied to electronic equipment, the method includes: When it is determined that the preset interface of the electronic device meets the preset condition, transmitting preset audio data to the wireless unit of the electronic device; The wireless unit triggers, based on the preset audio data, the establishment of an audio data transmission channel between the electronic device and the audio playback device based on the established wireless link, wherein the wireless link is a Bluetooth link, and the audio data transmission channel is a Bluetooth point-to-point transmission streaming media data stream channel; The target audio data is sent to the audio playback device through the audio data transmission channel.
12. The method according to claim 11, characterized in that The preset interface includes: a button interface or an audio playback interface.
13. The method according to claim 11, characterized in that When determining that the preset interface of the electronic device meets the preset condition, the method includes: The preset interface is in a display state, a foreground running state, or a focus state.
14. The method according to claim 11, characterized in that The preset audio data is silent data.
15. The method according to claim 11, characterized in that The wireless unit is a Bluetooth unit.
16. The method according to claim 11, characterized in that The target audio data is triggered based on a user's operation on the preset interface.
17. The method according to claim 16, characterized in that After sending the target audio data to the audio playback device through the audio data transmission channel, the method further includes: when the preset interface meets a preset condition, wirelessly sending the preset audio data to the audio playback device to maintain the audio data transmission channel; or When the preset interface does not meet the preset condition, wirelessly sending the preset audio data to the audio playback device is stopped to disconnect the audio data transmission channel.
18. An audio processing device, characterized in that: Applied to electronic equipment, the audio processing device includes: a determining unit configured to transmit preset audio data to a wireless unit of the electronic device when it is determined that the preset interface of the electronic device meets a preset condition; The wireless unit is configured to trigger, based on the preset audio data, the establishment of an audio data transmission channel between the electronic device and the audio playback device based on the established wireless link, wherein the wireless link is a Bluetooth link, and the audio data transmission channel is a Bluetooth point-to-point streaming data stream channel; and send the target audio data to the audio playback device through the audio data transmission channel.
19. A computer-readable medium, characterized in that The computer-readable medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the method according to any one of claims 1 to 9 or 11 to 17.
Citation Information
Patent Citations
Data transmission method and device, electronic equipment and computer readable medium
CN109150400A
Display equipment and method for playing music in terminal
CN111343489A