Audio data processing method and device

Through the introduction of audio data processing methods in the headset device, the problem of stealing and data conflict of headset devices in multiple connection scenes, and realizing the stable transmission and high -quality playback of audio data.

CN119342397APending Publication Date: 2025-01-21VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When audio data transmission is performed between headphone devices and multiple electronic devices, channel preemption and data conflict are prone to occur, resulting in interruption of audio playback or degradation of sound quality.

Method used

By introducing the audio data processing method in the headset device, when the audio data transmission request received the second electronic device is received, the information is sent to it, instructing the second electronic device to establish a connection with the first electronic device, and transmit the audio data to to the audio data to The first electronic device is mixed and then transmitted to the headset device.

Benefits of technology

Effectively avoid the audio channel of the second electronic device to seize the first electronic device, and mix and synchronize the audio data in the first electronic device to avoid the conflict of audio data and ensure the stability and quality of the audio signal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342397A_ABST
    Figure CN119342397A_ABST
Patent Text Reader

Abstract

The invention discloses an audio data processing method and device, and belongs to the technical field of audio. The method is applied to earphone equipment, and comprises the following steps: under the condition of playing first audio data sent by first electronic equipment, if an audio data transmission request sent by second electronic equipment is received, sending first information to the second electronic equipment, the audio data transmission request being used for requesting to send second audio data, the first information is used for establishing connection between the second electronic equipment and the first electronic equipment and sending second audio data to the first electronic equipment; and receiving third audio data sent by the first electronic equipment, wherein the third audio data is audio data obtained by carrying out sound mixing processing on the second audio data and audio data to be sent of the first electronic equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of audio technology, and specifically relates to an audio data processing method and device. Background Art

[0002] With the continuous development of wireless technology, the functions of headphone devices are becoming more and more abundant. For example, headphone devices can be connected to multiple electronic devices at the same time. This multi-connection function can avoid frequent switching between multiple electronic devices, allowing users to enjoy a continuous audio experience.

[0003] However, in the above-mentioned multi-connection function, when the headphone device is transmitting audio data with electronic device A, if electronic device B also attempts to transmit audio data with the headphone device, electronic device B may occupy the audio channel of electronic device A, resulting in interruption of the audio playback of electronic device A or degradation of the sound quality; or even if the headphone device maintains connection with the two electronic devices, problems may arise in the mixing and synchronization of the audio data, resulting in confusion or delay of the audio signal.

[0004] Therefore, how to avoid channel preemption and data conflicts in audio data transmission has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide an audio data processing method and device, which can avoid channel preemption and data conflict in audio data transmission.

[0006] In a first aspect, an embodiment of the present application provides an audio data processing method, which is applied to a headphone device, and the method includes: when playing first audio data sent by a first electronic device, if an audio data transmission request sent by a second electronic device is received, first information is sent to the second electronic device, the audio data transmission request is used to request to send the second audio data, and the first information is used for the second electronic device to establish a connection with the first electronic device and send the second audio data to the first electronic device; receiving third audio data sent by the first electronic device, the third audio data being audio data obtained after mixing the second audio data and the audio data to be sent by the first electronic device.

[0007] In a second aspect, an embodiment of the present application provides an audio data processing method, which is applied to a first electronic device, and the method includes: when sending first audio data to a headphone device, if a connection establishment request sent by a second electronic device is received, establishing a connection with the second electronic device, and the connection establishment request is used to request to establish a connection with the first electronic device; when receiving second audio data sent by the second electronic device, mixing the second audio data and the audio data to be sent by the first electronic device to obtain third audio data; and sending the third audio data to the headphone device.

[0008] In a third aspect, an embodiment of the present application provides an audio data processing method, which is applied to a second electronic device, and the method includes: sending an audio data transmission request to a headphone device, the audio data transmission request is used to request sending second audio data; when receiving first information sent by the headphone device, sending a connection establishment request to the first electronic device, the connection establishment request is used to request to establish a connection with the first electronic device, and the first information is used for the second electronic device to establish a connection with the first electronic device and send second audio data to the first electronic device; when the connection is established with the first electronic device, sending the second audio data to the first electronic device.

[0009] In a fourth aspect, an embodiment of the present application provides an audio data processing device, which includes a first sending module and a receiving module; the first sending module is used to send first information to the second electronic device if an audio data transmission request sent by a second electronic device is received while playing first audio data sent by a first electronic device, the audio data transmission request is used to request to send the second audio data, and the first information is used for the second electronic device to establish a connection with the first electronic device and send the second audio data to the first electronic device; the receiving module is used to receive third audio data sent by the first electronic device, the third audio data being audio data obtained by mixing the second audio data and the audio data to be sent by the first electronic device.

[0010] In a fifth aspect, an embodiment of the present application provides an audio data processing device, which includes a connection establishment module, a processing module and a second sending module; the connection establishment module is used to establish a connection with the second electronic device if a connection establishment request sent by a second electronic device is received when sending first audio data to the headphone device, and the connection establishment request is used to request to establish a connection with the first electronic device; the processing module is used to mix the second audio data and the audio data to be sent by the first electronic device to obtain third audio data when the second audio data sent by the second electronic device is received; the second sending module is used to send the third audio data to the headphone device.

[0011] In a sixth aspect, an embodiment of the present application provides an audio data processing device, which includes a third sending module; the third sending module is used to send an audio data transmission request to the headphone device, the audio data transmission request is used to request to send second audio data; and when receiving the first information sent by the headphone device, send a connection establishment request to the first electronic device, the connection establishment request is used to request to establish a connection with the first electronic device, the first information is used for the second electronic device to establish a connection with the first electronic device and send the second audio data to the first electronic device; and when the connection is established with the first electronic device, send the second audio data to the first electronic device.

[0012] In the seventh aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented, or the steps of the method described in the second aspect are implemented, or the steps of the method described in the third aspect are implemented.

[0013] In an eighth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented, or the steps of the method described in the second aspect are implemented, or the steps of the method described in the third aspect are implemented.

[0014] In the ninth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect, or to implement the method described in the second aspect, or to implement the method described in the third aspect.

[0015] In the tenth aspect, an embodiment of the present application provides a computer program / program product, which is stored in a storage medium and is executed by at least one processor to implement the method as described in the first aspect, or the method as described in the second aspect, or the method as described in the third aspect.

[0016] In an embodiment of the present application, when playing the first audio data sent by the first electronic device, if an audio data transmission request sent by the second electronic device is received, the headphone device can send a first message to the second electronic device, the audio data transmission request is used to request the second audio data to be sent, and the first message is used to instruct the second electronic device to establish a connection with the first electronic device and send the second audio data to the first electronic device; and receive the third audio data sent by the first electronic device, the third audio data is the audio data obtained by mixing the second audio data and the audio data to be sent by the first electronic device. Through this scheme, when the headphone device has established a connection with the first electronic device and is performing audio data transmission, if an audio data transmission request sent by the second electronic device is received, the first message can be sent to the second electronic device first, so that the second electronic device can establish a connection with the first electronic device and send the audio data originally requested to be sent to the headphone device to the first electronic device, and then the audio data obtained by mixing the audio data and the audio data to be sent by the first electronic device can be received. In this way, the headphone device can receive the audio data requested to be sent by the second electronic device through the first electronic device, which can avoid the second electronic device from occupying the audio channel of the first electronic device on the one hand, and mix and synchronize the audio data in the first electronic device on the other hand, which can avoid the conflict of audio data. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a flowchart of an audio data processing method provided by some embodiments of the present application;

[0018] Figure 2 is a flowchart of an audio data processing method provided by some embodiments of the present application;

[0019] Figure 3 is a flowchart of an audio data processing method provided by some embodiments of the present application;

[0020] Figure 4 is a flowchart of an audio data processing method provided by some embodiments of the present application;

[0021] Figure 5 is a schematic diagram of an audio data processing device provided by some embodiments of the present application;

[0022] Figure 6 is a schematic diagram of an audio data processing device provided by some embodiments of the present application;

[0023] Figure 7 is a schematic diagram of an audio data processing device provided by some embodiments of the present application;

[0024] Figure 8is a schematic diagram of an electronic device provided in an embodiment of the present application;

[0025] Fig. 9 It is a hardware schematic diagram of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0027] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0028] The term "indication" in this application can be a direct indication (or explicit indication) or an indirect indication (or implicit indication). A direct indication can be understood as the sender explicitly informing the receiver of specific information, operations to be performed, or request results in the sent indication; an indirect indication can be understood as the receiver determining the corresponding information according to the indication sent by the sender, or making a judgment and determining the operation to be performed or the request result according to the judgment result.

[0029] The terms "at least one (item)", "at least one of" and the like in the specification and claims of the present application refer to any one, any two or a combination of more than two of the objects included therein. For example, at least one (item) of a, b, and c can be represented by: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)".

[0030] The audio data processing method and device provided in the embodiments of the present application are described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0031] With the continuous development of Bluetooth technology, Bluetooth headset devices have the ability to connect to multiple devices at the same time, such as two smartphones at the same time. This dual connection function greatly improves the convenience of users, allowing users to enjoy a continuous audio experience without having to frequently switch devices. However, despite the many conveniences brought by dual connection technology, there are still some unresolved issues in practical applications, especially in audio data transmission.

[0032] When a Bluetooth headset device is transmitting audio data to device A, if device B also attempts to establish a connection with the headset and transmit audio data, it often causes channel preemption or data conflict. This is because the current Bluetooth protocol and headset processing mechanism have not yet completely solved the complexity and conflict management issues of multiple devices transmitting audio data at the same time. In this case, the Bluetooth headset device may not be able to process audio data from two devices at the same time, resulting in the following common problems:

[0033] 1. Channel preemption: When device B attempts to connect to a Bluetooth headset and transmit audio data, it may preempt the audio channel of device A, causing the audio playback of device A to be interrupted or the sound quality to deteriorate. This situation will significantly affect the audio applications that the user is using, such as calls, music playback, or video playback.

[0034] 2. Data conflict: Even if the Bluetooth headset device can maintain the connection with two devices, there may be problems with the mixing and synchronization of audio data, resulting in confusion or delay of audio signals. For example, when two devices send audio data at the same time, the Bluetooth headset device needs to buffer and process the data. If the processing power is insufficient or the algorithm is imperfect, the final output audio signal may be delayed, stuck or have reduced sound quality.

[0035] 3. Unable to transmit simultaneously: In some cases, the Bluetooth headset device may prioritize the audio data of the first connected device (such as device A) and reject the audio data transmission request of the second device (such as device B). In this case, device B cannot play audio through the Bluetooth headset device and needs to wait for device A to finish audio data transmission before connecting and transmitting audio data. This obviously cannot meet the needs of users in multi-tasking scenarios.

[0036] These problems not only affect the user experience, but also limit the potential of dual-connection functions of Bluetooth headset devices. Especially in the context of increasing multitasking requirements, users want to be able to switch seamlessly between two devices, or receive audio data from two devices at the same time, but related technologies obviously fail to fully meet this demand. Therefore, how to avoid channel preemption and data conflicts in audio data transmission has become a key direction to improve the practicality and user experience of dual-connection technology of Bluetooth headset devices.

[0037] In order to solve the above problems, the embodiments of the present application provide an audio data processing method, device, electronic device and readable storage medium. The audio data processing method provided in the embodiments of the present application can be applied to audio data processing in a dual-connection scenario of a Bluetooth headset device.

[0038] For example, assuming that the Bluetooth headset device is connected to electronic device A and electronic device B at the same time, then when playing the first audio data sent by electronic device A, if an audio data transmission request sent by electronic device B is received, the Bluetooth headset device can send a first message to electronic device B, the audio data transmission request is used to request to send the second audio data, and the first message is used for electronic device B to establish a connection with electronic device A and send the second audio data to electronic device A; and receive the third audio data sent by electronic device A, the third audio data is the audio data obtained by mixing the second audio data and the audio data to be sent by electronic device A. Through this solution, when the Bluetooth headset device has established a connection with electronic device A and is transmitting audio data, if an audio data transmission request sent by electronic device B is received, the first message can be sent to electronic device B first, so that electronic device B can establish a connection with electronic device A and send the audio data originally requested to be sent to the Bluetooth headset device, and then the audio data sent by electronic device A can be received after mixing the audio data and the audio data to be sent by electronic device A. In this way, the Bluetooth headset device can receive the audio data requested to be sent by electronic device B through electronic device A. On the one hand, it can prevent electronic device B from occupying the audio channel of electronic device A. On the other hand, mixing and synchronous processing of audio data in electronic device A can avoid conflicts in audio data.

[0039] It should be noted that the audio data processing method provided in the embodiments of the present application may be executed by an audio data processing device, an electronic device, or a functional module in an electronic device, etc. In some embodiments of the present application, an earphone device executing the audio data processing method is used as an example to illustrate the audio data processing method provided in the embodiments of the present application.

[0040] Figure 1 FIG. 1 is a flow chart showing the audio data processing method provided by an embodiment of the present application. Figure 1 As shown, the audio data processing method provided in the embodiment of the present application may include the following steps 101 and 102.

[0041] Step 101: When playing first audio data sent by a first electronic device, if an audio data transmission request sent by a second electronic device is received, the earphone device sends first information to the second electronic device.

[0042] The audio data transmission request is used to request sending the second audio data, and the first information is used for the second electronic device to establish a connection with the first electronic device and send the second audio data to the first electronic device.

[0043] Optionally, in the embodiment of the present application, the first electronic device may include but is not limited to: a mobile phone, a tablet computer, a PDA, a car-mounted electronic device or a television, and any other electronic device that can establish a connection with the headphone device.

[0044] Optionally, in the embodiment of the present application, the second electronic device may include but is not limited to: a mobile phone, a tablet computer, a PDA, a car-mounted electronic device or a television, and any other electronic device that can establish a connection with the headphone device.

[0045] Optionally, in the embodiment of the present application, the first electronic device and the second electronic device may be electronic devices of the same type or different types.

[0046] For example, the first electronic device is a mobile phone, and the second electronic device is a tablet computer; or, the first electronic device is a mobile phone, and the second electronic device is also a mobile phone.

[0047] Optionally, in the embodiment of the present application, the headphone device may include but is not limited to: a Bluetooth headphone device, an infrared headphone device, a 2.4G headphone device, and any other headphone device with a wireless connection function.

[0048] Optionally, in the embodiment of the present application, both the first electronic device and the second electronic device have established connections with the headphone device.

[0049] Exemplarily, the first electronic device can send a connection request to the headphone device through its Bluetooth module. After receiving the connection request, the headphone device confirms and establishes a connection with the first electronic device, and allocates an independent Bluetooth channel to the first electronic device for subsequent audio data transmission. The second electronic device can also send a connection request to the headphone device through its Bluetooth module. After receiving the connection request, the headphone device confirms and establishes a connection with the second electronic device, and allocates an independent Bluetooth channel to the second electronic device for subsequent audio data transmission. The two Bluetooth channels operate independently to ensure that each electronic device can perform basic communication and control operations with the headphone device. In the process of establishing the connection, the headphone device will record the Bluetooth address and communication port information of each electronic device to ensure the accuracy and stability of subsequent communications.

[0050] Optionally, in an embodiment of the present application, after the first electronic device and the second electronic device are connected to the headphone device, the first electronic device may first transmit audio data to the headphone device, and the headphone device receives and plays the audio data transmitted by the first electronic device.

[0051] Exemplarily, the first electronic device first encodes the audio signal to generate audio data packets suitable for Bluetooth transmission. Then, these data packets are continuously sent to the headphone device through the assigned Bluetooth channel. After receiving these data packets, the Bluetooth module in the headphone device decodes them and restores them to the original audio signal, which is then played through the speaker of the headphone device.

[0052] Optionally, in an embodiment of the present application, when the headphone device is playing the first audio data, the second electronic device may send the audio data transmission request to the headphone device through the assigned Bluetooth channel to request the transmission of the second audio data. After receiving the audio data transmission request, the headphone device cannot process the audio transmission request from the second electronic device at the same time because it is currently playing the audio data from the first electronic device. Therefore, the transmission intention of the second electronic device may be recorded, but the audio data from the second electronic device will not be processed immediately.

[0053] Optionally, in an embodiment of the present application, the headphone device can determine whether it can process audio data from the second electronic device by detecting the current audio focus state. That is, it detects whether the headphone device is currently playing audio data from the first electronic device; if it is detected that the current audio focus is occupied by the first electronic device, and the resources of the headphone device cannot simultaneously process the audio data of the second electronic device, the headphone device will record the current status information (i.e., the first status information described below). Then, the above-mentioned first information is determined based on the current status information, and the first information is sent to the second electronic device to instruct the second electronic device to establish a connection with the first electronic device and send the above-mentioned second audio data to the first electronic device.

[0054] Optionally, in an embodiment of the present application, the first audio data may include any type of audio data such as call audio data or media playback audio data.

[0055] Optionally, in an embodiment of the present application, the second audio data may include any type of audio data such as call audio data or media playback audio data.

[0056] Optionally, in an embodiment of the present application, a data type of the first audio data and a data type of the second audio data may be the same or different.

[0057] Optionally, in the embodiment of the present application, the first information may include an indication information, and the indication information may instruct the second electronic device to establish a connection with the first electronic device and send the second audio data to the first electronic device.

[0058] Optionally, in an embodiment of the present application, the first information may include first status information and device information of the first electronic device.

[0059] The first status information is used to indicate that the earphone device is playing the audio data of the first electronic device, and the earphone device cannot process the second audio data at the same time.

[0060] Optionally, in an embodiment of the present application, when the above-mentioned first information includes the above-mentioned first status information and the above-mentioned device information, the first information can enable the second electronic device to establish a connection with the first electronic device and send the above-mentioned second audio data to the first electronic device; that is, after receiving the first information, the second electronic device can start to establish a connection with the first electronic device and send the second audio data to the first electronic device.

[0061] Optionally, in an embodiment of the present application, the above-mentioned device information may include but is not limited to at least one of the following: device name, device type, device address, Bluetooth address, etc.

[0062] It can be understood that after receiving the above-mentioned first information, the second electronic device can know that the headphone device is playing the audio data of the first electronic device, and the headphone device cannot process the above-mentioned second audio data at the same time, so that the second electronic device can try to establish a connection with the first electronic device and send the second audio data to the first electronic device.

[0063] In an embodiment of the present application, since the above-mentioned first information may include the above-mentioned first status information and the device information of the first electronic device, the headphone device can inform the second electronic device of the current status of the headphone device and the device information of the first electronic device by sending the first information to the second electronic device, thereby facilitating the second electronic device to attempt to establish a connection with the first electronic device and transmit audio data through the first electronic device, thereby avoiding channel preemption in audio data transmission.

[0064] Step 102: The earphone device receives third audio data sent by the first electronic device.

[0065] The third audio data is audio data obtained by mixing the second audio data and the audio data to be sent by the first electronic device.

[0066] It can be understood that the third audio data includes audio data to be sent by the first electronic device and audio data to be sent by the second electronic device.

[0067] The specific method for obtaining the third audio data will be described in detail in the following embodiments, and will not be described here in order to avoid repetition.

[0068] In the audio data processing method provided in the embodiment of the present application, when the headphone device has established a connection with the first electronic device and is transmitting audio data, if an audio data transmission request sent by the second electronic device is received, the first information can be sent to the second electronic device first to instruct the second electronic device to establish a connection with the first electronic device and send the audio data originally requested to be sent to the headphone device to the first electronic device, and then the audio data sent by the first electronic device can be received after mixing the audio data and the audio data to be sent by the first electronic device. In this way, the headphone device can receive the audio data requested to be sent by the second electronic device through the first electronic device, which can avoid the second electronic device from occupying the audio channel of the first electronic device on the one hand, and mix and synchronize the audio data in the first electronic device on the other hand, so as to avoid conflicts in the audio data.

[0069] Optionally, in some embodiments of the present application, after the above step 102, the audio data processing method provided in the embodiment of the present application may further include the following step 103.

[0070] Step 103: When the first audio data is played, the earphone device plays the third audio data.

[0071] Optionally, in the embodiment of the present application, after receiving the third audio data, the headphone device decodes the third audio data to restore it to the original audio data. After playing the first audio data, the decoded third audio data can be directly played through the speaker of the headphone device, thereby ensuring that the user can hear the audio content from the first electronic device and the second electronic device at the same time.

[0072] It should be noted that the headphone device needs to have efficient audio decoding and playback capabilities during this process to ensure the quality and synchronization of the audio signal. Through this design, two electronic devices can use one headphone device to transmit and play audio data at the same time, greatly improving the user experience. During this process, the Bluetooth connection between the first electronic device and the headphone device needs to remain stable to ensure the efficiency and real-time nature of audio data transmission.

[0073] In the embodiment of the present application, since the headphone device plays the third audio data after completing the playback of the first audio data, there is no need to mix and synchronize the audio data in the headphone device, thereby avoiding conflicts in the audio data and playing the audio data from the first electronic device and the second electronic device at the same time.

[0074] It should be noted that the audio data processing method provided in the embodiments of the present application may be executed by an audio data processing device, an electronic device, or a functional module in an electronic device, etc. In some embodiments of the present application, the audio data processing method provided in the embodiments of the present application is described by taking the first electronic device executing the audio data processing method as an example.

[0075] Figure 2 FIG. 1 is a flow chart showing the audio data processing method provided by an embodiment of the present application. Figure 2 As shown, the audio data processing method provided in the embodiment of the present application may include the following steps 201 to 203.

[0076] Step 201: When sending first audio data to a headphone device, if a connection establishment request sent by a second electronic device is received, the first electronic device establishes a connection with the second electronic device.

[0077] The connection establishment request is used to request to establish a connection with the first electronic device.

[0078] Optionally, in the embodiment of the present application, after the first electronic device establishes a connection with the second electronic device, the first electronic device can receive data sent by the second electronic device.

[0079] Step 202: When receiving the second audio data sent by the second electronic device, the first electronic device mixes the second audio data and the audio data to be sent by the first electronic device to obtain third audio data.

[0080] The audio data to be sent is audio data to be sent to a headphone device for playback.

[0081] Optionally, in an embodiment of the present application, after receiving the above-mentioned second audio data, the first electronic device can decode and cache the second audio data to prepare for subsequent mixing processing. In this process, the second electronic device needs to ensure the transmission rate and integrity of the audio data to avoid data loss or transmission delay. The first electronic device needs to have efficient data decoding and caching capabilities to ensure that the received audio data can be processed in a timely manner. Through this design, the audio data of the second electronic device can be directly transmitted to the first electronic device without directly occupying the resources of the headphone device, laying the foundation for subsequent audio mixing and playback.

[0082] Optionally, in an embodiment of the present application, after receiving the above-mentioned second audio data, the first electronic device can directly mix the second audio data and the above-mentioned audio data to be sent to obtain the above-mentioned third audio data; or it can mix the second audio data and the above-mentioned audio data to be sent to obtain the above-mentioned third audio data through the following method 1.

[0083] Method 1

[0084] Optionally, in the embodiment of the present application, the above step 202 can be specifically implemented by the following steps 202a and 202b.

[0085] Step 202a: The first electronic device adds a first identifier to the second audio data to obtain the second audio data after the identifier is added.

[0086] The first identifier is used to distinguish the second audio data from the audio data to be sent.

[0087] Optionally, in an embodiment of the present application, the first identifier may include a “start” identifier and an “end” identifier.

[0088] For example, the first electronic device can add a "start" marker to the header of the second audio data and add an "end" marker to the end of the second audio data to obtain the second audio data "start" + second audio data + "end" after adding the markers; it can be seen that these markers help the first electronic device to accurately identify and process audio data from different sources during mixing.

[0089] Step 202b: The first electronic device mixes the second audio data with the identifier added and the audio data to be sent to obtain third audio data.

[0090] Optionally, in an embodiment of the present application, the first electronic device may perform the above-mentioned mixing processing through audio processing software in the first electronic device, or perform the above-mentioned mixing processing through hardware such as a synthesizer, a sound effect processor or a mixing console to ensure the synchronization and sound quality of the two audio data.

[0091] It should be noted that mixing is the process of integrating sounds from multiple sources into a stereo or mono track. During the mixing process, the frequency, dynamics, sound quality, positioning, reverberation and sound field of each original signal can be adjusted separately to optimize each track and then superimposed on the final product.

[0092] For a detailed description of the above-mentioned mixing process, reference may be made to the relevant description in the related art, and in order to avoid repetition, it will not be described again here.

[0093] It can be understood that the third audio data obtained after the mixing process contains the audio data of the first electronic device and the second electronic device at the same time, thereby ensuring that the user can clearly hear the audio content from the two electronic devices. In this process, the first electronic device needs to have efficient audio processing and mixing capabilities to ensure the quality and real-time performance of the audio signal.

[0094] In an embodiment of the present application, after receiving the above-mentioned second audio data, the first electronic device can first add the above-mentioned first identifier to the second audio data, and then mix the second audio data with the added identifier and the above-mentioned audio data to be sent to obtain the above-mentioned third audio data. Therefore, through the first identifier, the clear separation and synchronous playback of audio data from different sources can be ensured during the mixing process, thereby improving the accuracy of the mixing process.

[0095] Step 203: The first electronic device sends third audio data to the earphone device.

[0096] Optionally, in an embodiment of the present application, after obtaining the third audio data, the first electronic device may send the third audio data to the headphone device via a Bluetooth connection for playback.

[0097] In the audio data processing method provided in the embodiment of the present application, when the first electronic device has established a connection with the headphone device and is transmitting audio data, after receiving the connection establishment request sent by the second electronic device, a connection with the second electronic device can be established, and after receiving the audio data sent by the second electronic device, the audio data and the audio data to be sent by the first electronic device are mixed, and the processed audio data is sent to the headphone device. In this way, the audio data requested by the second electronic device to be sent to the headphone can be sent to the headphone device through the first electronic device, which can avoid the second electronic device from occupying the audio channel of the first electronic device on the one hand, and mixing and synchronously processing the audio data in the first electronic device can avoid conflicts in audio data on the other hand.

[0098] Optionally, in some embodiments of the present application, after the above step 203, the audio data processing method provided in the embodiment of the present application may further include the following step 204.

[0099] Step 204: The first electronic device sends a disconnection request to the second electronic device.

[0100] The disconnection request is used to request disconnection with the second electronic device.

[0101] Optionally, in the embodiment of the present application, the first electronic device may send the disconnection request to the second electronic device after the earphone device finishes playing the third audio data; or may send the disconnection request to the second electronic device according to a predetermined logic (such as a preset duration) or a user instruction. The specific method may be determined according to actual use requirements and is not limited in the embodiment of the present application.

[0102] It should be noted that before disconnecting from the second electronic device, the first electronic device needs to ensure that all audio data transmission and mixing processing have been completed, and the headphone device has successfully played all mixed audio data to prevent audio interruption or data loss.

[0103] Optionally, in an embodiment of the present application, the first electronic device may send the above-mentioned connection disconnection request to the second electronic device through a communication protocol to request to disconnect the connection with the second electronic device.

[0104] Optionally, in the embodiment of the present application, after the first electronic device is disconnected from the second electronic device, the first electronic device still maintains the connection with the headphone device to continue processing and transmitting its own audio data. This not only ensures stable communication between the first electronic device and the headphone device, but also provides convenience for the second electronic device to reconnect to the headphone device when needed.

[0105] In an embodiment of the present application, since the first electronic device can send the above-mentioned connection disconnection request to the second electronic device after sending the above-mentioned third audio data to the headphone device to request to disconnect the connection with the second electronic device, the occupation of connection resources can be reduced and the performance and battery utilization efficiency of the first electronic device can be optimized.

[0106] For other descriptions in the embodiments of the present application, reference can be made to the relevant descriptions in the above-mentioned headphone device side method embodiment. In order to avoid repetition, they will not be repeated here.

[0107] It should be noted that the audio data processing method provided in the embodiments of the present application may be executed by an audio data processing device, an electronic device, or a functional module in an electronic device, etc. In some embodiments of the present application, the audio data processing method provided in the embodiments of the present application is described by taking the second electronic device executing the audio data processing method as an example.

[0108] Figure 3 FIG. 1 is a flow chart showing the audio data processing method provided by an embodiment of the present application. Figure 3 As shown, the audio data processing method provided in the embodiment of the present application may include the following steps 301 to 303.

[0109] Step 301: The second electronic device sends an audio data transmission request to the earphone device.

[0110] The audio data transmission request is used to request sending the second audio data.

[0111] Step 302: Upon receiving the first information sent by the earphone device, the second electronic device sends a connection establishment request to the first electronic device.

[0112] The connection establishment request is used to request to establish a connection with the first electronic device, and the first information is used by the second electronic device to establish a connection with the first electronic device and send the second audio data to the first electronic device.

[0113] Optionally, in an embodiment of the present application, after receiving the above-mentioned first information, the second electronic device may send the above-mentioned connection establishment request to the first electronic device through a communication protocol according to the device information of the first electronic device in the first information.

[0114] It is understandable that the second electronic device no longer directly transmits audio data to the headphone device, but transmits it indirectly through the first electronic device. This can prevent the headphone device from directly processing audio data from multiple electronic devices, thereby reducing the load of the headphone device and ensuring the reliability of audio playback.

[0115] Optionally, in an embodiment of the present application, the first information may include first status information and device information of the first electronic device.

[0116] The first status information is used to indicate that the earphone device is playing the audio data of the first electronic device, and the earphone device cannot process the second audio data at the same time.

[0117] Step 303: When the connection with the first electronic device is established, the second electronic device sends the second audio data to the first electronic device.

[0118] Optionally, in an embodiment of the present application, the process of establishing a connection between the second electronic device and the first electronic device needs to ensure the security and reliability of data transmission to facilitate smooth transmission and processing of subsequent audio data.

[0119] Optionally, in an embodiment of the present application, the second electronic device may package and send the second audio data to the first electronic device through a communication protocol.

[0120] In the audio data processing method provided in the embodiment of the present application, when the second electronic device requests to send audio data to the headphone device, it can receive the first information sent by the headphone device, then establish a connection with the first electronic device and send the audio data to the first electronic device, so that the first electronic device can mix the audio data and the audio data to be sent by the first electronic device, and send the processed audio data to the headphone device. In this way, the audio data requested by the second electronic device to be sent to the headset can be sent to the headphone device through the first electronic device, which can avoid the second electronic device from occupying the audio channel of the first electronic device on the one hand, and mix and synchronize the audio data in the first electronic device on the other hand, so as to avoid conflicts in audio data.

[0121] Optionally, in some embodiments of the present application, after the above step 303, the audio data processing method provided in the embodiment of the present application may further include the following step 304.

[0122] Step 304: Upon receiving the disconnection request sent by the first electronic device, the second electronic device disconnects from the first electronic device.

[0123] The disconnection request is used to request disconnection with the second electronic device.

[0124] Optionally, in the embodiment of the present application, after receiving the above-mentioned connection disconnection request, the second electronic device can confirm and execute the operation of disconnecting the connection with the first electronic device to terminate the connection with the first electronic device.

[0125] In the embodiment of the present application, since the second electronic device can disconnect from the first electronic device when receiving the above-mentioned connection disconnection request sent by the first electronic device, the occupancy of connection resources is reduced and the performance and battery usage efficiency of the second electronic device are optimized.

[0126] For other descriptions in the embodiments of the present application, reference may be made to the relevant descriptions in the above-mentioned headphone device side method embodiment and the above-mentioned first electronic device side method embodiment. In order to avoid repetition, they will not be repeated here.

[0127] The audio data processing method provided in the embodiment of the present application is exemplarily described below with reference to the accompanying drawings.

[0128] For example, Figure 4 As shown, assuming that device A is a first electronic device and device B is a second electronic device, the audio data processing method provided in this embodiment of the present application may include the following steps a to j.

[0129] Step a, device A establishes a connection with the headset device;

[0130] Step b, device B establishes a connection with the headset device;

[0131] In the above steps a and b, device A and device B establish initial connections with the headphone device respectively. First, device A sends a connection request to the headphone device through its Bluetooth module. After receiving the connection request, the headphone device confirms and establishes a connection with device A, and allocates an independent Bluetooth channel to device A for subsequent audio data transmission. Subsequently, device B also sends a connection request to the headphone device through its Bluetooth module. The headphone device also receives and confirms, establishes a connection with device B, and allocates another independent Bluetooth channel to device B. These two channels operate independently to ensure that each device can perform basic communication and control operations with the headphone device. In the process of establishing a connection, the headset will record the Bluetooth address and communication port information of each device to ensure the accuracy and stability of subsequent communications.

[0132] Step c, device A starts transmitting audio data to the headphone device;

[0133] After the connection is successfully established, device A starts to transmit audio data to the headset device. Device A first encodes the audio data to generate audio data packets suitable for Bluetooth transmission. Then, these data packets are continuously sent to the headset device through the Bluetooth channel. After receiving these data packets, the Bluetooth module in the headset device decodes them and restores them to the original audio signal, which is then played through the speaker of the headset device.

[0134] Step d: Device B attempts to transmit audio data to the earphone device;

[0135] While device A and the headset device are transmitting and playing audio data normally, device B also starts trying to transmit audio data to the headset device when it receives a message alert tone or plays a song. Device B sends an audio data transmission request to the headset device through the established Bluetooth connection. After receiving the audio data transmission request, the headset device records the transmission intention of device B, but does not immediately process the audio data of device B. This is because the headset device is currently processing the audio data from device A and cannot process the audio transmission request from device B at the same time. The audio data transmission request of device B and the actual audio data are in a waiting state inside the headset device, preparing for the next operation. In this way, the headset device can manage the audio data transmission requests of multiple devices and ensure that the audio data from different devices are processed in an orderly manner without affecting the current audio playback. This processing method can effectively avoid the situation where multiple devices compete for the audio channel at the same time, ensuring that the headset can play audio stably.

[0136] Step e: the headphone device determines whether the audio data of device B can be played at present, and device B determines whether the audio data can be sent directly to the headphone device;

[0137] After receiving the audio data transmission request from device B, the headset device will first determine whether it can currently play the audio data from device B. This determination process involves detecting the current audio focus state of the headset device, that is, whether the headset device is currently playing the audio data from device A. If the headset device detects that the current audio focus is occupied by device A and the resources of the headset device cannot simultaneously process the audio data from device B, the headset will record the current state.

[0138] Step f: If the headset device determines that device B cannot obtain the audio focus for playback, the headset device forwards the first status information and the device information of device A to device B, and device B attempts to establish a connection with device A;

[0139] If the headphone device determines that device B cannot obtain audio focus and play, the headphone device will forward the above-mentioned first status information and the device information of device A to device B. After receiving this information, device B begins to try to establish a direct connection with device A. In this process, device B uses the information of device A provided by the headphone device to send a connection establishment request to device A through the communication protocol. At this time, the goal of device B is no longer to transmit audio data directly to the headphone device, but to transmit it indirectly through device A. This step is designed to prevent the headphone device from directly processing audio data from multiple devices, thereby reducing the load of the headphone device and ensuring the reliability of audio playback. The process of establishing a connection between device B and device A needs to ensure the security and reliability of data transmission to facilitate the smooth transmission and processing of subsequent audio data.

[0140] Step g: After device B establishes a connection with device A, device B sends the audio data to be played to device A;

[0141] After device B successfully establishes a connection with device A, device B sends the audio data it needs to play to device A. Device B can package and transmit the audio data to device A through the communication protocol. Audio data may include multiple types such as real-time call audio and media playback audio. After receiving these data packets, device A will decode and cache them in preparation for subsequent mixing processing. In this process, device B needs to ensure the transmission rate and integrity of the audio data to avoid data loss or transmission delays. Device A needs to have efficient data decoding and caching capabilities to ensure that the received audio data can be processed in a timely manner. Through this design, the audio data of device B can be smoothly transmitted to device A without directly occupying the resources of the headphone device, laying the foundation for subsequent audio mixing and playback.

[0142] Step h, device A processes the audio data sent by device B; specifically, the audio data sent by device B can be added with the above-mentioned first identifier (such as "start" + B device audio + "end") and then mixed with the original audio data of device A.

[0143] After device A receives the audio data from device B, in order to distinguish and process audio data from different sources, it will add the above-mentioned first identifier before and after the audio data of device B. For example, device A can add a "start" identifier before the audio data of device B and an "end" identifier at the end. These identifiers help device A to accurately identify and process audio signals from different sources during mixing. Next, device A mixes the identified audio data of device B with its own audio data. The mixing process can be implemented by the audio processing software or hardware of device A to ensure the synchronization and sound quality of the two audio signals. The mixed audio data contains the audio signals of device A and device B, ensuring that the user can clearly hear the audio content from the two devices. In this process, device A needs to have efficient audio processing and mixing capabilities to ensure the quality and real-time performance of the audio signal.

[0144] Step i, device A sends the audio data obtained after the mixing process to the earphone device; the earphone device plays the audio data after receiving it;

[0145] After device A completes the mixing of the audio data, it transmits the mixed audio data to the headphone device via the Bluetooth connection. After receiving these mixed audio data packets, the headphones decode them and restore them to the original audio signal. The decoded audio signal is played through the speaker of the headphone device to ensure that the user can hear the audio content from device A and device B at the same time. In this process, the headphones need to have efficient audio decoding and playback capabilities to ensure the quality and synchronization of the audio signal. Through this design, two devices can use one headset to transmit and play audio data at the same time, greatly improving the user experience. In this process, the Bluetooth connection between device A and the headphone device needs to remain stable to ensure the efficiency and real-time transmission of audio data.

[0146] Step j: After the headphone device finishes playing, device A disconnects from device B;

[0147] After the headphone device completes playing the audio data obtained by the mixing process, device A can actively disconnect from device B according to the predetermined logic or user instructions. This process begins with device A sending a disconnection request to device B through the communication protocol. After receiving the disconnection request, device B confirms and performs the disconnection operation to terminate the connection with device A. Before disconnecting, device A needs to ensure that all audio data transmission and mixing processing have been completed, and that the headphone device has successfully played all mixed audio data to prevent audio interruption or data loss.

[0148] The purpose of disconnection is to reduce the occupation of connection resources and optimize the performance and battery efficiency of device A. After disconnecting from device B, device A still maintains the connection with the headset device and continues to process and transmit its own audio data. This design not only ensures stable communication between device A and the headset device, but also makes it convenient for device B to reconnect the headset when needed.

[0149] In this way, when multiple devices try to transmit audio data to the headphone device at the same time, the intelligent data processing mechanism can reasonably process the data to avoid audio data conflicts and channel preemption. This not only ensures the seamless transmission of audio data from each device, but also improves the overall audio processing efficiency of the headset. This allows users to quickly switch audio playback between different devices, or receive audio signals from multiple devices at the same time, greatly improving the ease of use and multi-tasking capabilities of the headphone device. Users can enjoy seamless switching and synchronous playback of multi-device audio without complicated manual operations.

[0150] The above-mentioned method embodiments, or various possible implementation methods in each method embodiment, can be executed separately, or, under the premise that there is no contradiction, can also be executed in combination with each other. The specific implementation can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.

[0151] The audio data processing method provided in the embodiment of the present application can be executed by an audio data processing device. In the embodiment of the present application, an audio data processing device executing the audio data processing method is taken as an example to illustrate the audio data processing device provided in the embodiment of the present application.

[0152] like Figure 5 As shown, an embodiment of the present application provides an audio data processing device 50 , which may include a first sending module 51 and a receiving module 52 .

[0153] Among them, the first sending module 51 can be used to send first information to the second electronic device if an audio data transmission request sent by the second electronic device is received while playing the first audio data sent by the first electronic device, and the audio data transmission request is used to request to send the second audio data, and the first information is used for the second electronic device to establish a connection with the first electronic device and send the second audio data to the first electronic device. The receiving module 52 can be used to receive the third audio data sent by the first electronic device, and the third audio data is the audio data obtained by mixing the second audio data and the audio data to be sent by the first electronic device.

[0154] In a possible implementation, the first information may include first status information and device information of the first electronic device, wherein the first status information is used to indicate that the earphone device is playing the audio data of the first electronic device and the earphone device cannot process the second audio data at the same time.

[0155] In a possible implementation, the audio data processing device 50 may further include a playing module. The playing module may be configured to play the third audio data after the receiving module 52 receives the third audio data sent by the first electronic device and the first audio data is played.

[0156] In the audio data processing device provided in the embodiment of the present application, when the headphone device has established a connection with the first electronic device and is performing audio data transmission, if an audio data transmission request sent by the second electronic device is received, the audio data processing device can first send a first message to the second electronic device, so that the second electronic device can establish a connection with the first electronic device and send the audio data originally requested to be sent to the headphone device to the first electronic device, and then can receive the audio data sent by the first electronic device after mixing the audio data and the audio data to be sent by the first electronic device. In this way, the headphone device can receive the audio data requested to be sent by the second electronic device through the first electronic device, which can avoid the second electronic device from occupying the audio channel of the first electronic device on the one hand, and mix and synchronize the audio data in the first electronic device on the other hand, so as to avoid conflicts in the audio data.

[0157] The audio data processing device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0158] The audio data processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0159] The audio data processing device provided in the embodiment of the present application can implement the various processes implemented in the above-mentioned headphone device side method embodiment and achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0160] like Figure 6 As shown, an embodiment of the present application provides an audio data processing device 60 , which may include a connection establishing module 61 , a processing module 62 and a second sending module 63 .

[0161] The connection establishment module 61 can be used to establish a connection with the second electronic device if a connection establishment request sent by the second electronic device is received when sending the first audio data to the headphone device. The connection establishment request is used to request to establish a connection with the first electronic device. The processing module 62 can be used to mix the second audio data and the audio data to be sent by the first electronic device to obtain the third audio data when receiving the second audio data sent by the second electronic device. The second sending module 63 can be used to send the third audio data to the headphone device.

[0162] In one possible implementation, the processing module 62 can be specifically used to add a first identifier to the above-mentioned second audio data to obtain the second audio data after the identifier is added, and the first identifier is used to distinguish the second audio data from the above-mentioned audio data to be sent; and mix the second audio data after the identifier is added and the audio data to be sent to obtain the above-mentioned third audio data.

[0163] In a possible implementation, the second sending module 63 may be further configured to send a disconnection request to the second electronic device after sending the third audio data to the earphone device, where the disconnection request is used to request to disconnect the second electronic device.

[0164] In the audio data processing device provided in the embodiment of the present application, when the first electronic device has established a connection with the headphone device and is transmitting audio data, the audio data processing device can establish a connection with the second electronic device after receiving a connection establishment request sent by the second electronic device, and after receiving the audio data sent by the second electronic device, mix the audio data with the audio data to be sent by the first electronic device, and send the processed audio data to the headphone device. In this way, the audio data requested by the second electronic device to be sent to the headphone can be sent to the headphone device through the first electronic device, which can avoid the second electronic device from occupying the audio channel of the first electronic device on the one hand, and mix and synchronize the audio data in the first electronic device on the other hand, so as to avoid conflicts in the audio data.

[0165] The audio data processing device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or a device other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a MID, an AR / VR device, a robot, a wearable device, a UMPC, a netbook or a PDA, etc., and can also be a server, a NAS, a PC, a TV, a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0166] The audio data processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0167] The audio data processing device provided in the embodiment of the present application can implement the various processes implemented by the above-mentioned first electronic device side method embodiment and achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0168] like Figure 7As shown, an embodiment of the present application provides an audio data processing device 70 , and the audio data processing device 70 may include a third sending module 71 .

[0169] Among them, the third sending module 71 can be used to send an audio data transmission request to the headphone device, and the audio data transmission request is used to request to send the second audio data; and when receiving the first information sent by the headphone device, send a connection establishment request to the first electronic device, and the connection establishment request is used to request to establish a connection with the first electronic device, and the first information is used for the second electronic device to establish a connection with the first electronic device and send the second audio data to the first electronic device; and when the connection is established with the first electronic device, send the second audio data to the first electronic device.

[0170] In a possible implementation, the first information may include first status information and device information of the first electronic device, wherein the first status information is used to indicate that the earphone device is playing the audio data of the first electronic device and the earphone device cannot process the second audio data at the same time.

[0171] In a possible implementation, the audio data processing device 70 may further include a disconnection module. The disconnection module may be configured to disconnect the first electronic device after the third sending module 71 sends the second audio data to the first electronic device and, upon receiving a disconnection request sent by the first electronic device, disconnect the first electronic device, wherein the disconnection request is used to request disconnection from the second electronic device.

[0172] In the audio data processing device provided in the embodiment of the present application, when the second electronic device requests to send audio data to the headphone device, the audio data processing device can receive the first information sent by the headphone device, and then establish a connection with the first electronic device and send the audio data to the first electronic device, so that the first electronic device can mix the audio data and the audio data to be sent by the first electronic device, and send the processed audio data to the headphone device. In this way, the audio data requested by the second electronic device to be sent to the headphone can be sent to the headphone device through the first electronic device, which can avoid the second electronic device from occupying the audio channel of the first electronic device on the one hand, and mix and synchronize the audio data in the first electronic device on the other hand, so as to avoid conflicts in the audio data.

[0173] The audio data processing device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or a device other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a MID, an AR / VR device, a robot, a wearable device, a UMPC, a netbook or a PDA, etc., and can also be a server, a NAS, a PC, a TV, a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0174] The audio data processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0175] The audio data processing device provided in the embodiment of the present application can implement the various processes implemented in the above-mentioned second electronic device side method embodiment and achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0176] like Figure 8 As shown, an embodiment of the present application also provides an electronic device 100, including a processor 101 and a memory 102, wherein the memory 102 stores programs or instructions that can be executed on the processor 101, and when the program or instructions are executed by the processor 101, the various steps of the audio data processing method embodiment described above are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0177] It should be noted that the electronic devices in the embodiments of the present application include mobile electronic devices and non-mobile electronic devices.

[0178] Fig. 9 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0179] like Fig. 9 As shown, the electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.

[0180] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig. 9The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0181] Among them, the radio frequency unit 1001 can be used to send first information to the second electronic device if an audio data transmission request sent by a second electronic device is received while playing the first audio data sent by the first electronic device, and the audio data transmission request is used to request the sending of the second audio data, and the first information is used for the second electronic device to establish a connection with the first electronic device and send the second audio data to the first electronic device; and receive third audio data sent by the first electronic device, and the third audio data is audio data obtained after mixing the second audio data and the audio data to be sent by the first electronic device.

[0182] In a possible implementation, the first information may include first state information and device information of the first electronic device, wherein the first state information is used to indicate that the electronic device 1000 is playing the audio data of the first electronic device and the electronic device 1000 cannot process the second audio data at the same time.

[0183] In a possible implementation, the processor 1010 may be configured to play the third audio data after the RF unit 1001 receives the third audio data sent by the first electronic device and the first audio data is played.

[0184] In the electronic device provided in the embodiment of the present application, when a connection has been established with a first electronic device and audio data transmission is being performed, if an audio data transmission request sent by a second electronic device is received, the electronic device can first send a first message to the second electronic device, so that the second electronic device can establish a connection with the first electronic device and send the audio data originally requested to be sent to the electronic device to the first electronic device, and then can receive the audio data sent by the first electronic device after mixing the audio data and the audio data to be sent by the first electronic device. In this way, the electronic device can receive the audio data requested to be sent by the second electronic device through the first electronic device, which can avoid the second electronic device from occupying the audio channel of the first electronic device on the one hand, and mix and synchronize the audio data in the first electronic device on the other hand, so as to avoid conflicts in the audio data.

[0185] or,

[0186] The processor 1010 may be used to, when sending first audio data to the headphone device, establish a connection with the second electronic device if a connection establishment request sent by the second electronic device is received, and the connection establishment request is used to request to establish a connection with the electronic device 1000; and when receiving second audio data sent by the second electronic device, mix the second audio data with the audio data to be sent by the electronic device 1000 to obtain third audio data. The RF unit 1001 may be used to send the third audio data to the headphone device.

[0187] In one possible implementation, the processor 1010 can be specifically used to add a first identifier to the above-mentioned second audio data to obtain the second audio data after the identifier is added, and the first identifier is used to distinguish the second audio data from the above-mentioned audio data to be sent; and mix the second audio data after the identifier is added and the audio data to be sent to obtain the above-mentioned third audio data.

[0188] In a possible implementation, the radio frequency unit 1001 may also be configured to send a disconnection request to the second electronic device after sending the third audio data to the earphone device, where the disconnection request is used to request to disconnect the connection with the second electronic device.

[0189] In the electronic device provided in the embodiment of the present application, when the electronic device has established a connection with the headphone device and is transmitting audio data, the electronic device can establish a connection with the second electronic device after receiving a connection establishment request sent by the second electronic device, and after receiving the audio data sent by the second electronic device, mix the audio data with the audio data to be sent by the electronic device, and send the processed audio data to the headphone device. In this way, the audio data requested by the second electronic device to be sent to the headphone can be sent to the headphone device through the electronic device, which can avoid the second electronic device from occupying the audio channel of the electronic device on the one hand, and mix and synchronize the audio data in the electronic device on the other hand, so as to avoid conflicts in the audio data.

[0190] or,

[0191] Among them, the radio frequency unit 1001 can be used to send an audio data transmission request to the headphone device, and the audio data transmission request is used to request to send the second audio data; and when receiving the first information sent by the headphone device, send a connection establishment request to the first electronic device, and the connection establishment request is used to request to establish a connection with the first electronic device, and the first information is used for the electronic device 1000 to establish a connection with the first electronic device and send the second audio data to the first electronic device; and when the connection is established with the first electronic device, send the second audio data to the first electronic device.

[0192] In a possible implementation, the first information may include first status information and device information of the first electronic device, wherein the first status information is used to indicate that the earphone device is playing the audio data of the first electronic device and the earphone device cannot process the second audio data at the same time.

[0193] In one possible implementation, the processor 1010 may be configured to disconnect the connection with the first electronic device after the RF unit 1001 sends the second audio data to the first electronic device and, upon receiving a connection disconnection request sent by the first electronic device, the connection disconnection request being used to request disconnection with the electronic device 1000.

[0194] In the electronic device provided in the embodiment of the present application, when the electronic device requests to send audio data to the headphone device, the electronic device can receive the first information sent by the headphone device, then establish a connection with the first electronic device and send the audio data to the first electronic device, so that the first electronic device can mix the audio data and the audio data to be sent by the first electronic device, and send the processed audio data to the headphone device. In this way, the audio data requested by the electronic device to be sent to the headphone can be sent to the headphone device through the first electronic device, which can avoid the electronic device from occupying the audio channel of the first electronic device on the one hand, and mix and synchronize the audio data in the first electronic device on the other hand, so as to avoid conflicts in the audio data.

[0195] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0196] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0197] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.

[0198] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned audio data processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0199] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0200] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned audio data processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0201] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0202] An embodiment of the present application provides a computer program / program product, which is stored in a storage medium. The program / program product is executed by at least one processor to implement the various processes of the above-mentioned audio data processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0203] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0204] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0205] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. An audio data processing method, applied to a headphone device, characterized in that: The method comprises: In the case of playing the first audio data sent by the first electronic device, if an audio data transmission request sent by the second electronic device is received, first information is sent to the second electronic device, the audio data transmission request is used to request to send the second audio data, and the first information is used for the second electronic device to establish a connection with the first electronic device and send the second audio data to the first electronic device; The third audio data sent by the first electronic device is received, where the third audio data is audio data obtained by mixing the second audio data and the audio data to be sent by the first electronic device.

2. The method according to claim 1, characterized in that The first information includes first state information and device information of the first electronic device; The first status information is used to indicate that the earphone device is playing the audio data of the first electronic device, and the earphone device cannot process the second audio data at the same time.

3. The method according to claim 1 or 2, characterized in that: After receiving the third audio data sent by the first electronic device, the method further includes: When the playing of the first audio data is completed, the third audio data is played.

4. An audio data processing method, applied to a first electronic device, characterized in that: The method comprises: In the case of sending the first audio data to the headphone device, if a connection establishment request sent by a second electronic device is received, establishing a connection with the second electronic device, wherein the connection establishment request is used to request to establish a connection with the first electronic device; When receiving the second audio data sent by the second electronic device, mixing the second audio data and the audio data to be sent by the first electronic device to obtain third audio data; The third audio data is sent to the headphone device.

5. The method according to claim 4, characterized in that The mixing the second audio data and the audio data to be sent by the first electronic device to obtain the third audio data includes: adding a first identifier to the second audio data to obtain the second audio data after the identifier is added, wherein the first identifier is used to distinguish the second audio data from the audio data to be sent; The second audio data to which the identifier is added and the audio data to be sent are mixed to obtain the third audio data.

6. The method according to claim 4 or 5, characterized in that: After sending the third audio data to the headphone device, the method further includes: A connection disconnection request is sent to the second electronic device, where the connection disconnection request is used to request to disconnect the connection with the second electronic device.

7. An audio data processing method, applied to a second electronic device, characterized in that: The method comprises: Sending an audio data transmission request to the earphone device, where the audio data transmission request is used to request sending second audio data; When receiving the first information sent by the headphone device, sending a connection establishment request to the first electronic device, wherein the connection establishment request is used to request to establish a connection with the first electronic device, and the first information is used for the second electronic device to establish a connection with the first electronic device and send the second audio data to the first electronic device; When the connection with the first electronic device is established, the second audio data is sent to the first electronic device.

8. The method according to claim 7, characterized in that The first information includes first state information and device information of the first electronic device; The first status information is used to indicate that the earphone device is playing the audio data of the first electronic device, and the earphone device cannot process the second audio data at the same time.

9. The method according to claim 7 or 8, characterized in that: After sending the second audio data to the first electronic device, the method further includes: When receiving a disconnection request sent by the first electronic device, disconnecting the connection with the first electronic device is performed, wherein the disconnection request is used to request disconnection with the second electronic device.

10. An audio data processing device, characterized in that: The device comprises a first sending module and a receiving module; The first sending module is configured to send first information to a second electronic device if an audio data transmission request sent by a second electronic device is received while playing the first audio data sent by the first electronic device, wherein the audio data transmission request is used to request to send the second audio data, and the first information is used for the second electronic device to establish a connection with the first electronic device and send the second audio data to the first electronic device; The receiving module is used to receive third audio data sent by the first electronic device, where the third audio data is audio data obtained by mixing the second audio data and the audio data to be sent by the first electronic device.

11. An audio data processing device, characterized in that: The device comprises a connection establishing module, a processing module and a second sending module; The connection establishment module is used to establish a connection with the second electronic device if a connection establishment request sent by the second electronic device is received when sending the first audio data to the headphone device, wherein the connection establishment request is used to request to establish a connection with the first electronic device; The processing module is configured to, upon receiving the second audio data sent by the second electronic device, mix the second audio data with the audio data to be sent by the first electronic device to obtain third audio data; The second sending module is used to send the third audio data to the headphone device.

12. An audio data processing device, characterized in that: The device comprises a third sending module; The third sending module is configured to send an audio data transmission request to the headphone device, wherein the audio data transmission request is used to request to send the second audio data; and upon receiving the first information sent by the headphone device, send a connection establishment request to the first electronic device, wherein the connection establishment request is used to request to establish a connection with the first electronic device, and the first information is used for the second electronic device to establish a connection with the first electronic device and send the second audio data to the first electronic device; And when the connection with the first electronic device is established, the second audio data is sent to the first electronic device.