Audio sharing method and related equipment
By virtualizing multiple protocol stack processing modules in the smart terminal, copying and encoding audio data, the problem that multiple pairs of wireless headphones cannot independently adjust the volume and play different audio quality audio is achieved, and a high-quality audio sharing experience is achieved.
Patent Information
- Application Number
- CN202311386442.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-23
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2043-10-23
AI Technical Summary
The prior art cannot realize independent volume adjustment and audio sharing of multiple pairs of wireless headphones and different sound quality, resulting in poor audio sharing experience.
By virtualizing multiple protocol stack processing modules in the smart terminal, copying audio data and encoding according to the audio encoding format of each pair of wireless headphones, independent volume adjustment and different sound quality audio playback are realized.
It realizes independent volume adjustment and audio playback of multiple pairs of wireless headphones and improves the experience and effect of audio sharing.
Smart Images

Figure CN119922248A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and in particular to an audio sharing method and related equipment. Background Art
[0002] The development of wireless headphones has made it easier for people to enjoy audio. As wireless headphones are small and comfortable to wear, people can wear them for a long time in their daily lives so that they can enjoy audio at any time. However, currently, the same audio can only be listened to by one person through headphones. For example, if you want to share audio with a mobile phone as an audio output device, you can usually only share audio files between mobile phones or share a headset.
[0003] In order to achieve the connection between an audio output device and multiple headphones, an existing solution is to share audio between wireless headphones, where one wireless headset shares the received audio with another wireless headset. This solution does not support independent volume adjustment for each pair of wireless headphones, and the audio data needs to be encoded using an encoding method supported by all headphones. For headphones with different sound quality playback performance, it is unable to meet the different sound quality audio listening needs, and the audio sharing experience is relatively poor. Summary of the invention
[0004] In view of the above, it is necessary to provide an audio sharing method and related equipment, which can solve the problem that the audio data received by multiple pairs of headphones participating in audio sharing cannot be encoded independently.
[0005] In a first aspect, the present application provides an audio sharing method, which is applied to a smart terminal. The audio sharing method includes: copying audio data to be played to obtain first audio data corresponding to a first wireless headset and second audio data corresponding to a second wireless headset, wherein the smart terminal virtualizes a first protocol stack processing module corresponding to the first audio data and a second protocol stack processing module corresponding to the second audio data; using the first protocol stack processing module to encode the first audio data based on an audio coding format of the first wireless headset to obtain the encoded first audio data, and using the second protocol stack processing module to encode the second audio data based on the audio coding format of the second wireless headset to obtain the encoded second audio data; sending the encoded first audio data to the first wireless headset, and sending the encoded second audio data to the second wireless headset.
[0006] By adopting the above technical solution, the audio data is copied into multiple copies corresponding to multiple pairs of wireless headphones connected to the smart terminal, and multiple protocol stack processing modules (such as Bluetooth protocol stack processing module, Wi-Fi protocol stack processing module, etc.) are virtualized in the smart terminal to carry multiple channels of audio data. Multiple protocol stack processing modules can perform differentiated processing on each channel of audio data, and each copy of audio data can be processed with different forms of volume gain, and different audio encoding formats can be used. For example, the volume gain of the corresponding audio data can be adjusted according to the volume adjustment request of the connected wireless headset, or the sampling frequency and bit width of the corresponding audio data can be adjusted according to the sampling mode support capability of the connected wireless headset, so that each pair of wireless headphones can independently adjust the volume, and different audio encoding formats can be used to play audio with different sound quality.
[0007] In one possible implementation, the smart terminal communicates with the first wireless headset and the second wireless headset via Bluetooth to copy the audio data to be played, including: converting the audio data to be played into audio data in pulse code modulation (PCM) format, and mixing the audio data in PCM format; passing the mixed audio data in PCM format to the Bluetooth protocol stack via the audio hardware abstraction layer and the Bluetooth hardware abstraction layer; and using the Bluetooth protocol stack to copy the mixed audio data in PCM format.
[0008] By adopting the above technical solution, the audio data in PCM format after mixing is copied and processed through the Bluetooth protocol stack to obtain multiple copies of audio data of multiple wireless headphones connected to the corresponding smart terminal, which is convenient for subsequent volume gain adjustment, sampling frequency and bit width adjustment, and encoding using different audio coding formats in the Bluetooth protocol stack. Compared with copying audio data at other nodes, it can avoid transmitting multiple copies of audio data to the Bluetooth protocol stack, which occupies more data transmission resources.
[0009] In a possible implementation, the first protocol stack processing module is a first Bluetooth protocol stack processing module, and the second protocol stack processing module is a second Bluetooth protocol stack processing module. The first Bluetooth protocol stack processing module and the second Bluetooth protocol stack processing module are created in the Bluetooth protocol stack. The first Bluetooth protocol stack processing module and the second Bluetooth protocol stack processing module both include a Bluetooth protocol stack interface layer (Bluetooth interface layer, BTIF), a Bluetooth protocol stack application layer (Bluetooth application layer, BTA) and a Bluetooth protocol stack layer (Bluetooth stack layer, BTstack). The first protocol stack processing module is used to encode the first audio data based on the audio coding format of the first wireless headset to obtain the encoded first audio data, and the second protocol stack processing module is used to encode the second audio data based on the audio coding format of the second wireless headset to obtain the encoded second audio data, including: the first audio data is transmitted to the BT stack in the first Bluetooth protocol stack processing module via the BTIF and BTA in the first Bluetooth protocol stack processing module, and the BT in the first Bluetooth protocol stack processing module The stack encodes the first audio data based on the audio coding format of the first wireless headset; the second audio data is transmitted to the BT stack in the second Bluetooth protocol stack processing module via the BTIF and BTA in the second Bluetooth protocol stack processing module, and the BT stack in the second Bluetooth protocol stack processing module encodes the second audio data based on the audio coding format of the second wireless headset.
[0010] By adopting the above technical solution, by creating multiple Bluetooth protocol stack processing modules in the Bluetooth protocol stack, corresponding to multiple pairs of wireless headphones connected to the smart terminal, each Bluetooth protocol stack processing module can include BTIF, BTA and BT stack, so that each audio data can be processed by the corresponding Bluetooth protocol stack processing module, for example, encoded using different audio encoding formats, independently adjusting the volume gain, independently adjusting the sampling frequency and bit width, etc.
[0011] In one possible implementation, the BT stack in the first Bluetooth protocol stack processing module calls an audio encoder corresponding to the audio encoding format of the first wireless headset to encode the first audio data; the BT stack in the second Bluetooth protocol stack processing module calls an audio encoder corresponding to the audio encoding format of the second wireless headset to encode the second audio data.
[0012] By adopting the above technical solution, by creating multiple Bluetooth protocol stack processing modules in the Bluetooth protocol stack, corresponding to multiple pairs of wireless headphones connected to the smart terminal, when performing audio encoding processing, the BT stack in the Bluetooth protocol stack processing module can call the audio encoder corresponding to the audio encoding format of the wireless headphones to encode the audio data. For example, the BT stack in the first Bluetooth protocol stack processing module can call the SBC audio encoder to encode the audio data, and the BT stack in another Bluetooth protocol stack processing module can call the AAC audio encoder to encode the audio data, thereby realizing independent encoding of multiple audio data.
[0013] In a possible implementation, the first audio data is encoded using a first protocol stack processing module based on the audio coding format of the first wireless headset to obtain the encoded first audio data, and the second audio data is encoded using a second protocol stack processing module based on the audio coding format of the second wireless headset to obtain the encoded second audio data. Before the method further includes: performing volume gain adjustment and / or sound quality adjustment on the first audio data, the sound quality adjustment includes adjusting the sampling frequency and sampling bit width of the audio data; and performing volume gain adjustment and / or sound quality adjustment on the second audio data.
[0014] By adopting the above technical solution, before encoding the audio data, the Bluetooth protocol stack can also adjust the volume gain of the corresponding audio data, or adjust the sampling frequency and bit width of the corresponding audio data, so that each pair of wireless headphones can independently adjust the volume and play audio with different sound quality.
[0015] In one possible implementation, the volume gain adjustment and / or sound quality adjustment is performed on the first audio data, including: the BT stack in the first Bluetooth protocol stack processing module performs volume gain adjustment and / or sound quality adjustment on the first audio data; the volume gain adjustment and / or sound quality adjustment is performed on the second audio data, including: the BT stack in the second Bluetooth protocol stack processing module performs volume gain adjustment and / or sound quality adjustment on the second audio data.
[0016] By adopting the above technical solution, before the BT stack encodes the audio data, the volume gain of the corresponding audio data can be adjusted, or the sampling frequency and bit width of the corresponding audio data can be adjusted, so that each pair of wireless headphones can independently adjust the volume and play audio with different sound quality.
[0017] In a possible implementation, the smart terminal includes a first wireless connection network chip and a second wireless connection network chip, and the audio sharing method also includes: copying the audio data to be played to obtain third audio data corresponding to the third wireless headset, and the smart terminal also virtualizes a third protocol stack processing module corresponding to the third audio data; using the third protocol stack processing module to encode the third audio data based on the audio encoding format of the third wireless headset to obtain the encoded third audio data; sending the encoded third audio data to the third wireless headset through the second wireless connection network chip; sending the encoded first audio data to the first wireless headset, and sending the encoded second audio data to the second wireless headset, including: sending the encoded first audio data to the first wireless headset through the first wireless connection network chip, and sending the encoded second audio data to the second wireless headset through the first wireless connection network chip.
[0018] By adopting the above technical solution, the audio data is copied into multiple copies corresponding to multiple pairs of wireless headphones connected to the smart terminal, and multiple protocol stack processing modules are virtualized in the smart terminal to carry multiple channels of audio data. The multiple protocol stack processing modules can perform different forms of processing on each audio data, and can adopt different audio encoding formats. The wireless connection network chip generally supports the transmission of one or two channels of audio data. In the case where the smart terminal includes multiple wireless connection network chips, for two channels of audio data, only one wireless connection network chip can be used to transmit the audio data, and the remaining wireless connection network chips are in a dormant state, which can save power of the smart terminal. When the smart terminal is connected to the third pair of wireless headphones, another wireless connection network chip can be enabled to transmit the audio data, so that each channel of audio data can be transmitted to the corresponding wireless headphones.
[0019] In a possible implementation, the first wireless headset, the second wireless headset and the third wireless headset are wireless headsets that support the advanced audio distribution profile (A2DP) protocol and / or the low-power Bluetooth audio standard (LE Audio) protocol of the new generation Bluetooth technology standard.
[0020] Using the above technical solution, multiple pairs of wireless headphones for audio sharing can be wireless headphones that support the A2DP protocol and / or the LE Audio protocol, for example, multiple wireless headphones that support the A2DP protocol, multiple wireless headphones that support the LE Audio (LE Audio unicast / LE Audio broadcast) protocol, or one or more wireless headphones that support the A2DP protocol and one or more wireless headphones that support the LE Audio protocol.
[0021] In a possible implementation, the smart terminal includes a first wireless connection network chip and a second wireless connection network chip, the chip capability of the first wireless connection network chip is stronger than that of the second wireless connection network chip, the data volume of the encoded first audio data is greater than the data volume of the encoded second audio data, and sending the encoded first audio data to the first wireless headset and sending the encoded second audio data to the second wireless headset include: sending the encoded first audio data to the first wireless headset through the first wireless connection network chip, and sending the encoded second audio data to the second wireless headset through the second wireless connection network chip.
[0022] By adopting the above technical solution, for two channels of audio data using different audio encoding formats, if the data volume of the encoded first audio data is greater than the data volume of the encoded second audio data, packet loss or delay may occur when the two channels of audio data are transmitted through a wireless connection network chip. By enabling two wireless connection network chips to transmit the two channels of audio data, the audio transmission delay can be reduced and the audio playback delay can be avoided.
[0023] In a second aspect, the present application provides a smart terminal, which includes a memory and a processor; the memory and the processor are coupled; the memory is used to store program instructions; the processor is used to read the program instructions stored in the memory to implement the audio sharing method of the first aspect above.
[0024] In a third aspect, the present application provides a computer-readable storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the audio sharing method of the first aspect is implemented.
[0025] In a fourth aspect, the present application provides a chip coupled to a memory in a smart terminal, and the chip is used to control the smart terminal to implement the audio sharing method of the first aspect.
[0026] In addition, the technical effects brought about by the second to fourth aspects can be found in the descriptions related to the methods of each design in the above method part, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A schematic diagram of a process flow of processing Bluetooth audio data on a mobile phone provided in an embodiment of the present application;
[0028] Figure 2 A schematic diagram of a system architecture applicable to the audio synchronization method provided in an embodiment of the present application;
[0029] Figure 3A schematic diagram of a process of transmitting an audio data stream of a smart terminal to two wireless headphones according to an embodiment of the present application;
[0030] Figure 4a A schematic diagram of an architecture for a smart terminal according to an embodiment of the present application to implement Bluetooth communication with multiple pairs of wireless headsets;
[0031] Figure 4b for Figure 4a A data processing flow chart of the audio processing module of the intelligent terminal;
[0032] Figure 5a A schematic diagram of an architecture for adjusting volume after a smart terminal is connected to a wireless headset according to an embodiment of the present application;
[0033] Figure 5b A schematic diagram of an architecture for adjusting volume after a smart terminal is connected to a wireless headset according to another embodiment of the present application;
[0034] Figure 6a-6b A schematic diagram of a Bluetooth protocol stack of a smart terminal provided in an embodiment of the present application virtualizing a corresponding number of Bluetooth protocol stack processing modules based on the number of connected wireless headsets;
[0035] Figure 7 A schematic diagram of a Bluetooth protocol stack of a smart terminal for controlling volume, sound quality, and wireless connection network according to an embodiment of the present application;
[0036] Figure 8 A flowchart of an audio sharing method provided in one embodiment of the present application;
[0037] Fig. 9 This is a hardware architecture diagram of a smart terminal provided in one embodiment of the present application;
[0038] Fig.10 This is a hardware architecture diagram of a wireless headset provided in one embodiment of the present application. DETAILED DESCRIPTION
[0039] The following will describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0040] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, words such as "exemplary", "or", "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "or", "for example" is intended to present related concepts in a concrete way.
[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field of the present application. The terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. It should be understood that, unless otherwise specified in the present application, " / " means or. For example, A / B can represent A or B. "And / or" in the present application is only a kind of association relationship describing associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. "Multiple" means two or more than two. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c seven situations. It should be understood that the order of the steps shown in the flowchart of this article can be changed, and some can also be omitted.
[0042] The module referred to in the embodiments of the present application may refer to a series of computer program instruction segments that can perform specific functions, or it may be a functional module formed by the cooperation of computer program instruction segments and hardware. The division of modules is a logical function division, and there may be other division methods in actual implementation, which is not limited in the present application.
[0043] Usually, the same audio channel can only be played through one pair of headphones. For example, a mobile phone can only be connected to one pair of wireless headphones. Figure 1 As shown, taking the wireless headset as a Bluetooth headset as an example, in the related art, the process of processing audio data by a mobile phone and transmitting it to the Bluetooth headset may include:
[0044] (1) Use audio processing algorithms to process the audio data of the application.
[0045] Processing the audio data may include converting the audio data into audio data in PCM format, and performing noise reduction, mixing processing, etc. on the audio data in PCM format. The mixing processing may include subwoofer processing, surround sound processing, equalizer processing, reverberation processing, etc.
[0046] (2) Perform volume processing on the mixed audio data.
[0047] The volume processing can be achieved by adjusting the volume gain of the audio data in the PCM format, for example, performing a 100% volume gain adjustment on the audio data in the PCM format.
[0048] (3) The audio data after volume processing is transmitted to the Bluetooth hardware abstraction layer (BT HAL) through the audio hardware abstraction layer (Audio HAL).
[0049] (4) The audio data after volume processing is transmitted to the Bluetooth interface layer (BTIF) of the Bluetooth protocol stack via the BT HAL, and then transmitted from the Bluetooth application layer (BTA) to the Bluetooth stack layer (BT stack) of the Bluetooth protocol stack.
[0050] (5) The BT stack encodes and splits the audio data and sends it to the left and right earphones of the Bluetooth headset for playback.
[0051] For example, the BT stack may include an encoding module, a shunting module and a sending module. The encoding module is used to encode the audio data, for example, using a sub-band codec (SBC) method to encode the audio data after volume processing. The shunting module is used to shunt the encoded audio data into a first stream data and a second stream data, the first stream data corresponding to the left earphone of the Bluetooth headset, and the second stream data corresponding to the right earphone of the Bluetooth headset. The sending module is used to send the first stream data to the left earphone of the Bluetooth headset so that the left earphone of the Bluetooth headset plays the first stream data, and send the second stream data to the right earphone of the Bluetooth headset so that the right earphone of the Bluetooth headset plays the second stream data.
[0052] The above process can only realize the audio data transmission of one pair of headphones, which cannot meet the needs of users to share audio while wearing headphones. In order to solve this problem, mobile phone manufacturers have developed audio sharing solutions, but the relevant audio sharing solutions have the following defects: the audio sharing solutions developed by some mobile phone manufacturers only support their own wireless headphones, and the number of headphones is limited to two pairs, and the two headphones output audio of the same sound quality. Although the audio sharing solutions developed by other mobile phone manufacturers support third-party wireless headphones, the third-party wireless headphones cannot adjust the volume independently, and the number of headphones is also limited to two pairs, and the two headphones output audio of the same sound quality.
[0053] In view of this, the audio sharing method provided in the embodiment of the present application copies the audio data in PCM format into multiple copies through the Bluetooth protocol stack, corresponding to the multiple pairs of wireless headphones connected to the smart terminal, and virtually creates a Bluetooth protocol stack processing module in the Bluetooth protocol stack that corresponds one-to-one to the multiple pairs of wireless headphones. Each copy of the audio data is processed differently by each Bluetooth protocol stack processing module, so that each wireless headset can independently adjust the volume, use different audio encoding formats, and play audio of different sound quality.
[0054] like Figure 2 , which is a schematic diagram of a system architecture applicable to an audio synchronization method provided in an embodiment of the present application. The system architecture may include a smart terminal 100 and two or more wireless headsets 200.
[0055] The intelligent terminal 100 may be a plurality of types of intelligent terminals. For example, it may be Figure 2 The smart phone shown may also be a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a personal digital assistant (PDA), a smart TV, a smart watch, a vehicle-mounted device, an industrial device, etc. This application does not limit the specific type of the smart terminal. The wireless headset 200 is a headset that supports the Bluetooth communication protocol. Among them, the Bluetooth communication protocol may be a classic Bluetooth (BT) protocol, a low energy (BLE) Bluetooth protocol (such as a low energy Bluetooth audio standard (LE Audio) including the new generation Bluetooth technology standard BT5.2. With the evolution of the Bluetooth protocol, it may also be other Bluetooth protocols that will be launched in the future.
[0056] In some embodiments, the smart terminal 100 can establish a connection with each pair of wireless headphones 200 through wireless communication technology. The wireless communication technology can be, for example, Bluetooth technology (including classic Bluetooth or low-power BLE Bluetooth). Optionally, the smart terminal 100 and the wireless headset 200 can also communicate through wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Zig bee, frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), or general 2.4G / 5G frequency band wireless communication technology. The wireless connection is a connection established by the wireless communication technology. For ease of description, the following embodiments of the present application are introduced as an example of the smart terminal 100 and the wireless headset 200 establishing a Bluetooth connection through Bluetooth technology.
[0057] There may be audio services between the smart terminal 100 and each pair of wireless headphones 200 with which a Bluetooth connection is established, and the audio services may include multiple types. Exemplarily, the audio services may include media services and call services, etc. Among them, the media services may include playing music, recordings, sounds in video files, background music in games, call prompts, and other audio services for users. The call service may include playing the voice data of the other end for the user in scenarios such as phone calls, WeChat voice messages, audio calls, video calls, games, voice assistants, etc., or collecting the user's voice data and sending it to the other end.
[0058] In some embodiments, the wireless headset 200 may be of various types, such as earbud type, in-ear type, head-mounted type, earmuff type, or ear-hanging type wireless headset. The wireless headset may include a left earbud worn on the left ear of the user and a right earbud worn on the right ear of the user, and the left and right earbuds may be connected by a connecting line, such as a neckband type wireless headset; or they may be two independent parts, such as a true wireless stereo (TWS) headset. The specific type of the headset is not limited in the embodiments of the present application.
[0059] like Figure 3 As shown, a schematic diagram of a process of transmitting an audio data stream from a smart terminal 100 to a wireless headset 200 provided in an embodiment of the present application.
[0060] exist Figure 3In the example, the smart terminal 100 is a mobile phone, and the wireless headset 200 includes a first wireless headset and a second wireless headset. The mobile phone is installed with one or more applications (Application, APP). Assuming that the mobile phone is installed with a music application, the mobile phone can respond to user operations, open the music application and play music. During music playback, the process of transmitting the audio data stream from the smart terminal 100 to the first wireless headset and the second wireless headset may include:
[0061] (1) The music application writes audio data to the audio track.
[0062] An application at the application layer can construct an Audio track instance at the application framework layer, that is, one application can correspond to one Audio track. After constructing an Audio track, a music application can write audio data to the corresponding Audio track and implement audio playback control through the Audio track.
[0063] (2) The Audio track outputs the decoded audio data to the audio system engine (Audio Flinger).
[0064] The decoded audio data may refer to audio data in PCM format. Audio Flinger is responsible for managing the devices for inputting audio streams, the devices for outputting audio streams, as well as the switching of audio modes, the loading of audio parameters, the processing and transmission of audio data, etc. When an application outputs an audio stream, the audio data included in the audio stream can be identified as a certain stream type, and the decoded audio data is output to Audio Flinger through the Audio track corresponding to the application. Audio Flinger can load the volume corresponding to the audio stream type based on the audio stream type. Audio Flinger can also mix the audio data and output the mixed audio data to Audio HAL.
[0065] (3) Audio Flinger outputs the mixed audio data to Audio HAL.
[0066] Audio HAL can receive mixed audio data and select the audio hardware device for output. For example, the audio hardware device can be the speaker, receiver, and other audio playback devices connected to the phone (for example, headphones, speakers, etc.). Figure 2 In the example, since the mobile phone has established a Bluetooth connection with the first wireless headset and the second wireless headset, the Audio HAL selects the first wireless headset and the second wireless headset as the audio hardware devices for output.
[0067] (4) Audio HAL passes the mixed audio data to BT HAL.
[0068] After the Audio HAL determines that the audio hardware devices are the first wireless headset and the second wireless headset, the Audio HAL can pass the mixed audio data to the BT HAL, so that the audio data can be passed to the first wireless headset and the second wireless headset for playback through the Bluetooth chip in the mobile phone. The Bluetooth chip can convert the audio data into data packets that comply with the Bluetooth protocol and send them to the wireless headset. In actual applications, the Bluetooth chip may be packaged into the same chip as the Wi-Fi module, FM module, and global positioning system (GPS) module. The chip can be called a wireless connectivity network (WCN) chip, which is not limited in the embodiments of the present application.
[0069] (5) BT HAL passes the mixed audio data to the Bluetooth protocol stack.
[0070] (6) The Bluetooth protocol stack copies the mixed audio data to obtain first audio data corresponding to the first wireless headset and second audio data corresponding to the second wireless headset.
[0071] In some embodiments, the mixed audio data can be copied and processed through the Bluetooth protocol stack to obtain two copies of the mixed audio data (for ease of distinction, this embodiment refers to the first audio data and the second audio data), the first audio data corresponds to the first wireless headset, and the second audio data corresponds to the second wireless headset.
[0072] The Bluetooth protocol stack can be used to adjust the volume gain and sound quality of the first audio data and the second audio data respectively (adjust the sampling frequency and sampling bit width of the audio data), so that the first wireless headset and the second wireless headset can independently adjust the volume and play audio with different sound qualities. For example, the Bluetooth protocol stack can adjust the sound quality of the audio data (the first audio data and the second audio data) based on the sampling mode support capability of the wireless headset (the first wireless headset and the second wireless headset), and adjust the volume gain of the audio data (the first audio data and the second audio data) based on the volume adjustment instruction sent by the wireless headset (the first wireless headset and the second wireless headset).
[0073] (7) The Bluetooth protocol stack encodes the first audio data to obtain a first compressed data packet, and encodes the second audio data to obtain a second compressed data packet.
[0074] For example, the Bluetooth protocol stack may encode the first audio data and the second audio data according to a specified Bluetooth encoding method to obtain a first compressed data packet and a second compressed data packet. The Bluetooth encoding method corresponding to the audio data may be determined based on the sampling frequency and sampling bit width of the audio data, or may be specified by an upper-layer application (for example, the Bluetooth protocol stack receives an encoding specification instruction from an application at the application layer and selects a corresponding Bluetooth encoding method). If the first audio data and the second audio data have different sampling frequencies and sampling bit widths, the Bluetooth protocol stack may encode the first audio data and the second audio data respectively according to different Bluetooth encoding methods.
[0075] Bluetooth coding methods may include SBC, advanced audio coding (AAC), lossless transmission technology coding (APTX), etc.
[0076] (8) The Bluetooth protocol stack encapsulates the encoded first compressed data packet and the second compressed data packet.
[0077] The Bluetooth protocol stack can encapsulate the encoded first compressed data packet and the second compressed data packet through the advanced audio distribution profile (A2DP) or LE Audio. For wireless headphones that only support A2DP, the compressed data packet is encapsulated based on A2DP. For wireless headphones that support A2DP and LE Audio, the compressed data packet can be encapsulated based on A2DP or LE Audio.
[0078] (9) The Bluetooth protocol stack transmits the encapsulated first compressed data packet and the second compressed data packet to the first Bluetooth chip (located on the mobile phone side).
[0079] (10) The first Bluetooth chip converts the encapsulated first compressed data packet into first digital audio data through Bluetooth radio frequency (RF) communication and sends it to the second Bluetooth chip (located on the first wireless headset side), and converts the encapsulated second compressed data packet into second digital audio data through Bluetooth RF and sends it to the third Bluetooth chip (located on the second wireless headset side).
[0080] (11) The second Bluetooth chip receives the first digital audio data sent by the first Bluetooth chip, and the third Bluetooth chip receives the second digital audio data sent by the first Bluetooth chip.
[0081] (12) The Bluetooth host protocol stack (also referred to as BT Host) of the first wireless headset converts the first digital audio data into a first Bluetooth data packet, and decapsulates the first Bluetooth data packet to obtain a first compressed data packet; the BT Host of the second wireless headset converts the second digital audio data into a second Bluetooth data packet, and decapsulates the second Bluetooth data packet to obtain a second compressed data packet.
[0082] On the mobile phone side, if the first compressed data packet is encapsulated based on A2DP, the first wireless headset can decapsulate the first Bluetooth data packet based on A2DP; if the second compressed data packet is encapsulated based on LE Audio, the second wireless headset can decapsulate the second Bluetooth data packet based on LE Audio.
[0083] (13) The audio processing module (also referred to as the audio processing module) of the first wireless headset decodes the first compressed data packet to obtain first audio data, and the audio processing module of the second wireless headset decodes the second compressed data packet to obtain second audio data.
[0084] (14) The audio codec (also referred to as Audio codec) of the first wireless headset converts the first audio data into a first analog audio signal, and the audio codec of the second wireless headset converts the second audio data into a second analog audio signal.
[0085] The first audio data and the second audio data are digital audio signals. For example, the first audio data and the second audio data are audio data in PCM format. Digital-to-analog conversion is performed through an audio codec to obtain analog audio signals, which is convenient for subsequently driving the audio playback component to play sound.
[0086] (15) The audio playback component of the first wireless headset converts the first analog audio signal into a sound signal for playback, and the audio playback component of the second wireless headset converts the second analog audio signal into a sound signal for playback.
[0087] The audio playback component may refer to a speaker component in a wireless headset, which is used to convert an analog audio signal into a sound signal and play it.
[0088] Commonly used WCN chips generally support the transmission and processing of up to two channels of encoded audio signals. If the smart terminal 100 is equipped with a WCN chip that supports the transmission and processing of more than two channels of encoded audio signals, or is equipped with two or more WCN chips, the smart terminal 100 can also establish a Bluetooth connection with more than two wireless headsets 200.
[0089] After the smart terminal 100 establishes a Bluetooth connection with multiple pairs of wireless headphones 200, on the smart terminal side, the audio data flowing through BTHAL can be copied into multiple copies by the Bluetooth protocol stack, each copy of the audio data corresponds to a different wireless headset, and each copy of the audio data can be processed in a different way for wireless headsets of different capabilities, for example, using different Bluetooth encoding methods, or making different adjustments to the sampling frequency, sampling bit width, and volume gain of the audio data.
[0090] The multiple pairs of wireless headphones 200 may be multiple wireless headphones supporting the A2DP protocol, multiple wireless headphones supporting the LE Audio (LE Audio unicast / LE Audio broadcast) protocol, or one or more wireless headphones supporting the A2DP protocol and one or more wireless headphones supporting the LE Audio protocol. LE Audio unicast may refer to a point-to-point connection based on the LE Audio protocol, and LE Audio broadcast may refer to a point-to-multipoint connection based on the LE Audio protocol.
[0091] like Figure 4a , which is a schematic diagram of the architecture of the smart terminal provided in an embodiment of the present application to implement Bluetooth communication with multiple pairs of wireless headsets.
[0092] exist Figure 4a In the example, the smart terminal establishes a Bluetooth connection with four pairs of wireless headphones. The smart terminal includes two WCN chips, and each WCN chip is used to transmit two channels of Bluetooth audio data, that is, each WCN chip communicates with two pairs of wireless headphones via Bluetooth respectively. Take the example that the smart terminal is installed with a music application, and four pairs of wireless headphones play the music of the music application at the same time. Assume that the audio coding formats corresponding to the four pairs of wireless headphones are SBC format, AAC format, Low Complexity Communications Codec (LC3) format and LC3 plus format, respectively, of which SBC format and AAC format belong to the coding format of A2DP, LC3 format belongs to the coding format of LE Audio unicast, and LC3plus format belongs to the coding format of LE Audio broadcast. The process of a smart terminal realizing Bluetooth communication with multiple pairs of wireless headphones may include:
[0093] (i) In response to a user operation, a music application is opened and a song is selected for playing.
[0094] (ii) The audio processing module (also referred to as the Audio processing module) processes the third audio data written by the music application to obtain fourth audio data.
[0095] In the operating system of smart terminals, the introduction of audio focus can avoid the confusion caused by the simultaneous playback of audio data from multiple applications. That is, only one application can obtain the audio focus at a time. When an application needs to output audio, it needs to request the audio focus first. Before playing a song, a music application can request the audio focus, such as Figure 4b As shown, the audio processing module of the smart terminal can first determine the application that obtains the audio focus, and then process the audio data written by the application that obtains the audio focus. The audio processing module processes the third audio data written by the music application, which may include setting an audio route, decoding the third audio data into audio data in PCM format, mixing the audio data in PCM format, etc., to obtain fourth audio data. By setting the audio route, the third audio data written by the music application can be transmitted to the specified audio hardware device for playback.
[0096] In some embodiments, the audio processing module may include a media player (Media Player), Audiotrack and Audio Flinger. If the third audio data written by the music application is not audio data in PCM format, Media Player may create an audio decoder corresponding to the third audio data, and decode the third audio data into audio data in PCM format through the audio decoder. The audio data in PCM format is then passed to Audio Flinger by Audio track, and Audio Flinger performs mixing processing on the audio data in PCM format. If the third audio data written by the music application is audio data in PCM format, it can be directly passed to Audio Flinger by Audio track for mixing processing.
[0097] (iii) The audio processing module transmits the fourth audio data to the Audio HAL.
[0098] (iv) The Audio HAL passes the fourth audio data to the BT HAL.
[0099] (v) The BT HAL passes the fourth audio data to the Bluetooth protocol stack.
[0100] (vi) The Bluetooth protocol stack copies the fourth audio data to obtain four copies of the fourth audio data corresponding to the four pairs of wireless headphones, and processes the four copies of the fourth audio data respectively.
[0101] In some embodiments, the Bluetooth protocol stack can perform different sound quality processing on each audio data according to the different audio playback capabilities of the four wireless headphones, for example, by adjusting the sampling frequency and sampling bit width of the audio data to achieve sound quality adjustment. The Bluetooth protocol stack can also adjust the volume gain of the corresponding fourth audio data according to the volume adjustment instruction of each pair of wireless headphones.
[0102] In some embodiments, the existing Bluetooth protocol stack code can be improved, and four Bluetooth protocol stack processing modules can be virtualized in the Bluetooth protocol stack. As an example, each Bluetooth protocol stack processing module includes a BTIF, a BTA and a BT stack, and each fourth audio data can be transmitted to the corresponding BT stack through the corresponding BTIF and the corresponding BTA, and encoded by the encoding module of the BT stack. Figure 4a As shown, assuming that the audio coding formats corresponding to the four pairs of wireless headphones are SBC format, AAC format, LC3 format and LC3 plus format, and the corresponding coding modules are SBC coding module, AAC coding module, LC3 coding module and LC3 plus coding module, respectively. By virtualizing four Bluetooth protocol stack processing modules in the Bluetooth protocol stack, the SBC coding module, AAC coding module, LC3 coding module and LC3 plus coding module can perform audio data encoding in parallel.
[0103] In some embodiments, for wireless headphones that support absolute volume, the currently set different volumes and the user adjusting the volume during the use of the wireless headphones can be sent by the smart terminal to the wireless headset side through a standard audio / video remote control protocol (Audio / Video Remote Control Profile, AVRCP) instruction for volume adjustment. For wireless headphones that support non-absolute volume, the currently set different volumes and the user adjusting the volume during the use of the wireless headphones can be adjusted by the BT stack in the Bluetooth protocol stack for the volume gain of the fourth audio data, and after the volume gain adjustment is completed, it is encoded by the encoding module.
[0104] For wireless headphones with different sound quality playback requirements, the BT stack in the Bluetooth protocol stack can also adjust the sampling frequency and sampling bit width of the fourth audio data. After the adjustment is completed, the fourth audio data is encoded by the encoding module.
[0105] In some embodiments, the BIF in the Bluetooth protocol stack may also be configured to adjust the volume gain, sampling frequency, and sampling bit width of the audio data.
[0106] (vii) The four processed fourth audio data are transmitted to four pairs of wireless headphones via two WCN chips.
[0107] For example, the fourth audio data output by the SBC encoding module and the AAC encoding module can be transmitted to two pairs of wireless headphones via a WCN chip, and the fourth audio data output by the LC3 encoding module and the LC3 plus encoding module can be transmitted to another two pairs of wireless headphones via another WCN chip.
[0108] In some embodiments, if the smart terminal includes multiple WCN chips, the audio data transmitted by the WCN chips can be set according to the performance differences of the WCN chips. For WCN chips with stronger performance, they are preferentially used to transmit audio data with larger encoded data volume.
[0109] Combine the following Figure 5a and 5b A schematic diagram of an architecture for adjusting the volume of a smart terminal connected to a wireless headset is provided.
[0110] For wireless headsets that support absolute volume, that is, the wireless headsets support volume synchronization with the smart terminal side, taking the smart terminal as a mobile phone as an example, there is an option of "Bluetooth device volume is synchronized with the mobile phone" in the Bluetooth headset setting interface on the mobile phone side. When the "Bluetooth device volume is synchronized with the mobile phone" option is turned on, when the user adjusts the volume (non-mute volume) on the mobile phone side, the mobile phone side does not adjust the volume, and the volume level of the audio data on the mobile phone side is fixed at level 15. The mobile phone side sends the volume adjustment instruction (the volume level is generally 1 to 15 levels) to the wireless headset, and the wireless headset adjusts the volume based on the received volume adjustment instruction. When the user adjusts the volume to mute volume (level 0 volume) on the mobile phone side, the mobile phone side mutes the audio data at level 0, and the wireless headset receives audio data at level 0 mute.
[0111] like Figure 5a As shown, on the mobile phone side, the audio file on the mobile phone side (for example, the audio format is moving picture experts group audio layer-3 (MP3), AAC, etc.) is decoded into audio data in PCM format by an audio decoder, and the audio data in PCM format is processed according to the maximum volume gain (15 levels), and then mixed, and the mixed audio data is encoded by a coding module (for example, the audio data is encoded using an SBC coding module), and the encoded audio data is sent to the wireless headset via the Bluetooth chip.
[0112] On the wireless headset side, the Bluetooth chip receives the encoded audio data, and the encoded audio data is decoded by the decoding module to obtain audio data in PCM format. The audio data in PCM format can be adjusted for volume gain in different proportions (for example, adjustment of 1 to 15 levels) based on the volume adjustment instruction sent by the mobile phone side. The audio data after volume gain adjustment is then mixed, and the mixed audio data is converted into an analog audio signal through an audio decoder to drive the audio playback component of the wireless headset for playback.
[0113] For wireless headsets that support absolute volume, but the "Synchronize Bluetooth device volume with phone" option on the phone is turned off, when the user adjusts the volume through the phone, the phone adjusts the volume gain of the PCM format audio data, and the volume level of the wireless headset is fixed at 15.
[0114] like Figure 5b As shown, on the mobile phone side, the audio file on the mobile phone side is decoded into audio data in PCM format by an audio decoder, and the audio data in PCM format is adjusted for volume gain in different proportions based on the volume adjustment instruction, and then mixed. The mixed audio data is encoded by the encoding module, and the encoded audio data is sent to the wireless headset via the Bluetooth chip.
[0115] On the wireless headset side, the Bluetooth chip receives the encoded audio data, which is decoded by the decoding module to obtain audio data in PCM format. The audio data in PCM format is processed according to the maximum volume gain (15 levels). The audio data after volume gain processing is then mixed. The mixed audio data is converted into an analog audio signal through an audio decoder to drive the audio playback component of the wireless headset for playback.
[0116] For wireless headsets that support non-absolute volume, the volume adjustment process is the same as that for wireless headsets that support absolute volume but the "Bluetooth device volume synchronization with mobile phone" option on the mobile phone side is turned off. That is, when the user adjusts the volume on the mobile phone side, the mobile phone side adjusts the volume gain of the PCM format audio data, and the wireless headset side is fixed at a volume level of 15.
[0117] Since the WCN chip generally supports the transmission and processing of two channels of encoded audio signals at most, when the smart terminal includes multiple WCN chips, if the smart terminal is connected to one or two pairs of wireless headphones, the smart terminal can use only one WCN chip to transmit and process the encoded audio signals, and the remaining WCN chips can be in a dormant state. As the number of wireless headphones connected increases, or the amount of data of the encoded audio signals to be transmitted and processed increases, the remaining one or more WCN chips are enabled. Assume that the smart terminal includes two WCNs. If the smart terminal is connected to one or two pairs of wireless headphones, the smart terminal can use only one WCN chip to transmit and process the encoded audio signals, and the other WCN chip is in a dormant state. When three or four pairs of wireless headphones are connected, two WCN chips are used to transmit and process the encoded audio signals.
[0118] like Figure 6a and 6b As shown in FIG. 1 , it is shown that the Bluetooth protocol stack can virtualize a corresponding number of Bluetooth protocol stack processing modules according to the number of wireless headphones connected to the smart terminal, and can selectively enable one or more WCN chips to perform audio data transmission processing. Figure 6a As shown, it is assumed that the smart terminal establishes a Bluetooth connection with the first wireless headset and the second wireless headset at the first moment, the first wireless headset plays audio data in SBC format, and the second wireless headset plays audio data in AAC format. The audio data after passing through the BT HAL is copied into two copies by the Bluetooth protocol stack and transmitted to a BT stack for encoding through a BTIF and a BTA respectively. The BT stack of the first audio data uses an SBC encoding module to encode, and the BT stack of the second audio data uses an AAC encoding module to encode. The encoded first audio data is sent to the first wireless headset via the first WCN chip, and the encoded second audio data is sent to the second wireless headset via the first WCN chip. Figure 6b As shown, at a second moment after the first moment, the smart terminal also establishes a Bluetooth connection with the third wireless headset, and the second wireless headset plays audio data in AAC format. The audio data after passing through the BT HAL is copied into three copies by the Bluetooth protocol stack, and is respectively transmitted to a BT stack for encoding through a BTIF and a BTA. The BT stack of the first audio data uses an SBC encoding module to encode, the BT stack of the second audio data uses an AAC encoding module to encode, and the BT stack of the third audio data uses an AAC encoding module to encode. The encoded first audio data is sent to the first wireless headset via the first WCN chip, the encoded second audio data is sent to the second wireless headset via the first WCN chip, and the encoded third audio data is sent to the second wireless headset via the second WCN chip.
[0119] In some implementations, since different Bluetooth encoding methods encode different amounts of data, when the smart terminal includes multiple WCN chips, in order to quickly transmit audio data from the smart terminal to the wireless headset and avoid transmission packet loss, the smart terminal can also select and switch the WCN chip according to the Bluetooth encoding format of the wireless headset to which it is connected. For example, the smart terminal is connected to a pair of wireless headsets. If the data volume of the Bluetooth encoding format of the pair of wireless headsets is relatively small (for example, SBC format), the smart terminal can enable a relatively low-performance WCN chip (relatively low power consumption) among multiple WCN chips to perform transmission processing of the encoded audio signal. If the data volume of the Bluetooth encoding format of the pair of wireless headsets is large (for example, APTX), the smart terminal can enable a relatively high-performance WCN chip (for transmission processing of the encoded audio signal) among multiple WCN chips.
[0120] For example, the smart terminal is connected to two pairs of wireless headphones. If the data volume of the Bluetooth encoding format of the two pairs of wireless headphones is relatively small, one WCN chip among the multiple WCN chips can be enabled to perform transmission processing of the encoded audio signal. If the data volume of the Bluetooth encoding format of one pair of wireless headphones is relatively small and the data volume of the Bluetooth encoding format of the other pair of wireless headphones is relatively large, two WCN chips among the multiple WCN chips can be enabled to perform transmission processing of the encoded audio signal respectively.
[0121] For example, the smart terminal is connected to three pairs of wireless headphones. If the data volume of the Bluetooth encoding format of two pairs of wireless headphones is relatively small, and the data volume of the Bluetooth encoding format of the other pair of wireless headphones is relatively large, one of the multiple WCN chips can be enabled to perform transmission processing of the two audio signals with smaller encoding data volumes, and another WCN chip can be enabled to perform transmission processing of the audio signal with larger encoding data volumes.
[0122] In some embodiments, the selection and switching logic of the WCN chip can be pre-configured in the Audio HAL or the Bluetooth protocol stack.
[0123] like Figure 7 As described above, taking the selection and switching logic of the WCN chip pre-configured in the Bluetooth protocol stack as an example, the Bluetooth protocol stack can select and enable one or more WCN chips to perform transmission processing of audio signals according to the number of wireless headphones currently connected. For example, when the number of wireless headphones currently connected is less than or equal to two pairs, one WCN chip is enabled to perform transmission processing of audio signals, and when the number of wireless headphones currently connected is three pairs, two WCN chips are enabled to perform transmission processing of audio signals.
[0124] The Bluetooth protocol stack receives the audio data transmitted by the BT HAL. The Bluetooth protocol stack can copy the audio data according to the number of wireless headsets currently connected to the smart terminal to obtain audio data corresponding to each pair of wireless headsets, so as to facilitate the subsequent differentiated processing of each audio data, so that each pair of wireless headsets can independently adjust the volume and play audio data of different sound quality.
[0125] For example, the Bluetooth protocol stack can perform volume gain processing on the audio data corresponding to a Bluetooth headset according to the volume adjustment instruction sent by the Bluetooth headset. The Bluetooth protocol stack can also use different encoding modules to encode audio data or adjust the sampling frequency and sampling bit width of audio data when the smart terminal establishes a Bluetooth connection with a Bluetooth headset or when the Bluetooth headset is in use.
[0126] For example, when a smart terminal establishes a Bluetooth connection with multiple Bluetooth headsets, the Bluetooth protocol stack can select the corresponding encoding module to encode the audio data according to the default audio encoding format of each wireless headset (such as SBC format, AAC format, LC3 format, etc.), and adjust the sampling frequency and sampling bit width of the audio data according to the sampling mode support capabilities of each wireless headset.
[0127] For example, when using a Bluetooth headset, if a Bluetooth headset supports multiple audio playback formats, the user can adjust the audio encoding format of the audio data sent to the Bluetooth headset in the Bluetooth headset setting interface on the smart terminal side, and the Bluetooth protocol stack can use different encoding modules to encode the audio data. The user can also adjust the sound quality of the audio data sent to the Bluetooth headset in the Bluetooth headset setting interface on the smart terminal side, and the Bluetooth protocol stack can adjust the sampling frequency and sampling bit width of the audio data to achieve sound quality adjustment of the audio data.
[0128] It should be understood that the audio sharing method provided in the embodiment of the present application can be applied to the scenario of synchronizing audio between multiple pairs of headphones. For example, the following takes the smart terminal as the mobile phone of user A as an example to exemplify the application scenarios in which the audio sharing method provided in the embodiment of the present application may be applicable.
[0129] Application scenario 1: An audio sharing scenario in which a smart terminal is connected to multiple wireless headphones with different sound quality playback capabilities.
[0130] For example, user A and user B respectively wear their own wireless headphones (such as the first wireless headphones and the second wireless headphones respectively) to listen to audio. The first wireless headphones worn by user A are relatively cheap and only support ordinary quality audio (for example, SBC-encoded sound quality). The second wireless headphones worn by user B are relatively expensive and support high-definition quality audio (for example, APTX-encoded sound quality). While user A is listening to audio, if he finds that a certain audio melody is very nice and wants to share it with user B, then user A can establish a wireless connection between his mobile phone and user B's second wireless headphones (for example, by discovering user B's second wireless headphones in the Bluetooth connection interface of the mobile phone and performing a connection operation with user B's second wireless headphones), and user A's mobile phone can obtain the audio coding format of the second wireless headphones. After user A's mobile phone determines that there is a connection between two wireless headphones, it can copy two copies of audio data through the Bluetooth protocol stack. One copy of the audio data is encoded using the SBC encoding module and sent to the first wireless headset worn by user A, and the other copy of the audio data is encoded using the APTX encoding module and sent to the second wireless headset worn by user B. In this way, the first wireless headset worn by user A listens to the SBC encoded sound quality, and the second wireless headset worn by user B listens to the APTX encoded sound quality.
[0131] In one possible implementation, when user A wants to share audio with user B while listening to audio, user A can perform an audio sharing trigger operation with the second wireless headset on the first wireless headset he is wearing, or user B can perform an audio sharing trigger operation with the first wireless headset on the second wireless headset he is wearing (for example, touching the second wireless headset to the first wireless headset), and the second wireless headset can disconnect from the currently connected device and instead establish a connection with the device connected to the first wireless headset, that is, establish a connection with user A's mobile phone.
[0132] In a possible implementation, if user A also wants to share with user C, and the third wireless headset worn by user C supports the sound quality of AAC encoding, user A can perform an audio sharing trigger operation with the third wireless headset on the first wireless headset worn by him, or user C can perform an audio sharing trigger operation with the first wireless headset on the third wireless headset worn by him (for example, let the third wireless headset touch the first wireless headset), and the third wireless headset can release the connection with the currently connected device and establish a connection with the device connected to the first wireless headset (if the third wireless headset is not connected to any device, it can directly establish a connection with the device connected to the first wireless headset after touching), that is, establish a connection with the mobile phone of user A. In this case, after determining that there are three wireless headset connections, the mobile phone of user A can copy three audio data through the Bluetooth protocol stack, one audio data is encoded by the SBC encoding module and sent to the first wireless headset worn by user A, one audio data is encoded by the APTX encoding module and sent to the second wireless headset worn by user B, and one audio data is encoded by the AAC encoding module and sent to the third wireless headset worn by user C.
[0133] Application scenario 2: Adjusting the volume and / or sound quality of multiple wireless headphones in an audio sharing scenario.
[0134] For example, user A and user B wear their own wireless headphones (such as the first wireless headphones and the second wireless headphones respectively) to listen to audio, and the first wireless headphones and the second wireless headphones can support the same or different audio encodings. When user A is listening to audio, if he finds that a certain audio melody is very nice and wants to share it with user B, then user A can establish a wireless connection between his mobile phone and the second wireless headphones of user B. For example, user A finds the second wireless headphones of user B on the Bluetooth connection interface of the mobile phone and performs a connection operation with the second wireless headphones of user B, or user A can perform an audio sharing trigger operation with the second wireless headphones on the first wireless headphones he wears, so that user A's mobile phone can be connected to the second wireless headphones worn by user B, or user B can perform an audio sharing trigger operation with the first wireless headphones on the second wireless headphones he wears, so that user A's mobile phone can be connected to the second wireless headphones worn by user B.
[0135] After user A's mobile phone determines that there is a connection between two wireless headsets, it can copy two copies of audio data through the Bluetooth protocol stack and perform corresponding encoding according to the audio encoding capabilities supported by the two wireless headsets, so that both the first wireless headset worn by user A and the second wireless headset worn by user B can listen to the audio melody. If user B feels that the current volume of the headset is low or high, user B can perform a volume adjustment operation on the second wireless headset he is wearing. After user A's mobile phone receives the volume adjustment instruction of the second wireless headset, it can adjust the volume gain of the audio data corresponding to the second wireless headset through the Bluetooth protocol stack, and then encode the audio data after the volume gain adjustment and transmit it to the second wireless headset worn by user B.
[0136] If the second wireless headset worn by user B can support higher-definition sound quality than the first wireless headset worn by user A, user A can also set the audio data output to the second wireless headset worn by user B on the mobile phone side to have a higher sampling frequency and sampling bit width. For example, user A adjusts the default sound quality to high sound quality in the connection setting interface of the second wireless headset on the mobile phone side, and the Bluetooth protocol stack adjusts the sampling frequency and sampling bit width of the audio data corresponding to the second wireless headset, and then encodes the adjusted audio data and transmits it to the second wireless headset worn by user B.
[0137] Under normal circumstances, each pair of wireless headphones connected to a mobile phone displays the default sound quality in the connection settings interface, that is, the sampling frequency and sampling bit width of the audio data (audio data in PCM format) of each pair of wireless headphones are the same by default, only different audio encoding formats may be used subsequently, for example, SBC encoding, AAC encoding, APTX encoding, etc.
[0138] See also Figure 8 As shown, the audio sharing method provided by the embodiment of the present application. The audio sharing method can be applied to a smart terminal. The audio sharing method includes:
[0139] S801, establishing a wireless communication connection with a first wireless headset, and obtaining an audio coding format of the first wireless headset.
[0140] S802: Establish a wireless communication connection with a second wireless headset, and obtain an audio coding format of the second wireless headset.
[0141] In some embodiments, the wireless communication connection can be a Bluetooth connection, and the smart terminal can support establishing Bluetooth connections with multiple devices at the same time. After the smart terminal establishes a Bluetooth connection with the first wireless headset and the second wireless headset, the audio coding format of the first wireless headset and the audio coding format of the second wireless headset can be obtained.
[0142] In some embodiments, step S801 and step S802 may be executed in parallel, or step S801 may be executed before or after step S802.
[0143] S803: Copy the audio data to be played to obtain first audio data corresponding to the first wireless headset and second audio data corresponding to the second wireless headset.
[0144] For example, the audio data to be played may be audio data written by an application installed in the smart terminal, and the copying and processing of the audio data to be played includes: converting the audio data to be played into audio data in PCM format, mixing the audio data in PCM format, and passing the mixed audio data in PCM format to the Bluetooth protocol stack via the audio hardware abstraction layer and the Bluetooth hardware abstraction layer, and then the Bluetooth protocol stack copies the mixed audio data in PCM format to obtain the first audio data corresponding to the first wireless headset and the second audio data corresponding to the second wireless headset. The wireless protocol stack of the smart terminal is virtualized with a first protocol stack processing module corresponding to the first audio data and a second protocol stack processing module corresponding to the second audio data. By virtualizing the wireless protocol stack into multiple protocol stack processing modules to carry multiple channels of audio data, it is convenient to perform differentiated processing on each channel of audio data.
[0145] In some embodiments, if the first wireless headset and the second wireless headset establish a connection with the smart terminal via Bluetooth, the first protocol stack processing module is the first Bluetooth protocol stack processing module, and the second protocol stack processing module is the second Bluetooth protocol stack processing module. The first Bluetooth protocol stack processing module and the second Bluetooth protocol stack processing module can be created in the Bluetooth protocol stack, and both the first Bluetooth protocol stack processing module and the second Bluetooth protocol stack processing module include BTIF, BTA and BTstack. The first audio data can be transmitted to the BT stack in the first Bluetooth protocol stack processing module via the BTIF and BTA in the first Bluetooth protocol stack processing module. The BT stack in the first Bluetooth protocol stack processing module can encode the first audio data based on the audio coding format of the first wireless headset. For example, the BT stack in the first Bluetooth protocol stack processing module can call an audio encoder corresponding to the audio coding format of the first wireless headset to encode the first audio data. The second audio data is transmitted to the BT stack in the second Bluetooth protocol stack processing module via the BTIF and BTA in the second Bluetooth protocol stack processing module. The BT stack in the second Bluetooth protocol stack processing module encodes the second audio data based on the audio coding format of the second wireless headset. For example, the BT stack in the second Bluetooth protocol stack processing module calls the audio encoder corresponding to the audio coding format of the second wireless headset to encode the second audio data.
[0146] S804, using the first protocol stack processing module to encode the first audio data based on the audio coding format of the first wireless headset to obtain the encoded first audio data, and using the second protocol stack processing module to encode the second audio data based on the audio coding format of the second wireless headset to obtain the encoded second audio data.
[0147] In some embodiments, before encoding the first audio data, the Bluetooth protocol stack may also perform volume gain adjustment and / or sound quality adjustment on the first audio data, and the sound quality adjustment includes adjusting the sampling frequency and sampling bit width of the audio data. Before encoding the second audio data, the Bluetooth protocol stack may also perform volume gain adjustment and / or sound quality adjustment on the second audio data. For example, the volume gain adjustment and / or sound quality adjustment is performed on the first audio data by the BT stack in the first Bluetooth protocol stack processing module, and the volume gain adjustment and / or sound quality adjustment is performed on the second audio data by the BT stack in the second Bluetooth protocol stack processing module, so that multiple pairs of wireless headphones can independently adjust the volume and play audio with different sound qualities.
[0148] S805: Send the encoded first audio data to the first wireless headset, and send the encoded second audio data to the second wireless headset.
[0149] In some embodiments, the smart terminal includes a first wireless connection network chip and a second wireless connection network chip. The encoded first audio data can be sent to the first wireless headset through the first wireless connection network chip, and the encoded second audio data can be sent to the second wireless headset through the first wireless connection network chip. The second wireless connection network chip is in a sleep state, which can save power consumption of the smart terminal.
[0150] In some embodiments, if the amount of data of the encoded first audio data is greater than the amount of data of the encoded second audio data, in order to reduce the audio playback delay, the smart terminal can also send the encoded first audio data to the first wireless headset through the first wireless connection network chip, and send the encoded second audio data to the second wireless headset through the second wireless connection network chip.
[0151] In some embodiments, if the smart terminal establishes a wireless communication connection with more than two pairs of wireless headphones, for example, also establishes a wireless communication connection with a third wireless headset, the smart terminal can also obtain the audio coding format of the third wireless headset, encode the copied third audio data based on the audio coding format of the third wireless headset, obtain the encoded third audio data, and send the encoded third audio data to the third wireless headset through the second wireless connection network chip.
[0152] In some embodiments, the first wireless headset, the second wireless headset, and the third wireless headset may be wireless headsets supporting the A2DP protocol and / or the LE Audio protocol.
[0153] See also Fig. 9 As shown, the following introduces the smart terminal 100 involved in the embodiment of the present application. The smart terminal in the embodiment of the present application can be a mobile phone, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR)\virtual reality (VR) device, etc., including a touch screen device. The embodiment of the present application does not impose any special restrictions on the specific form of the smart terminal. Please refer to Fig. 9 , Fig. 9 It is a structural diagram of the smart terminal 100 provided in an embodiment of the present application.
[0154] The smart terminal 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0155] It is understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the smart terminal 100. In other embodiments of the present application, the smart terminal 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0156] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0157] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0158] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instructions or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0159] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0160] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface to realize the touch function of the smart terminal 100.
[0161] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0162] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0163] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0164] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to realize the shooting function of the smart terminal 100. The processor 110 and the display screen 194 communicate via the DSI interface to realize the display function of the smart terminal 100.
[0165] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0166] The USB interface 130 is an interface that complies with the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the smart terminal 100, and can also be used to transmit data between the smart terminal 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other smart terminals 100, such as AR devices, etc.
[0167] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the smart terminal 100. In other embodiments of the present application, the smart terminal 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0168] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the smart terminal 100. While the charging management module 140 is charging the battery 142, it may also power the smart terminal 100 through the power management module 141.
[0169] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0170] The wireless communication function of the smart terminal 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0171] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the intelligent terminal 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0172] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the smart terminal 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0173] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0174] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the smart terminal 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0175] In some embodiments, the antenna 1 of the smart terminal 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the smart terminal 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0176] The intelligent terminal 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0177] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oled, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the smart terminal 100 may include 1 or N display screens 194, where N is a positive integer greater than 1. Among them, the display screen 194 in the embodiment of the present application may be a touch screen. That is, the touch sensor 180K is integrated in the display screen 194.
[0178] The smart terminal 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0179] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0180] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the smart terminal 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0181] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the smart terminal 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0182] Video codecs are used to compress or decompress digital videos. The smart terminal 100 can support one or more video codecs. In this way, the smart terminal 100 can play or record videos in multiple coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0183] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, intelligent cognition applications such as image recognition, face recognition, voice recognition, and text understanding can be realized in the smart terminal 100.
[0184] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0185] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.;
[0186] Non-volatile memory may include disk storage devices and flash memory.
[0187] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; can be divided into single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; can be divided into universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.
[0188] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.
[0189] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .
[0190] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the smart terminal 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0191] The smart terminal 100 can implement audio functions such as media data playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0192] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110. The speaker 170A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The smart terminal 100 can listen to music or listen to hands-free calls through the speaker 170A.
[0193] The receiver 170B, also called a "receiver", is used to convert audio electrical signals into sound signals. When the smart terminal 100 receives a call or voice message, the receiver 170B can be placed close to the ear to receive the voice.
[0194] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by putting his mouth close to the microphone 170C to input the sound signal into the microphone 170C. The smart terminal 100 can be provided with at least one microphone 170C. In other embodiments, the smart terminal 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the smart terminal 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
[0195] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130, or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0196] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The smart terminal 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the smart terminal 100 detects the touch operation intensity according to the pressure sensor 180A. The smart terminal 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to a first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0197] The gyroscope sensor 180B can be used to determine the motion posture of the smart terminal 100. In some embodiments, the angular velocity of the smart terminal 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. Exemplarily, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shaking of the smart terminal 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the smart terminal 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.
[0198] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the smart terminal 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0199] The magnetic sensor 180D includes a Hall sensor. The smart terminal 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the smart terminal 100 is a flip phone, the smart terminal 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the features such as automatic unlocking of the flip cover are set.
[0200] The acceleration sensor 180E can detect the magnitude of the acceleration of the smart terminal 100 in all directions (generally three axes). When the smart terminal 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the smart terminal 100 and applied to applications such as horizontal and vertical screen switching and pedometers.
[0201] The distance sensor 180F is used to measure the distance. The smart terminal 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the smart terminal 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0202] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The smart terminal 100 emits infrared light outward through the light emitting diode. The smart terminal 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the smart terminal 100. When insufficient reflected light is detected, the smart terminal 100 can determine that there is no object near the smart terminal 100. The smart terminal 100 can use the proximity light sensor 180G to detect that the user holds the smart terminal 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode, and pocket mode automatically unlocks and locks the screen.
[0203] The ambient light sensor 180L is used to sense the ambient light brightness. The smart terminal 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the smart terminal 100 is in a pocket to prevent accidental touch.
[0204] The fingerprint sensor 180H is used to collect fingerprints. The intelligent terminal 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering calls, etc.
[0205] The temperature sensor 180J is used to detect temperature. In some embodiments, the smart terminal 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the smart terminal 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the smart terminal 100 heats the battery 142 to avoid abnormal shutdown of the smart terminal 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the smart terminal 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0206] The touch sensor 180K is also called a "touch device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the smart terminal 100, which is different from the position of the display screen 194.
[0207] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.
[0208] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The smart terminal 100 may receive key input and generate key signal input related to user settings and function control of the smart terminal 100.
[0209] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0210] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0211] The SIM card interface 195 is used to connect the SIM card. The SIM card can be connected to and separated from the smart terminal 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The smart terminal 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The smart terminal 100 interacts with the network through the SIM card to realize functions such as calls and data communications. In some embodiments, the smart terminal 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the smart terminal 100 and cannot be separated from the smart terminal 100.
[0212] The audio sharing methods in the above embodiments can all be implemented in the smart terminal 100 having the above hardware structure.
[0213] like Fig.10 FIG. 2 is a schematic diagram of a wireless headset 200 provided in an embodiment of the present application. The wireless headset 200 may correspond to Figure 3The first wireless headset shown. The wireless headset 200 may include at least one processor 201, at least one memory 202, a wireless communication module 203, an audio module 204, a power module 205, and an input / output interface 206. The processor may include one or more interfaces for connecting to other components of the wireless headset 200. The wireless headset 200 may be stored in an earphone box.
[0214] Among them, the memory 202 can be used to store program codes, which are used, for example, for Bluetooth connection between the wireless headset 200 and the smart terminal 100, or for charging the wireless headset 200. The memory 202 can also be used to store other information, such as the priority of the smart terminal 100. In addition, the memory 202 can also store communication information of other devices (such as the smart terminal 100), such as communication addresses, device identification, etc. The memory 202 can also store audio synchronization trigger operations corresponding to other audio playback devices (such as the second wireless headset). The processor 201 can be used to execute the above program code and call related modules to implement the functions of the wireless headset 200 in the embodiment of the present application. For example, Bluetooth pairing between the wireless headset 200 and the smart terminal 100, as well as audio playback and other functions are implemented.
[0215] In some embodiments, the processor 201 may include one or more processing units, and different processing units may be independent devices or integrated into one or more processors 201. The processor 201 may specifically be an integrated control chip, or may be composed of a circuit including various active and / or passive components, and the circuit is configured to perform the functions of the processor 201 described in the embodiments of the present application. The wireless communication module 203 may be used to support communication between the wireless headset 100 and other electronic devices or headset boxes, including data exchange of wireless communications such as BLE, WLAN (such as Wi-Fi), Zigbee, FM, NFC, IR, or general 2.4G / 5G wireless communication technologies.
[0216] In some embodiments, the wireless communication module 203 may include a Bluetooth chip, which may support the wireless headset 200 to connect to multiple electronic devices through Bluetooth. For example, the first wireless headset can be paired with the smart terminal 100 through the Bluetooth chip and establish a Bluetooth connection to achieve wireless communication and audio service processing with the smart terminal 100 through the Bluetooth connection. The Bluetooth chip can also support the broadcast audio function in the LE audio core protocol specification, so that the wireless headset 200 receives one or more audio streams broadcast by the smart terminal. In addition, the wireless communication module 203 may also include an antenna. The wireless communication module 203 receives electromagnetic waves via the antenna, modulates the electromagnetic wave signal and filters it, and sends the processed signal to the processor 201. The wireless communication module 203 can also receive the signal to be sent from the processor 201, modulate its frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna. The wireless communication module 203 can obtain signals transmitted by other devices (such as the smart terminal 100), such as detection requests, scanning signals, etc., and can send response signals, scanning responses, etc., so that other devices (such as the smart terminal 100) can discover the wireless headset 200 and establish a wireless communication connection with other devices (such as the smart terminal 100).
[0217] The wireless communication module 203 can also transmit signals, such as broadcasting BLE signals, so that other devices (such as smart terminals 100) can find the wireless headset 200, and establish wireless communication connections with other devices (such as smart terminals 100), and communicate with other devices (such as smart terminals 100) via Bluetooth. The audio module 204 can be used to manage audio data and realize the input and output of audio signals by the wireless headset 200. For example, the audio module 204 can obtain audio signals from the wireless communication module 203, or transmit audio signals to the wireless communication module 203, to realize functions such as making calls, playing music, starting / closing the voice assistant of the smart terminal connected to the headset, and receiving / sending the user's voice data through the wireless headset. The audio module 204 may include a speaker (or earpiece, receiver) component for outputting audio signals, a microphone (or microphone, microphone), and a microphone receiving circuit that cooperates with the microphone. The speaker can be used to convert audio electrical signals into sound signals and play them. The microphone can be used to convert sound into audio electrical signals.
[0218] The power module 205 can be used to provide system power for the wireless headset 200, power each module of the wireless headset 200, and support the wireless headset 200 to receive charging input, etc. The power module 205 may include a power management unit (PMU) and a battery. The power management unit may receive external charging input, transform the electrical signal of the charging input and provide it to the battery for charging, and may also transform the electrical signal provided by the battery and provide it to other modules such as the audio module 204 and the wireless communication module 203 to prevent the battery from being overcharged, over-discharged, short-circuited or overcurrent, etc. In some embodiments, the power module 205 may also include a wireless charging coil for wirelessly charging the wireless headset 200. In addition, the power management unit may also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance).
[0219] Multiple input / output interfaces 206 (i.e., communication interfaces) can be used to provide a wired connection for charging or communication between the wireless headset 200 and the headset box. In some embodiments, the input / output interface can be a USB interface. In other embodiments, the input / output interface 206 can be a headset electrical connector. When the wireless headset 200 is placed in the headset box, the wireless headset 200 can establish an electrical connection with the electrical connector in the headset box through the headset electrical connector, thereby charging the battery in the wireless headset 200. In other embodiments, after the electrical connection is established, the wireless headset 200 can also communicate data with the headset box, for example, it can receive a pairing instruction from the headset box.
[0220] In addition, the wireless headset 200 may further include a sensor 207. For example, the sensor 207 may be a distance sensor or a proximity light sensor, which may be used to determine whether the wireless headset 200 is worn by the user. Exemplarily, the wireless headset 200 may use a distance sensor to detect whether there is an object near the wireless headset 200, thereby determining whether the wireless headset 200 is worn by the user. When it is determined that the wireless headset 200 is worn, the wireless headset 200 may turn on the speaker. For another example, the sensor 207 may also include a bone conduction sensor, combined into a bone conduction headset. Using the bone conduction sensor, the wireless headset 200 may obtain the vibration signal of the vibrating bone of the human vocal part, parse the voice signal, realize the voice function, and thus receive the user's voice command. The wireless headset 200 may also perform voice authentication based on the user's voice signal obtained by the bone conduction headset, so as to authenticate the user's identity in business scenarios such as payment transactions. For another example, the sensor 207 may also include: a touch sensor for detecting a user's touch operation; a fingerprint sensor for detecting a user's fingerprint and identifying the user; an ambient light sensor that can adaptively adjust some parameters (such as volume) according to the perceived brightness of the ambient light. For another example, the sensor 207 may also be used to detect audio synchronization trigger operations corresponding to different audio playback devices (such as a second wireless headset), such as a user's single click, double click, multiple clicks, long press, heavy press, sliding and other touch operations; or, it may also detect collision operations between the wireless headset 200 and other devices. The sensor 207 may convert the audio synchronization trigger operation into an electrical signal and transmit it to the processor 201, so that the processor 201 can determine which audio playback device to establish a wireless connection with and share audio according to the audio synchronization trigger operation.
[0221] It is understandable that the structure shown in the embodiment of the present application does not constitute a specific limitation on the wireless headset 200. Fig.10 More or fewer components shown may be combined with two or more components, or may have different component configurations. For example, the outer surface of the wireless headset 200 may also include a button 208, an indicator light (which may indicate battery level, incoming / outgoing call, pairing mode, etc.), a display screen (which may prompt the user with relevant information), a dust screen (which may be used in conjunction with a handset), and other components. The button 208 may be a physical button or a virtual button (used in conjunction with a touch sensor), etc., which is used to trigger operations such as power on, power off, pause, play, record, start pairing, share audio, and reset.
[0222] This embodiment also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on the smart terminal 100, the smart terminal 100 executes the above-mentioned related method steps to implement the audio sharing method in the above-mentioned embodiment.
[0223] This embodiment also provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the above-mentioned related steps to implement the audio sharing method in the above-mentioned embodiment.
[0224] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes the audio sharing method in the above-mentioned method embodiments.
[0225] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0226] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0227] The unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
[0228] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0229] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
[0230] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. An audio sharing method, applied to a smart terminal, characterized in that: The method comprises: Copy the audio data to be played to obtain first audio data corresponding to the first wireless headset and second audio data corresponding to the second wireless headset, wherein the smart terminal virtualizes a first protocol stack processing module corresponding to the first audio data and a second protocol stack processing module corresponding to the second audio data; Using the first protocol stack processing module to encode the first audio data based on the audio coding format of the first wireless headset to obtain encoded first audio data, and using the second protocol stack processing module to encode the second audio data based on the audio coding format of the second wireless headset to obtain encoded second audio data; The encoded first audio data is sent to the first wireless headset, and the encoded second audio data is sent to the second wireless headset.
2. The audio sharing method according to claim 1, characterized in that: The smart terminal communicates with the first wireless headset and the second wireless headset via Bluetooth, and the copying of the audio data to be played includes: Converting the audio data to be played into audio data in a pulse code modulation (PCM) format, and performing a mixing process on the audio data in the PCM format; The mixed audio data in PCM format is transmitted to the Bluetooth protocol stack via the audio hardware abstraction layer and the Bluetooth hardware abstraction layer; The audio data in PCM format after the mixing process is copied using the Bluetooth protocol stack.
3. The audio sharing method according to claim 2, characterized in that: The first protocol stack processing module is a first Bluetooth protocol stack processing module, and the second protocol stack processing module is a second Bluetooth protocol stack processing module. The first Bluetooth protocol stack processing module and the second Bluetooth protocol stack processing module are created in the Bluetooth protocol stack. The first Bluetooth protocol stack processing module and the second Bluetooth protocol stack processing module both include a Bluetooth protocol stack interface layer BTIF, a Bluetooth protocol stack application layer BTA, and a Bluetooth protocol stack layer BT stack. The first protocol stack processing module is used to encode the first audio data based on the audio coding format of the first wireless headset to obtain the encoded first audio data, and the second protocol stack processing module is used to encode the second audio data based on the audio coding format of the second wireless headset to obtain the encoded second audio data, including: The first audio data is transmitted to the BT stack in the first Bluetooth protocol stack processing module via the BTIF and the BTA in the first Bluetooth protocol stack processing module, and the BT stack in the first Bluetooth protocol stack processing module encodes the first audio data based on the audio encoding format of the first wireless headset; The second audio data is transmitted to the BT stack in the second Bluetooth protocol stack processing module via the BTIF and BTA in the second Bluetooth protocol stack processing module, and the BT stack in the second Bluetooth protocol stack processing module encodes the second audio data based on the audio encoding format of the second wireless headset.
4. The audio sharing method according to claim 3, characterized in that: The BT stack in the first Bluetooth protocol stack processing module calls an audio encoder corresponding to the audio encoding format of the first wireless headset to encode the first audio data; The BT stack in the second Bluetooth protocol stack processing module calls an audio encoder corresponding to the audio encoding format of the second wireless headset to encode the second audio data.
5. The audio sharing method according to claim 3, characterized in that: Before encoding the first audio data using the first protocol stack processing module based on the audio coding format of the first wireless headset to obtain the encoded first audio data, and encoding the second audio data using the second protocol stack processing module based on the audio coding format of the second wireless headset to obtain the encoded second audio data, the method further includes: Performing volume gain adjustment and / or sound quality adjustment on the first audio data, wherein the sound quality adjustment includes adjusting the sampling frequency and sampling bit width of the audio data; The volume gain and / or sound quality of the second audio data are adjusted.
6. The audio sharing method according to claim 5, characterized in that: The step of adjusting the volume gain and / or sound quality of the first audio data includes: The BT stack in the first Bluetooth protocol stack processing module performs volume gain adjustment and / or sound quality adjustment on the first audio data; The step of adjusting the volume gain and / or sound quality of the second audio data includes: The BT stack in the second Bluetooth protocol stack processing module performs volume gain adjustment and / or sound quality adjustment on the second audio data.
7. The audio sharing method according to any one of claims 1 to 6, characterized in that: The intelligent terminal includes a first wireless connection network chip and a second wireless connection network chip, and the method further includes: Copying the audio data to be played to obtain third audio data corresponding to the third wireless headset, wherein the smart terminal further virtualizes a third protocol stack processing module corresponding to the third audio data; Using the third protocol stack processing module to encode the third audio data based on the audio encoding format of the third wireless headset to obtain encoded third audio data; Sending the encoded third audio data to the third wireless headset through the second wireless connection network chip; The sending the encoded first audio data to the first wireless headset and the sending the encoded second audio data to the second wireless headset include: The encoded first audio data is sent to the first wireless headset through the first wireless connection network chip, and the encoded second audio data is sent to the second wireless headset through the first wireless connection network chip.
8. The audio sharing method according to claim 7, characterized in that: The first wireless headset, the second wireless headset and the third wireless headset are wireless headsets that support the Advanced Audio Distribution Profile A2DP protocol and / or the Low Power Bluetooth Audio Standard LE Audio protocol of the new generation Bluetooth technology standard.
9. The audio sharing method according to any one of claims 1 to 6, characterized in that: The smart terminal includes a first wireless connection network chip and a second wireless connection network chip, the chip capability of the first wireless connection network chip is stronger than that of the second wireless connection network chip, the data volume of the encoded first audio data is greater than the data volume of the encoded second audio data, and sending the encoded first audio data to the first wireless headset and sending the encoded second audio data to the second wireless headset include: The encoded first audio data is sent to the first wireless headset via the first wireless connection network chip, and the encoded second audio data is sent to the second wireless headset via the second wireless connection network chip.
10. An intelligent terminal, characterized in that: The intelligent terminal includes a memory and a processor; The memory is used to store program instructions; The processor is used to read the program instructions stored in the memory to implement the audio sharing method as described in any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the audio sharing method according to any one of claims 1 to 9 is implemented.
12. A chip coupled to a memory in a smart terminal, characterized in that: The chip is used to control the smart terminal to execute the audio sharing method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Bluetooth audio data transmission method and device, intelligent terminal and storage medium
CN113132957A
Audio playing method, audio playing device and computer readable storage medium
CN115729510A
Audio processing device and method, electronic equipment and storage medium
CN116320906A
Method and system for auto-setting audio coding formats of bluetooth a2DP transmission
WO2008122212A1