Audio playing method and device, computer readable medium and electronic device
By detecting the audio data type of the second device in the TWS Bluetooth earphone and adjusting the playback mode, the playback switching problem when two devices are connected is solved, achieving a smoother and smarter audio switching experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2021-10-28
- Publication Date
- 2026-06-02
AI Technical Summary
Existing TWS Bluetooth earbuds suffer from poor playback switching when connected to two devices, resulting in weak audio playback smoothness and a poor user experience.
After detecting a playback request from a second terminal, the audio playback device determines the audio data type of the second audio file and adjusts the playback mode accordingly, such as by adjusting the volume or priority of the output, to ensure clear playback of important audio.
It improves the smoothness and intelligence of audio switching across multiple devices, enhances the user experience, and ensures that important audio is not buried or missed.
Smart Images

Figure CN116055958B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and specifically to an audio playback method, an audio playback device, a computer-readable medium, and an electronic device. Background Technology
[0002] As people's living standards continue to improve, True Wireless Stereo (TWS) Bluetooth headphones are becoming increasingly popular.
[0003] Currently, TWS Bluetooth earbuds supporting dual-device connection is becoming a market trend. For example, one TWS earbud can connect to a mobile phone and a smart terminal device such as a tablet or TV at the same time. However, the playback switching experience between devices during the use of TWS Bluetooth earbuds with dual-device connection has always been a difficult problem for the industry to solve. Therefore, it is particularly important to make the playback experience between two or even multiple devices more refined and more in line with user habits. Summary of the Invention
[0004] The purpose of this disclosure is to provide an audio playback method, an audio playback device, a computer-readable medium, and an electronic device, thereby improving the multi-terminal audio playback switching experience to at least some extent.
[0005] According to a first aspect of this disclosure, an audio playback method is provided, executed by an audio playback device having wireless communication capabilities, wherein the audio playback device establishes a wireless communication connection with a first terminal and a second terminal, the method comprising:
[0006] While playing the first audio sent by the first terminal, respond to the playback request of the second terminal to play the second audio and determine the audio data type of the second audio;
[0007] The playback mode for playing the first audio and the second audio is determined based on the audio data type.
[0008] According to a second aspect of this disclosure, an audio playback device is provided, disposed in an audio playback device having wireless communication functionality, wherein the audio playback device establishes a wireless communication connection with a first terminal and a second terminal, the device comprising:
[0009] The audio data type determination module is used to determine the audio data type of the second audio in response to a playback request from the second terminal to play the second audio while the first audio sent by the first terminal is playing.
[0010] The playback mode determination module is used to determine the playback mode for playing the first audio and the second audio based on the audio data type.
[0011] According to a third aspect of this disclosure, a computer-readable medium is provided that stores a computer program thereon, which, when executed by a processor, implements the method described above.
[0012] According to a fourth aspect of this disclosure, an electronic device is provided, characterized in that it comprises:
[0013] Processor; and
[0014] Memory is used to store one or more programs, which, when executed by one or more processors, cause the one or more processors to perform the methods described above.
[0015] An embodiment of this disclosure provides an audio playback method that, while an audio playback device is playing a first audio sent by a first terminal, responds to a playback request from a second terminal to play a second audio. First, the audio data type of the second audio is determined. Then, based on the audio data type, a playback mode for playing the first and second audio is determined. This method, by determining the playback mode for different types of audio based on the audio data type of the second audio, effectively improves the smoothness of audio switching between multiple terminals, enhances the intelligence of multi-terminal audio playback, and improves the user experience.
[0016] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:
[0018] Figure 1 A schematic diagram of an exemplary system architecture to which embodiments of the present disclosure may be applied is shown;
[0019] Figure 2 A schematic diagram of an electronic device to which embodiments of the present disclosure may be applied is shown;
[0020] Figure 3 A schematic diagram of an audio playback device to which embodiments of the present disclosure may be applied is shown;
[0021] Figure 4 The diagram illustrates a process for implementing audio switching playback in a related technical solution.
[0022] Figure 5This diagram illustrates the process of implementing audio switching playback in another related technical solution.
[0023] Figure 6 The illustration shows a flowchart of an audio playback method in an example embodiment of the present disclosure;
[0024] Figure 7 This illustration schematically shows a process diagram of playing a first audio and a second audio in a first playback mode according to an example embodiment of the present disclosure;
[0025] Figure 8 This schematically illustrates another process diagram of playing the first and second audio in a first playback mode in an example embodiment of the present disclosure;
[0026] Figure 9 This illustration schematically shows a process diagram for switching between the first and second audio audio in an example embodiment of this disclosure;
[0027] Figure 10 This illustration shows a flowchart of a multi-terminal audio playback implementation in an example embodiment of the present disclosure.
[0028] Figure 11 This schematic diagram illustrates the composition of an audio playback device in an exemplary embodiment of the present disclosure. Detailed Implementation
[0029] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0030] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0031] Figure 1 A schematic diagram of a system architecture for an exemplary application environment in which an audio playback method and apparatus according to embodiments of the present disclosure can be applied is shown.
[0032] like Figure 1As shown, system architecture 100 may include one or more of terminal devices 101, 102, and 103, a network 104, and an audio playback device 105. Network 104 serves as a medium for providing a communication link between terminal devices 101, 102, and 103 and audio playback device 105. Network 104 may include various wireless communication connection types, such as Bluetooth, Wireless Local Area Network (WLAN), etc. Terminal devices 101, 102, and 103 may be various electronic devices with wireless communication and audio output capabilities, including but not limited to smart TVs, portable computers, smartphones, and tablets. It should be understood that... Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and audio playback devices can be included. For example, audio playback device 105 could be a cluster of multiple Bluetooth headsets or multiple Bluetooth speakers.
[0033] The audio playback method provided in this embodiment is generally executed in the audio playback device 105, and correspondingly, the audio playback apparatus is generally disposed in the audio playback device 105. However, it is readily understood by those skilled in the art that the audio playback method provided in this embodiment can also be executed by the terminal devices 101, 102, and 103, and correspondingly, the audio playback apparatus can also be disposed in the terminal devices 101, 102, and 103. This exemplary embodiment does not impose any special limitations on this.
[0034] The following is based on Figure 2 Taking electronic device 200 as an example, the construction of terminal devices 101, 102, and 103 will be described by way of example. Those skilled in the art will understand that, except for components specifically designed for mobile purposes, Figure 2 The structure shown can also be applied to fixed-type devices. In other embodiments, the electronic device 200 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The components illustrated can be implemented in hardware, software, or a combination of software and hardware. The interface connections between the components are only schematic and do not constitute a limitation on the structure of the electronic device 200. In other embodiments, the electronic device 200 may also employ a similar design to... Figure 2 Different interface connection methods, or combinations of multiple interface connection methods.
[0035] like Figure 2As shown, the electronic device 200 may specifically include at least: a processor 210, internal memory 221, external memory interface 222, Universal Serial Bus (USB) interface 230, charging management module 240, power management module 241, battery 242, antenna, wireless communication module 250, audio module 260, speaker 261, microphone 262, sensor module 270, indicator 280, and buttons 290, etc. The sensor module 270 may include a gyroscope sensor 2701, etc.
[0036] Processor 210 may include one or more processing units, such as a modem processor, a digital signal processor (DSP), or a baseband processor. These different processing units may be independent devices or integrated into one or more processors.
[0037] The processor 210 includes a memory. The memory can store instructions for implementing six modular functions: detection instructions, link instructions, information management instructions, analysis instructions, data transfer instructions, and notification instructions, and their execution is controlled by the processor 210.
[0038] The charging management module 240 receives charging input from the charger. The power management module 241 connects the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240 to power the processor 210, internal memory 221, and wireless communication module 250, etc.
[0039] The wireless communication function of electronic device 200 can be implemented through an antenna, a wireless communication module 250, a modem processor, and a baseband processor. The antenna is used to transmit and receive electromagnetic wave signals; the modem processor may include a modulator and a demodulator; the wireless communication module 250 can provide solutions for wireless communication applications on electronic device 200, including Wireless Local Area Networks (WLANs) (such as Wireless Fidelity (Wi-Fi) networks) and Bluetooth (BT). In some embodiments, the antenna of electronic device 200 and the wireless communication module 250 are coupled, enabling electronic device 200 to communicate with networks and other devices via wireless communication technology.
[0040] The external storage interface 222 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200. The external memory card communicates with the processor 210 through the external storage interface 222 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0041] Internal memory 221 can be used to store executable program code, including instructions. Internal memory 221 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.). The data storage area may store data created during the use of electronic device 200 (such as audio data, phonebook, etc.). Furthermore, internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, Universal Flash Storage (UFS), etc. Processor 210 executes various functional applications and data processing of electronic device 200 by running instructions stored in internal memory 221 and / or instructions stored in memory located in the processor.
[0042] Electronic device 200 can implement audio functions through audio module 260, speaker 261, microphone 262, and application processor, such as music playback and recording.
[0043] The gyroscope sensor 2701 can be used to determine the motion attitude of the electronic device 200. In some embodiments, the gyroscope sensor 2701 can determine the angular velocity of the electronic device 200 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 2701 can be used for attitude confirmation, navigation, motion-sensing game scenarios, etc.
[0044] The electronic device 200 may also include other devices that provide auxiliary functions. For example, buttons 290 may include a power button, volume buttons, etc., allowing users to input key signals related to user settings and function control of the electronic device 200. Other examples include indicators 280.
[0045] The following is based on Figure 3 Taking an electronic device as an example, the construction of the audio playback device 105 will be described by way of example.
[0046] Figure 3 The audio playback device 105 can be a smartphone, tablet, personal computer, smart TV, projector, etc. The audio playback device 105 may include at least one or more of the following components: processor 301, memory 302, and Bluetooth chip 303.
[0047] The processor 301 may include one or more processing cores. The processor 301 connects to various parts within the audio playback device 105 using various interfaces and lines, and performs various functions and processes data of the audio playback device 105 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 302, and by calling data stored in the memory 302. Optionally, the processor 301 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 301 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), Neural-network Processing Unit (NPU), and modem. Specifically, the CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display on the screen; the NPU is used to implement Artificial Intelligence (AI) functions; and the modem is used for wireless communication. It is understandable that the aforementioned modem may not be integrated into the processor 301, but may be implemented using a separate chip.
[0048] The memory 302 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 302 may include a non-transitory computer-readable storage medium. The memory 302 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 302 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 at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the various method embodiments described below, etc.; the data storage area may store data (such as audio data, phone book, etc.) created based on the use of the audio playback device 105.
[0049] Bluetooth chip 303 is a component used to implement Bluetooth functionality. In some embodiments, Bluetooth chip 303 includes a Bluetooth protocol stack, a Bluetooth baseband, and a Bluetooth transceiver. Optionally, the Bluetooth technology used by Bluetooth chip 303 can be classic Bluetooth technology or Bluetooth Low Energy technology; this embodiment does not limit this.
[0050] In addition, those skilled in the art will understand that the structure of the audio playback device 105 shown in the above figures does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, the audio playback device 105 also includes components such as a display screen, sensors, speakers, microphones, power supplies, and WiFi components, which will not be described in detail here.
[0051] Figure 4 The diagram illustrates a process for implementing audio switching playback in a related technical solution.
[0052] refer to Figure 4 As shown, in a related multi-device audio switching solution, the A2DP protocol can be actively disconnected to prevent a second device from interrupting playback. TWS earbuds are simultaneously connected to two devices, phone A and phone B, via Bluetooth. When phone A requests media playback (e.g., music / video), the earbuds enter audio streaming mode. At this time, the earbuds actively disconnect the A2DP connection with phone B, meaning they do not support media interruption. The A2DP protocol is the transmission protocol for media playback between Bluetooth devices. If music / video is played on phone B at this time, the sound will be played directly through the earbuds. The earbuds will only reconnect to phone B after phone A finishes playing the music / video; the earbuds will re-connect via A2DP. Media playback on phone B can then be switched to the earbuds' output.
[0053] However, in this technical solution, once phone A begins media data transmission, the earphones will actively disconnect from the A2DP protocol with phone B. This means that phone B will continue to play music or videos directly through its speaker for normal user operations. Only when phone A pauses playback and a period of time has passed, and the earphones no longer receive audio, will they actively reconnect to the A2DP protocol with phone B. The earphones offer a poor dual-device switching experience, weak audio playback smoothness, lack of technological sophistication, and a subpar user experience.
[0054] Figure 5 This diagram illustrates the process of implementing audio switching playback in another related technical solution.
[0055] refer to Figure 5As shown, in another related multi-device audio switching scheme, the TWS earbuds are simultaneously connected to two devices, phone A and phone B, via Bluetooth. When phone A requests media playback, such as music or video, the earbuds enter audio streaming mode. If phone B also requests media playback, the earbuds will directly receive the media data from phone B, but will mute the received media data from phone B, meaning the earbuds will continue playing the media audio from phone A. Simultaneously, the earbuds send a pause playback command to phone B, requesting phone B to pause media data transmission. Upon receiving the pause playback command, phone B's player pauses playback; that is, the earbuds do not support a second Bluetooth device interrupting playback.
[0056] However, while this technical solution can effectively address the scenario of accidental interruption of system notification sounds, user-initiated operations such as system notification sounds or music / video playback on phone B will be muted by the headphones. This can cause users to miss system message notifications from phone B, and while phone B's player may show that it is playing, the headphones are actually playing media data from phone A, resulting in discrepancies between the audio played and the audio the user wants to hear, leading to a poor user experience.
[0057] Based on one or more problems in the relevant technical solutions, this example embodiment first provides an audio playback method. The following uses an audio playback device 105 with wireless communication function to perform the method as an example to specifically describe the audio playback method of the exemplary embodiment of this disclosure.
[0058] Figure 6 This illustration shows a flowchart of an audio playback method according to an exemplary embodiment, which may include at least the following steps S610 to S620:
[0059] In step S610, while playing the first audio sent by the first terminal, the system responds to the playback request of the second terminal to play the second audio and determines the audio data type of the second audio.
[0060] In one exemplary embodiment, the audio playback device can be an electronic device with wireless communication and audio playback functions. For example, the audio playback device can be a TWS Bluetooth headset, a Bluetooth smart speaker, or a smart TV, etc. This example embodiment is not limited thereto.
[0061] The first terminal refers to a terminal device with wireless communication and audio output functions. For example, the first terminal can be a smartphone or a tablet computer. Of course, it can also be other types of terminal devices with wireless communication and audio output functions. This example embodiment does not make any special limitation on this.
[0062] The first terminal can establish a wireless communication connection with an audio playback device that has the same wireless communication function. For example, the wireless communication function of the first terminal can be Bluetooth communication or WLAN communication. Correspondingly, the audio playback device can have Bluetooth communication and / or WLAN communication functions.
[0063] The second terminal, like the first terminal, refers to a terminal device with wireless communication and audio output functions. It should be noted that the terms "first" and "second" here are only used to distinguish two terminals that simultaneously establish wireless communication connections with the audio playback device, and have no special meaning, nor should they impose any special limitations on this example embodiment.
[0064] The first audio refers to the audio data output by the first terminal in response to system commands. For example, the first audio could be media audio data output by the player of the first terminal when displaying images or music, telephone voice data output by the first terminal in response to an incoming call request, or notification prompt audio output by the first terminal when receiving notification information to remind the user. This example embodiment does not make any special limitations on this. Of course, for the sake of easier understanding of this solution later, the first audio in this example embodiment generally refers to audio data with a relatively long continuous playback time, such as media audio data or telephone voice data.
[0065] After establishing a wireless communication connection with the first terminal, the device can receive the first audio playback request from the first terminal, and when it detects that no other device is playing audio, it can obtain the first audio sent by the first terminal and play the first audio.
[0066] In one exemplary embodiment, the second audio refers to audio data output by the second terminal. For example, the second audio could be media audio data output by the player of the second terminal when displaying video or music, telephone voice data output by the second terminal in response to an incoming call request, or notification prompt audio output by the second terminal when receiving notification information to remind the user. This example embodiment does not impose any special limitations on this. Of course, the terms "first" and "second" here are only used to distinguish between audio output by the first terminal and audio output by the second terminal, and have no special meaning, and should not impose any special limitations on this example embodiment.
[0067] The audio data type refers to the type of content contained in the second audio output by the second terminal. For example, if the second audio is media audio data output by a player when displaying video or music, then the audio data type corresponding to the second audio is media content type; if the second audio is telephone voice type output by the second terminal in response to an incoming call request, then the audio data type corresponding to the second audio is incoming call type; if the second audio is notification prompt audio or other audio data output by the second terminal when receiving notification information to remind the user, then the audio data type corresponding to the second audio is notification prompt type. Of course, this is only an illustrative example, and this example embodiment does not impose any special limitations on it.
[0068] Optionally, the audio data type can be determined by the file extension corresponding to the second audio file. For example, an Android phone can use the MediaFile class to output the audio data type based on the file extension corresponding to the second audio file, or it can determine the audio data type based on the audio file header information of the second audio file. Of course, the audio data type of the second audio file can also be determined in other ways, but this example embodiment does not impose any special limitations on this.
[0069] Before requesting the playback of the second audio, the second terminal can determine the audio data type of the second audio and generate a playback request based on the audio data type. The audio playback device can directly obtain the audio data type from the playback request after receiving it. Of course, when the audio playback device receives the playback request from the second terminal, it can send back an instruction to the second terminal to obtain the audio data type, so that the second terminal can determine the audio data type of the second audio to be played and receive the audio data type sent by the second terminal. This example embodiment does not impose any special limitations on this.
[0070] In step S620, a playback mode for playing the first audio and the second audio is determined based on the audio data type.
[0071] In one exemplary embodiment, the playback mode refers to a pre-set audio output method in the audio playback device for playing multiple audio files. For example, the playback mode could be an audio output method that lowers the playback volume of the first audio file and raises the playback volume of the second audio file to be higher than the playback volume of the first audio file, and then merges the first and second audio files for playback. In this way, the final playback effect is that the playback volume of the second audio file is greater than that of the first audio file, making it easier for the user to hear the second audio file and achieving emphasis on the playback of the second audio file. Of course, the playback mode could also be an audio output method that increases the high-frequency part of the second audio file by gain and decreases the high-frequency part of the first audio file by gain, so as to make the second audio file clearer. Of course, the playback mode could also be other audio output methods that can achieve the playback of multiple audio files, and this example embodiment does not make any special limitations on this.
[0072] Steps S610 to S620 will be described in detail below.
[0073] In an exemplary embodiment, the audio data type may include notification prompt type and non-notification prompt type. The notification prompt type refers to the audio type corresponding to the prompt audio played by the terminal system for a short time to remind the user. For example, the notification prompt type may be the audio type corresponding to the prompt sound played when the terminal receives a new message or a call, or the audio type corresponding to the prompt sound played by the terminal system in response to timed commands such as alarm clocks and schedule reminders. This example embodiment does not make any special limitations on this.
[0074] Non-notification prompt type can refer to the audio type corresponding to long-running audio in the terminal other than notification prompt type audio. For example, non-notification prompt type can be the audio type corresponding to telephone voice audio in the terminal, or the audio type corresponding to media content audio output by the terminal when displaying video or music. Of course, non-notification prompt type can also be the audio type corresponding to other long-running audio in the terminal. This example embodiment does not make any special limitation on this.
[0075] When the audio data type is determined to be a notification prompt type, the first audio and the second audio are played in the first playback mode. The first playback mode refers to the audio playback format adopted by the audio playback device when the audio data type of the second audio is determined to be a notification prompt type. The first playback mode can be used to merge the first audio and the second audio in layers and output them for playback.
[0076] When the audio data type is determined to be a non-notification prompt type, the first audio and the second audio are played in the second playback mode. The second playback mode refers to the audio playback format adopted by the audio playback device when the audio data type of the second audio is determined to be a non-notification prompt type. The second playback mode can be used to pause the playback of the first audio and output the playback of the second audio, thereby realizing the preemptive playback of the second audio.
[0077] It is understood that the terms "first" and "second" in "first playback mode" and "second playback mode" in this example embodiment are only used to distinguish the playback modes of audio applicable to different audio data types, and have no special meaning in this embodiment, and should not impose any special limitations on this example embodiment.
[0078] In one example embodiment, the first playback mode can be considered as a layered blending output mode that mixes and merges multiple audio files. Step S620 may include... Figure 7 Steps S710 to S740 in the above steps implement the playback of the first and second audio in a hierarchical fusion output mode, as shown in the reference. Figure 7 As shown, it can specifically include:
[0079] Step S710: Obtain the current playback volume of the first audio and determine the volume threshold based on the current playback volume;
[0080] Step S720: Adjust the playback volume of the first audio to make the playback volume of the first audio less than the volume threshold.
[0081] Step S730: Adjust the playback volume of the second audio to make the playback volume of the second audio greater than or equal to the volume threshold.
[0082] Step S740: The first audio and the second audio after adjusting the playback volume are merged and output.
[0083] The current playback volume refers to the playback volume of the first audio file currently being played. For example, for the first or second terminal, the playback volume of each audio file is generally 0-100. 0 indicates that the audio playback volume is at its minimum, which can be considered as muting the audio. 100 indicates that the audio playback volume is at its maximum. Therefore, the current playback volume of the first audio file can be any value between 1 and 100. This value can be set by the user or by the default volume of the player on the first terminal.
[0084] If the second audio is detected to be of notification type, the current playback volume of the first audio can be used as a volume threshold. This volume threshold can serve as the standard data for adjusting either the first or second audio. For example, if the current playback volume is 50, then the volume threshold can be set to 50. To ensure that the second audio is emphasized and that the user can clearly identify it without affecting the normal playback of the first audio, the playback volume of the first audio can be adjusted to be lower than the volume threshold, i.e., the playback volume of the first audio can be controlled below 50. Conversely, the playback volume of the second audio can be adjusted to be greater than or equal to the volume threshold, i.e., the playback volume of the first audio can be adjusted to 50 or higher. In this way, there is a volume difference between the first and second audio, which prevents the user from not hearing the second audio, which may be drowned out or covered by the first audio, thus emphasizing the playback of the second audio.
[0085] After adjusting the playback volume of the first and second audio, the first and second audio with different playback volumes are mixed to complete the fusion of the first and second audio and output them, so as to play the first and second audio in the first playback mode.
[0086] By adjusting the playback volume of the first and second audio audio, the first and second audio audio can be played in the first playback mode. This not only makes the operation simple and requires little computation, ensuring the performance of the audio playback device, but also effectively emphasizes the playback of the second audio audio without affecting the playback of the first audio audio, ensuring smooth audio playback and improving the user experience.
[0087] In an exemplary embodiment, the first playback mode can be considered as a hierarchical fusion output mode that merges multiple audio files according to their priority. Step S620 may include... Figure 8 Steps S810 to S850 in the above steps implement the playback of the first and second audio in a hierarchical fusion output mode, as shown in the reference. Figure 8 As shown, it can specifically include:
[0088] Step S810: Determine the audio data type of the first audio, and determine the first priority data corresponding to the first audio based on the audio data type of the first audio.
[0089] Step S820: Determine the second priority data corresponding to the second audio based on the notification prompt type;
[0090] Step S830: Determine the playback volume data corresponding to the first audio and the second audio based on the first priority data and the second priority data, respectively;
[0091] Step S840: Adjust the playback volume of the first audio and the second audio using the playback volume data;
[0092] Step S850: The first audio and the second audio after adjusting the playback volume are merged and output.
[0093] The audio data type of the first audio can be determined by the same method used to determine the audio data type of the second audio in the foregoing embodiments, which will not be elaborated here.
[0094] Priority data refers to the playback priority set in advance according to different audio data types. For example, assuming that audio data types can include media content type, telephone voice type, notification prompt type, etc., among which telephone voice type is more important, the audio corresponding to this audio data type can be set to priority data 1, the audio corresponding to notification prompt type can be set to priority data 2, and the audio corresponding to media content type can be set to priority data 3. The priority order can be 1>2>3. Of course, this is only an illustrative example. The specific audio data type can include other types, and the priority data can also be other types of data. This should not impose any special limitations on this example embodiment.
[0095] Optionally, the playback volume corresponding to different audio priorities can be preset. For example, for audio with priority data of 1 (such as telephone voice type audio), its playback volume during audio fusion can be set to 70. For audio with priority data of 2 (such as notification prompt type audio), its playback volume during audio fusion can be set to 50. For audio with priority data of 3 (such as media content type audio), its playback volume during audio fusion can be set to 30. Of course, the playback volume of each type of audio during audio fusion can be set to a fixed value, or the playback volume of each type of audio during audio fusion can be set to a playback volume range. The specific settings can be customized according to the actual situation. This example embodiment does not impose any special limitations on this.
[0096] After determining the first priority data of the first audio and the second priority data of the second audio based on the audio data type, the playback volume data of the first audio and the playback volume data of the second audio can be determined according to the pre-set correspondence. Then, the playback volume of the first audio and the playback volume of the second audio can be adjusted according to the determined playback volume data. Finally, the first audio and the second audio after adjusting the playback volume are merged and output to achieve the playback of the first audio and the second audio in the first playback mode.
[0097] By setting priority data for different audio data types and adjusting the playback volume for audio with different priority data, the playback volume of different audio types can be quickly adjusted when the first and second terminals need to output at least two audio types simultaneously. This enables the hierarchical fusion output of multiple audio types, effectively ensuring that users can hear the higher-priority audio when multiple audio types are played at the same time. This avoids missing important information or audio, improves the intelligence of multi-audio playback, ensures the smoothness of multi-audio playback, and enhances the user experience.
[0098] Generally, in scenarios where both the first terminal and the second terminal output one type of audio, the audio playback device can decide to use a hierarchical fusion output method that lowers the playback volume of one type of audio and raises the playback volume of another type of audio. When the number of audio outputs by the first terminal and the second terminal is greater than two, a priority-based approach can be used to achieve hierarchical fusion playback of multiple audios.
[0099] In one exemplary embodiment, the initial playback volume of the first audio can be recorded before adjusting the playback volume of the first audio and the second audio. The initial playback volume may refer to the current playback volume of the first audio before the volume adjustment.
[0100] Understandably, after the second audio (of the notification type) stops playing, the first audio's playback volume is lower than its initial volume due to volume adjustments. To avoid impacting the user experience (e.g., the initial playback volume might be the user's optimal playback volume setting), the first audio can be restored to its initial playback volume, returning it to its state before the layered blending output. By restoring the first audio's playback to its recorded initial volume, the system can promptly restore it to its state before the user listened to the blended audio after the second audio finishes playing, ensuring smooth playback and a positive user experience.
[0101] In an exemplary embodiment, if a failure instruction to determine the audio data type of the second audio is received, for example, when the system cannot identify the audio data type of the second audio and cannot determine the playback mode for playing the first and second audio through the audio data type of the second audio, a preemptive playback instruction can be sent to the first terminal in response to the failure instruction to determine the audio data type of the second audio, so that the first terminal can pause the playback of the first audio and play the second audio based on the preemptive playback instruction.
[0102] In an exemplary embodiment, if the audio data type of the second audio is detected to be a non-notification prompt type, such as a telephone voice type or a media content type, the first audio and the second audio can be played in a second playback mode. In the second playback mode, a preemptive playback command can be sent to the first terminal to make the first terminal pause the playback of the first audio based on the preemptive playback command. The second audio is also played to enable the second terminal to preemptively play the second audio. In this case, the second playback mode can be considered as a multi-audio preemptive playback mode that enables audio preemptive playback.
[0103] In one exemplary embodiment, if the audio data type of the second audio is detected to be non-notification prompt type, the initial playback volume of the first audio can be recorded before sending the pre-play command to the first terminal. After the non-notification prompt type second audio stops playing, the playback of the first audio can be automatically resumed according to the initial playback volume, so that the playback volume of the first audio is restored to the state before the second audio was pre-played.
[0104] Optionally, after the second audio (not a notification prompt) stops playing, a prompt message can be sent to the user. This prompt message can be used to prompt the user to select which audio to continue playing or to select the terminal to output the audio. For example, the prompt message can be a system prompt voice reminder, a physical vibration reminder, or a light flashing reminder. This example embodiment is not limited to these.
[0105] In one exemplary embodiment, if the data type of the second audio determined by the terminal is incorrect—for example, the terminal misidentifies the second audio (of notification type) as a non-notification type—then when playing the first and second audio in the second playback mode, the first audio may be paused after the second audio (of notification type) finishes playing. In this case, after enabling the second audio to be played in the second playback mode, it can be resolved by… Figure 9 The steps in the previous section continue to implement the playback of the first and second audio files, refer to... Figure 9 As shown, it can specifically include:
[0106] Step S910: Monitor the playback time of the second audio.
[0107] Step S920: When the playback time is less than or equal to the time threshold and the second audio stops playing, a recovery command is sent to the first terminal so that the first terminal can resume playback of the first audio based on the recovery command.
[0108] In this embodiment, after receiving a playback request from the second terminal, a preemptive playback command can be generated and sent to the first terminal. This command causes the first terminal to pause the playback of the first audio and play the second audio. The preemptive playback command is generated upon receiving the playback request from the second terminal while playing the first audio output by the first terminal. Upon receiving the preemptive playback command, the first terminal can send a pause command to the source of the first audio to pause its playback and play the second audio, thus achieving preemptive playback.
[0109] After the second audio is preemptively played, its playback time can be monitored. If the playback time is less than or equal to a time threshold (e.g., 3 seconds), the second audio is considered a notification / prompt type. When the second audio finishes playing, a recovery command is promptly sent to the first terminal, allowing the first terminal to resume playback of the first audio based on the recovery command. Stopping playback can be due to the second audio ending or the user actively terminating its playback; this example embodiment does not limit this.
[0110] After the second audio is successfully played, the playback time of the second audio is continuously monitored. When the playback time is less than or equal to the time threshold and the second audio stops playing, it is determined that the audio data type of the second audio has been misidentified. A recovery command is then sent to the first terminal in a timely manner to restore the playback of the first audio. This can avoid the problem of decreased playback smoothness of the first and second audio due to the misidentification of the audio data type of the second audio, thereby improving the user experience.
[0111] Of course, this example embodiment can also be used in scenarios where the terminal cannot determine the audio data type of the second audio. For example, if a failure instruction to determine the audio data type of the second audio is received, such as when the system cannot identify the audio data type of the second audio and generates a failure instruction, then the playback mode for playing the first and second audio cannot be determined by the audio data type of the second audio. After receiving a playback request sent by the second terminal, a preemptive playback instruction can be generated and sent to the first terminal, so that the first terminal can pause the playback of the first audio and play the second audio based on the preemptive playback instruction.
[0112] If the playback time of the second audio is less than or equal to the time threshold, the second audio can be considered as a notification or prompt type of audio, and the playback of the first audio should be resumed promptly when the second audio ends.
[0113] If the playback time of the second audio exceeds the time threshold, it can be considered that the second audio is not a notification or prompt type of audio. In this case, when the second audio stops playing, the playback of the first audio does not need to be resumed, and the user's further actions can be awaited.
[0114] Determining whether to resume playback of the first audio after the second audio is interrupted by using the playback time of the second audio can effectively improve the intelligence and smoothness of the playback of the first and second audio, thereby enhancing the user experience.
[0115] Figure 10 The illustration shows a flowchart of a multi-terminal audio playback implementation in an example embodiment of the present disclosure.
[0116] refer to Figure 10 As shown, in step S1001, the audio playback device 1010 establishes a wireless communication connection with the first terminal 1020, such as a Bluetooth communication connection.
[0117] In step S1002, the audio playback device 1010 establishes a wireless communication connection with the second terminal 1030, such as a Bluetooth communication connection.
[0118] In step S1003, the first terminal 1020 sends the audio stream data corresponding to the first audio to the audio playback device 1010;
[0119] In step S1004, the audio playback device 1010 receives audio stream data to play the first audio.
[0120] In step S1005, the second terminal 1030 generates a playback command for the second audio.
[0121] In step S1006, the second terminal 1030 determines whether the second audio is a notification prompt type audio. If it is, steps S1007 to S1009 are executed; otherwise, step S1010 is executed.
[0122] In step S1007, the second terminal 1030 sends a playback request for the second audio to the audio playback device 1010, the playback request including the audio data type of the second audio.
[0123] In step S1008, after determining that the audio data type of the second audio is a notification prompt type, the audio playback device 1010 receives the audio stream data of the second audio sent by the second terminal 1030.
[0124] In step S1009, the audio playback device 1010 performs hierarchical fusion and output of the first audio and the second audio to emphasize the playback of the second audio;
[0125] In step S1010, the second terminal 1030 sends a playback request to the audio playback device 1010;
[0126] In step S1011, after determining that the audio data type of the second audio is not a notification prompt type, the audio playback device 1010 generates a playback interruption instruction based on the received playback request and sends the playback interruption instruction to the first terminal so that the first terminal responds to the playback interruption instruction to pause the playback of the first audio.
[0127] In step S1012, the first terminal 1020 stops sending the audio stream data of the first audio to the audio playback device 1010;
[0128] In step S1013, the audio playback device 1010 receives the audio stream data of the second audio to play the second audio, thereby enabling the second terminal to preemptively play the audio.
[0129] This disclosure retains the logic allowing preemptive playback when the audio playback device is connected to multiple terminals. Simultaneously, it addresses the scenario of "accidental preemption" in short-duration audio playback services such as system notification sounds from the second terminal, ensuring the smoothness of audio playback on the first terminal and preventing frequent accidental interruptions. Furthermore, unlike related technologies where short-duration audio playback such as system notification sounds from the second terminal is directly muted, this disclosure retains the playback. Through a layered and integrated output method, the system notification sounds from the second terminal are played to promptly alert the user, ensuring that the user does not miss notifications from the second terminal, resulting in a better and more integrated user experience.
[0130] In summary, in this exemplary embodiment, when the audio playback device is playing the first audio sent by the first terminal, in response to the playback request of the second terminal to play the second audio, the audio data type of the second audio is first determined, and then the playback mode for playing the first and second audio is determined according to the audio data type. In this way, by determining the playback mode for playing different types of audio through the audio data type of the second audio, the smoothness of switching between multiple terminal audios can be effectively improved, the intelligence of multi-terminal audio playback can be enhanced, and the user experience can be improved.
[0131] It should be noted that the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0132] Further reference Figure 11 As shown, this example embodiment also provides an audio playback device 1100, which, for example, can be installed in an audio playback device 105 with wireless communication capabilities. The audio playback device 105 establishes a wireless communication connection with a first terminal and a second terminal. The audio playback device 1100 may include at least an audio data type determination module 1110 and a playback mode determination module 1120. Wherein:
[0133] The audio data type determination module 1110 is used to determine the audio data type of the second audio in response to a playback request from the second terminal to play the second audio while the first audio sent by the first terminal is playing.
[0134] The playback mode determination module 1120 is used to determine the playback mode for playing the first audio and the second audio based on the audio data type.
[0135] In one exemplary embodiment, the playback mode determination module 1120 may include:
[0136] The first playback unit is configured to, in response to determining that the audio data type is a notification prompt type, play the first audio and the second audio in a first playback mode; or
[0137] The second playback unit is configured to play the first audio and the second audio in a second playback mode in response to determining that the audio data type is a non-notification prompt type.
[0138] In an exemplary embodiment, the first playback unit may be used for:
[0139] Obtain the current playback volume of the first audio, and determine the volume threshold based on the current playback volume;
[0140] Adjust the playback volume of the first audio to make the playback volume of the first audio less than the volume threshold;
[0141] Adjust the playback volume of the second audio to make the playback volume of the second audio greater than or equal to the volume threshold;
[0142] The first audio and the second audio, after adjusting the playback volume, are merged and output.
[0143] In an exemplary embodiment, the first playback unit may be used for:
[0144] Determine the audio data type of the first audio, and determine the first priority data corresponding to the first audio based on the audio data type of the first audio;
[0145] Determine the second priority data corresponding to the second audio based on the notification prompt type;
[0146] The playback volume data corresponding to the first audio and the second audio are determined based on the first priority data and the second priority data, respectively.
[0147] Adjust the playback volume of the first audio and the second audio using the playback volume data;
[0148] The first audio and the second audio, after adjusting the playback volume, are merged and output.
[0149] In an exemplary embodiment, the audio playback device 1100 may further include a first audio restoration module, which may be used for:
[0150] Get the initial playback volume of the recorded first audio;
[0151] After the second terminal stops transmitting the second audio, the first audio is resumed to play at the initial playback volume.
[0152] In one exemplary embodiment, the second playback unit may be used for:
[0153] Send a pre-play command to the first terminal, causing the first terminal to pause the playback of the first audio based on the pre-play command; and
[0154] Play the second audio.
[0155] In one exemplary embodiment, the audio playback device 1100 can also be used for:
[0156] Monitor the playback time of the second audio;
[0157] When the playback time is less than or equal to a time threshold and the second audio stops playing, a recovery command is sent to the first terminal so that the first terminal can resume playback of the first audio based on the recovery command.
[0158] In one exemplary embodiment, the audio playback device 1100 can also be used for:
[0159] In response to receiving a failure instruction indicating the audio data type of the second audio, a preemptive playback instruction is sent to the first terminal, causing the first terminal to pause playback of the first audio based on the preemptive playback instruction; and
[0160] Play the second audio.
[0161] The specific details of each module in the above-mentioned device have been described in detail in the method section of the implementation. For any undisclosed details, please refer to the implementation content of the method section, and therefore will not be repeated here.
[0162] Those skilled in the art will understand that various aspects of this disclosure can be implemented as systems, methods, or program products. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: entirely in hardware, entirely in software (including firmware, microcode, etc.), or in a combination of hardware and software, collectively referred to herein as “circuit,” “module,” or “system.”
[0163] Exemplary embodiments of this disclosure also provide a computer-readable storage medium storing a program product capable of implementing the methods described above. In some possible embodiments, various aspects of this disclosure can also be implemented as a program product including program code that, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure, such as executing... Figures 6 to 10 Any one or more steps in the process.
[0164] It should be noted that the computer-readable medium disclosed herein may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0165] In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wireline, optical fiber, RF, etc., or any suitable combination thereof.
[0166] Furthermore, program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0167] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0168] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. An audio playback method, characterized in that, The method is performed by an audio playback device with wireless communication capabilities, wherein the audio playback device is a TWS Bluetooth headset, and the audio playback device establishes a wireless communication connection with a first terminal and a second terminal. The method includes: While playing the first audio sent by the first terminal, respond to the playback request of the second terminal to play the second audio, and determine the audio data type of the second audio; the audio data type includes notification prompt type and non-notification prompt type; A playback mode for playing the first audio and the second audio is determined based on the audio data type; the playback mode includes a first playback mode and a second playback mode. Specifically, when the audio data type is a notification prompt type, the first playback mode is executed, and the audio stream data of the second audio sent by the second terminal is received, and the first audio and the second audio are merged and output in a hierarchical manner; when the audio data type is not a notification prompt type, the second playback mode is executed, a play-by-play instruction is generated based on the playback request, and the play-by-play instruction is sent to the first terminal, so that the first terminal responds to the play-by-play instruction to pause the playback of the first audio, and receives the audio stream data of the second audio sent by the second terminal to play the second audio; Get the initial playback volume of the first audio; While playing the second audio, monitor the playback time of the second audio; When the second audio stops playing and the playback time is less than or equal to the time threshold, the first audio is resumed to play at the initial playback volume.
2. The method according to claim 1, characterized in that, include: If the response determines that the audio data type is a notification prompt type, then the first audio and the second audio are played in the first playback mode; or If the response determines that the audio data type is a non-notification prompt type, then the first audio and the second audio are played in the second playback mode.
3. The method according to claim 2, characterized in that, Playing the first audio and the second audio in the first playback mode includes: Obtain the current playback volume of the first audio, and determine the volume threshold based on the current playback volume; Adjust the playback volume of the first audio to make the playback volume of the first audio less than the volume threshold; Adjust the playback volume of the second audio to make the playback volume of the second audio greater than or equal to the volume threshold; The first audio and the second audio, after adjusting the playback volume, are merged and output.
4. The method according to claim 2, characterized in that, Playing the first audio and the second audio in the first playback mode includes: Determine the audio data type of the first audio, and determine the first priority data corresponding to the first audio based on the audio data type of the first audio; Determine the second priority data corresponding to the second audio based on the notification prompt type; The playback volume data corresponding to the first audio and the second audio are determined based on the first priority data and the second priority data, respectively. Adjust the playback volume of the first audio and the second audio using the playback volume data; The first audio and the second audio, after adjusting the playback volume, are merged and output.
5. The method according to claim 2, characterized in that, The method further includes: When the playback time is less than or equal to a time threshold and the second audio stops playing, a recovery command is sent to the first terminal so that the first terminal can resume playback of the first audio based on the recovery command.
6. The method according to claim 1, characterized in that, The method further includes: In response to receiving a failure instruction indicating the audio data type of the second audio, a preemptive playback instruction is sent to the first terminal, causing the first terminal to pause playback of the first audio based on the preemptive playback instruction; and Play the second audio.
7. An audio playback device, characterized in that, The device is configured to be installed in an audio playback device with wireless communication capabilities, wherein the audio playback device is a TWS Bluetooth headset, and the audio playback device establishes a wireless communication connection with a first terminal and a second terminal. The device includes: An audio data type determination module is used to determine the audio data type of the second audio in response to a playback request from the second terminal to play a second audio while the first audio sent by the first terminal is playing; the audio data type includes notification prompt type and non-notification prompt type. A playback mode determination module is used to determine a playback mode for playing the first audio and the second audio based on the audio data type; the playback mode includes a first playback mode and a second playback mode; The audio playback device is further configured to: acquire the initial playback volume of the first audio; and, While playing the second audio, the playback time of the second audio is monitored; when the second audio stops playing and the playback time is less than or equal to the time threshold, the playback of the first audio is resumed according to the initial playback volume; The device is further configured to: when the audio data type is a notification prompt type, execute the first playback mode, receive the audio stream data of the second audio sent by the second terminal, and perform hierarchical fusion and output of the first audio and the second audio; when the audio data type is not a notification prompt type, execute the second playback mode, generate a play-by-play instruction based on the playback request, and send the play-by-play instruction to the first terminal, so that the first terminal responds to the play-by-play instruction to pause the playback of the first audio, and receive the audio stream data of the second audio sent by the second terminal to play the second audio.
8. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 6 by executing the executable instructions.