Data encoding method, data decoding method, device, equipment and medium
By carrying the low-bit data of the second channel in the first audio encoding packet of the true wireless Bluetooth headset, the problem of uneven bandwidth capability caused by different signal strengths of the two Bluetooth receiving devices is solved, and the maximum utilization of the total transmission bandwidth and uniformity of hearing is achieved.
Patent Information
- Application Number
- CN202210745360.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-27
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2042-06-27
AI Technical Summary
In true wireless Bluetooth headsets, due to the different signal strengths of the two Bluetooth receiving devices, the bandwidth capabilities are different, resulting in a significant difference in the hearing between the left and right ears of the human body.
By carrying the low-bit data of the second channel in the first audio encoding packet, the low-bit data of the second channel can be forwarded to the second Bluetooth receiving device through the first Bluetooth receiving device, thereby maximizing the utilization of the total transmission bandwidth of the first and second channels.
The total transmission bandwidth of the first channel and the second channel is maximized, and the hearing difference caused by the difference in signal strength is avoided.
Smart Images

Figure CN115171706B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of coding and decoding technology, and in particular to a data coding method, a data decoding method, a device, an equipment and a medium. Background Art
[0002] With the growth and popularity of True Wireless Studio (TWS), Bluetooth devices are widely used in work and life.
[0003] In some cases, the Bluetooth signal strengths of the two Bluetooth receiving devices of TWS are different, resulting in different bandwidth capabilities. For example, if the Bluetooth sending device is a mobile phone, and the mobile phone is on the side of the left ear of the human body, the Bluetooth signal strength of the first Bluetooth receiving device on the left will be greater than that of the second Bluetooth receiving device on the right. Due to the difference in signal strength, the difference in hearing between the left and right ears of the human body will be more obvious.
[0004] To avoid this problem, in the prior art, the amount of data transmitted by the Bluetooth receiving device corresponding to the high-bandwidth channel is usually reduced so that the reduced amount of data is the same as the amount of data transmitted by the Bluetooth receiving device corresponding to the low-bandwidth channel. Summary of the invention
[0005] The embodiment of the present application provides a data encoding method, a data decoding method, an apparatus, a device and a medium, by carrying the low-bit data of the second channel in the first audio coding packet, so that the low-bit data of the second channel can be forwarded to the second Bluetooth receiving device via the first Bluetooth receiving device, thereby maximizing the total transmission bandwidth of the first channel and the second channel. The technical solution is as follows:
[0006] According to one aspect of the present application, a data encoding method is provided, which is performed by a Bluetooth sending device, and the method includes:
[0007] generating a first audio coding packet and a second audio coding packet;
[0008] The first audio coding packet includes at least the data to be transmitted in the first audio data corresponding to the first channel and the low-order data to be transmitted in the second audio data corresponding to the second channel, and the second audio coding packet includes the high-order data to be transmitted in the second audio data.
[0009] According to one aspect of the present application, a data decoding method is provided, which is performed by a first Bluetooth receiving device, and includes:
[0010] receiving a first audio coding packet, wherein the first audio coding packet includes at least data to be transmitted in first audio data corresponding to the first channel and low-bit data to be transmitted in second audio data corresponding to the second channel;
[0011] The first audio coding packet is decoded to obtain third audio data, where the number of bits of the third audio data is the same as that of the first audio data.
[0012] According to one aspect of the present application, a data decoding method is provided, which is performed by a second Bluetooth receiving device, and includes:
[0013] Receive a second audio coding packet sent by a Bluetooth sending device, where the second audio coding packet includes high-order data to be transmitted in the second audio data corresponding to the second channel;
[0014] The second audio coding packet is decoded to obtain fourth audio data, where the number of bits of the fourth audio data is the same as the number of bits of the second audio data.
[0015] According to one aspect of the present application, a data encoding device is provided, the device comprising:
[0016] An encoding module, used to generate a first audio encoding packet and a second audio encoding packet;
[0017] The first audio coding packet includes at least the data to be transmitted in the first audio data corresponding to the first channel and the low-order data to be transmitted in the second audio data corresponding to the second channel, and the second audio coding packet includes the high-order data to be transmitted in the second audio data.
[0018] According to one aspect of the present application, a data decoding device is provided, the device comprising:
[0019] A receiving module, used to receive a first audio coding packet, wherein the first audio coding packet includes at least data to be transmitted in the first audio data corresponding to the first channel and low-bit data to be transmitted in the second audio data corresponding to the second channel;
[0020] The decoding module is used to decode the first audio coding packet to obtain third audio data, where the number of bits of the third audio data is the same as that of the first audio data.
[0021] According to one aspect of the present application, a data decoding device is provided, the device comprising:
[0022] A receiving module, used for receiving a second audio coding packet sent by a Bluetooth sending device, wherein the second audio coding packet includes high-order data to be transmitted in the second audio data corresponding to the second channel;
[0023] The decoding module is used to decode the second audio coding packet to obtain fourth audio data, where the number of bits of the fourth audio data is the same as that of the second audio data.
[0024] According to one aspect of the present application, a Bluetooth sending device is provided, the Bluetooth sending device comprising a memory and a processor;
[0025] At least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the data encoding method as described above.
[0026] According to one aspect of the present application, a first Bluetooth receiving device is provided, the first Bluetooth receiving device comprising a memory and a processor;
[0027] At least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the data decoding method as described above.
[0028] According to one aspect of the present application, a second Bluetooth receiving device is provided, the second Bluetooth receiving device comprising a memory and a processor;
[0029] At least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the data decoding method as described above.
[0030] According to one aspect of the present application, a Bluetooth system is provided, the Bluetooth system comprising a first Bluetooth receiving device and a second Bluetooth receiving device;
[0031] The first Bluetooth receiving device corresponds to the first sound channel, and the first Bluetooth receiving device is used to execute the data decoding method as described above;
[0032] The second Bluetooth receiving device corresponds to the second sound channel, and the second Bluetooth receiving device is used to execute the data decoding method as described above.
[0033] According to one aspect of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is used to be executed by a processor to implement the data encoding method or the data decoding method as described above.
[0034] According to one aspect of the present application, a chip is provided, which includes a programmable logic circuit and / or program instructions, and when an electronic device equipped with the chip is running, it is used to implement the data encoding method or data decoding method as described above.
[0035] According to one aspect of the present application, a computer program product is provided, which includes computer instructions stored in a computer-readable storage medium. A processor reads and executes the computer instructions from the computer-readable storage medium to implement the data encoding method or data decoding method as described above.
[0036] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0037] By carrying the low-bit data of the second channel in the first audio coding packet, the low-bit data to be transmitted in the second channel can be forwarded to the second Bluetooth receiving device via the first Bluetooth receiving device, thereby maximizing the total transmission bandwidth of the first channel and the second channel. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0039] Figure 1 is a schematic diagram of audio transmission provided by an exemplary embodiment of the present application;
[0040] Figure 2 is a flow chart of a data encoding method provided by an exemplary embodiment of the present application;
[0041] Figure 3 is a schematic diagram of a high-level interception provided by an exemplary embodiment of the present application;
[0042] Figure 4 is a schematic diagram of data splitting provided by an exemplary embodiment of the present application;
[0043] Figure 5 is a flow chart of a data decoding method provided by an exemplary embodiment of the present application;
[0044] Figure 6 is a schematic diagram of audio transmission provided by an exemplary embodiment of the present application;
[0045] Figure 7 is a flow chart of a data decoding method provided by an exemplary embodiment of the present application;
[0046] Figure 8 is a schematic diagram of audio transmission provided by an exemplary embodiment of the present application;
[0047] Fig. 9 is a schematic diagram of audio transmission provided by an exemplary embodiment of the present application;
[0048] Fig.10 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application;
[0049] Fig.11 is a schematic diagram of audio transmission provided by an exemplary embodiment of the present application;
[0050] Fig.12is a flow chart of a data transmission method provided by an exemplary embodiment of the present application;
[0051] Fig.13 is a schematic diagram of audio transmission provided by an exemplary embodiment of the present application;
[0052] Fig.14 is a schematic diagram of audio transmission provided by an exemplary embodiment of the present application;
[0053] Fig.15 is a flow chart of a data encoding method provided by an exemplary embodiment of the present application;
[0054] Fig.16 is a schematic diagram of audio transmission provided by an exemplary embodiment of the present application;
[0055] Fig.17 is a schematic diagram of a first audio coding packet format provided by an exemplary embodiment of the present application;
[0056] Fig.18 is a schematic diagram of a second audio coding packet format provided by an exemplary embodiment of the present application;
[0057] Fig.19 is a schematic diagram of a first sub-packet format provided by an exemplary embodiment of the present application;
[0058] Fig. 20 is a schematic diagram of a data encoding device provided by an exemplary embodiment of the present application;
[0059] Fig.21 is a schematic diagram of a data decoding device provided by an exemplary embodiment of the present application;
[0060] Fig. 22 is a schematic diagram of a data decoding device provided by an exemplary embodiment of the present application;
[0061] Fig.23 It is a structural diagram of a communication device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0062] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0063] With the growth and popularity of True Wireless Studio (TWS), Bluetooth devices are widely used in work and life, such as making calls, listening to music, etc. In this process, audio data needs to be transmitted.
[0064] Take the wireless transmission of audio data between a Bluetooth sending device and two Bluetooth receiving devices as an example. Figure 1 A schematic diagram of audio transmission provided by an exemplary embodiment of the present application is shown, wherein the Bluetooth sending device is a terminal device for encoding and sending audio data, and the two Bluetooth receiving devices are terminal devices for decoding and playing different audio data.
[0065] Schematically, the data transmission process between a Bluetooth sending device and two Bluetooth receiving devices is as follows:
[0066] The user determines the audio resource to be played in the Bluetooth transmitting device, and the Bluetooth transmitting device obtains the audio resource and decodes it through pulse code modulation (PCM decoding) to obtain audio data corresponding to the audio resource. The decoded PCM data includes audio data corresponding to the first channel and audio data corresponding to the second channel.
[0067] Subsequently, the Bluetooth transmitting device performs audio encoding on the audio data to obtain audio encoding packets corresponding to the first channel and the second channel, respectively. The audio encoding may be a lossless audio compression codec (Free Lossless Audio Codec, FLAC). After encoding, the Bluetooth transmitting device transmits the audio encoding packets to the first channel and the second channel, respectively, through the transmitting component.
[0068] Schematically, the data transmission between the Bluetooth transmitting device and the two Bluetooth receiving devices is wireless transmission.
[0069] Taking the first Bluetooth receiving device as an example, after the first Bluetooth receiving device obtains the audio coding packet corresponding to the first channel sent by the Bluetooth sending device through the first receiving component, it performs PCM decoding on the audio coding packet to obtain decoded audio data.
[0070] Subsequently, the first Bluetooth receiving device performs digital-to-analog conversion and power amplification on the decoded audio data to obtain corresponding first analog data, and plays the first analog data through the first playback component. It should be understood that the first analog data corresponds to the resources of the first channel in the audio resources determined in the Bluetooth sending device. Optionally, the digital-to-analog conversion can be implemented by a digital to analog converter (DAC), and the power amplification can be implemented by a power amplifier (AMP).
[0071] Correspondingly, after the second Bluetooth receiving device obtains the audio coding package corresponding to the second channel sent by the Tornado III device through the second receiving component, it performs PCM decoding, digital-to-analog conversion and power amplification on the audio coding package to obtain the corresponding second analog data, and plays the second analog data through the second playing component.
[0072] Illustratively, the first Bluetooth receiving device and the second Bluetooth receiving device may constitute a Bluetooth system, wherein the first Bluetooth receiving device is used to receive audio data corresponding to the first channel, and the second Bluetooth receiving device is used to receive audio data corresponding to the second channel.
[0073] For example, the Bluetooth sending device is a mobile phone, and the Bluetooth system is a pair of Bluetooth headsets. After the mobile phone and the Bluetooth headset establish a communication connection, the user selects the music to be played on the mobile phone.
[0074] The mobile phone obtains the audio resource corresponding to the music, and performs PCM decoding on the audio resource to obtain PCM data, which is the audio data corresponding to the audio resource. The PCM data obtained after decoding should include audio data corresponding to the first channel and audio data corresponding to the second channel. Subsequently, the mobile phone performs audio encoding on the two PCM data respectively to obtain two audio encoding packets, and sends the audio encoding packets corresponding to the PCM data to the receiving components corresponding to the two Bluetooth headsets through the sending component.
[0075] The two receiving components perform PCM decoding on the received different audio encoding packets to obtain PCM data, and generate corresponding analog data through DAC and AMP. Subsequently, the different analog data are played through the corresponding playing components so that the user can listen to the selected music through the Bluetooth headset.
[0076] In some cases, the Bluetooth signal strengths of two Bluetooth receiving devices are different, resulting in different bandwidth capabilities. For example, if the Bluetooth sending device is a mobile phone, and the mobile phone is on the side of the left ear of the human body, the Bluetooth signal strength of the first Bluetooth receiving device on the left side will be greater than the second Bluetooth receiving strength on the right side. Due to the difference in signal strength, the hearing sense of the left and right ears of the human body will be more obviously different.
[0077] To avoid this problem, the amount of data transmitted by the Bluetooth receiving device corresponding to the high-bandwidth channel is usually reduced so that the reduced amount of data is the same as the amount of data transmitted by the Bluetooth receiving device corresponding to the low-bandwidth channel. For example, if the transmission bandwidth capacity of the Bluetooth receiving device corresponding to the high-bandwidth channel is 5 and the transmission bandwidth capacity of the Bluetooth receiving device corresponding to the low-bandwidth channel is 3, the transmission bandwidth capacity of the Bluetooth receiving device corresponding to the high-bandwidth channel is usually reduced to 3 in the prior art. At this time, the total transmission bandwidth capacity of the two channels is 8, but the total transmission bandwidth capacity used can only reach 6, which is a waste of transmission bandwidth.
[0078] The present application provides a data transmission method for encoding and decoding data between a Bluetooth transmitting device and two Bluetooth receiving devices, wherein the data encoding method is executed by the Bluetooth transmitting device, and the data decoding method is executed by the two Bluetooth receiving devices respectively.
[0079] Figure 2 A flowchart of a data encoding method provided by an exemplary embodiment of the present application is shown. The method is executed by a Bluetooth sending device and includes the following steps:
[0080] Step 202: Generate a first audio coding package and a second audio coding package.
[0081] Illustratively, the first audio coding packet includes at least data to be transmitted in the first audio data corresponding to the first channel and low-order data to be transmitted in the second audio data corresponding to the second channel, and the second audio coding packet includes high-order data to be transmitted in the second audio data.
[0082] It should be understood that both the first audio data and the second audio data include high-bit data and low-bit data.
[0083] The low-order data of the first audio data is used to indicate the data on the low i-bit bits of the first audio data, and the high-order data of the first audio data is used to indicate the data on the high j-bit bits of the first audio data, i or j does not exceed the number of bits of the first audio data, and the sum of i and j does not exceed the number of bits of the first audio data. For example, the first audio data is 8-bit data generated based on binary, and in a left-to-right arrangement, the high 5 bits of the first audio data are used to indicate the 1st to 5th bits of the first audio data, and the low 3 bits of the first audio data are used to indicate the 6th to 8th bits of the first audio data.
[0084] Similarly, the low-order data of the second audio data is used to indicate the data on the low n bits of the second audio data, and the high-order data of the second audio data is used to indicate the data on the high m bits of the second audio data, n or m does not exceed the number of bits of the second audio data, and the sum of n and m does not exceed the number of bits of the second audio data. For example, the second audio data is 32-bit data generated based on binary, and in a left-to-right arrangement, the high 24 bits of the second audio data are used to indicate the 1st to 24th bits of the second audio data, and the low 8 bits of the second audio data are used to indicate the 25th to 32nd bits of the second audio data.
[0085] It should be understood that, in the present application, if the high-order data and the low-order data are not explicitly stated, the expression "first audio data" can be used to indicate all the data of the first audio data; and the expression "second audio data" can be used to indicate all the data of the second audio data.
[0086] Optionally, the first audio data and the second audio data are PCM data obtained after PCM decoding of the audio resource to be transmitted, wherein the first audio data is audio data corresponding to the first channel, and the second audio data is audio data corresponding to the second channel.
[0087] Illustratively, the first audio data and the second audio data involved in the embodiments of the present application are used to indicate all the data in the PCM data obtained after PCM decoding according to the audio resource. Among them, the first audio data can also be regarded as the initial PCM data corresponding to the first channel, and the second audio data can also be the initial PCM data corresponding to the second channel. Optionally, the initial PCM data can also be referred to as the original PCM data.
[0088] In an optional implementation scenario, the transmission bandwidths of the first channel and the second channel are different. The different transmission bandwidths can also be understood as different transmission bandwidth capabilities of the first channel and the second channel. For example, the transmission bandwidth capability of the first channel is 5, and the transmission bandwidth capability of the second channel is 3. In this case, the first channel can be regarded as a high-bandwidth channel, and the second channel can be regarded as a low-bandwidth channel, and the data transmission volume corresponding to the first channel will be greater than the data transmission volume corresponding to the second channel.
[0089] Exemplarily, the following examples all take the case where the first channel is a high-bandwidth channel, the second channel is a low-bandwidth channel, and the data transmission volume corresponding to the first channel is greater than the data transmission volume corresponding to the second channel.
[0090] Optionally, when the average transmission bandwidth of the first channel and the second channel does not meet the transmission requirements, it is necessary to delete the low-order data of the first audio data and / or the second audio data, which can also be regarded as intercepting the high-order data of the first audio data and / or the second audio data to retain the high-order data of the first audio data and / or the second audio data as much as possible.
[0091] The average transmission bandwidth is determined according to the Bluetooth bandwidth corresponding to the first channel and the second channel. The Bluetooth transmitting device measures the Bluetooth bandwidth corresponding to the first channel and the second channel, and then calculates the average transmission bandwidth.
[0092] Based on this, the first audio coding packet includes at least the data to be transmitted in the first audio data and the low-order data to be transmitted in the second audio data; the second audio coding packet includes the high-order data to be transmitted in the second audio data.
[0093] In the embodiment of the present application, the first audio data is the original audio data corresponding to the first channel, and the second audio data is the original audio data corresponding to the second channel. It should be understood that the data to be transmitted in the first audio data can be the original audio data of the first audio data without high-bit interception, or the first audio data after high-bit interception. Similarly, the high-bit data and low-bit data to be transmitted in the second audio data can be the high-bit data and low-bit data corresponding to the second audio data without high-bit interception, or the high-bit data and low-bit data corresponding to the second audio data after high-bit interception.
[0094] Optionally, if the high-bits of the first audio data are intercepted, the first audio coding packet includes at least the data to be transmitted in the first audio data; if the high-bits of the first audio data are not intercepted, the first audio coding packet includes all the data of the first audio data. Taking the first audio data as 32 bits as an example, if the high-bits of the first audio data are intercepted to obtain the first audio data with the lower i bits deleted, the data to be transmitted of the first audio data at least included in the first audio coding packet should be the 32-i bits of the first audio data. If the high-bits of the first audio data are not intercepted, the first audio coding packet includes at least 32 bits of the first audio data.
[0095] Similarly, the second audio data is 32 bits. If the second audio data is truncated at high bits to obtain the second audio data with the lower n bits deleted, the low-bit data to be transmitted in the second audio data included in the first audio coding package should be the low-bit data corresponding to the second audio data with the lower n bits deleted. If the second audio data is not truncated at high bits, the low-bit data to be transmitted in the second audio data included in the first audio coding package should be the low-bit data corresponding to the 32-bit second audio data. Correspondingly, the high-bit data to be transmitted in the second audio data included in the second audio coding package should also be the high-bit data corresponding to the 32-bit second audio data.
[0096] Taking the second audio data as 32 bits as an example, Figure 3 FIG. 1 is a schematic diagram showing a high-order interception provided by an exemplary embodiment of the present application. Figure 3 , the high bits of the 32-bit second audio data are intercepted, the low 8 bits of the 32-bit second audio data are deleted, and the 24-bit second audio data is obtained. Then, the low-bit data to be transmitted in the second audio data included in the first audio coding packet is the low-bit data corresponding to the 24-bit second audio data. For example, the low-bit data to be transmitted in the second audio data is the low 8 bits of the 24-bit second audio data.
[0097] Taking the case where the first channel is a high-bandwidth channel and the second channel is a low-bandwidth channel as an example, after splitting the second audio data, the Bluetooth sending device can carry the low-bit data to be transmitted in the second audio data in the first audio coding packet for transmission. In an optional implementation scenario, the low-bit data to be transmitted in the second audio data is forwarded to the second Bluetooth receiving device via the first Bluetooth receiving device, so that the low-bit data corresponding to the low-bandwidth channel can be forwarded with the help of the first Bluetooth receiving device corresponding to the high-bandwidth channel, thereby maximizing the total transmission bandwidth of the two channels.
[0098] Optionally, the first audio coding packet includes a first sub-packet and a second sub-packet, the first sub-packet includes at least the data to be transmitted in the first audio data, and the second sub-packet includes the high-order data to be transmitted in the second audio data. In this case, the first Bluetooth receiving device can unpack the first audio coding packet after receiving it, and then send the second sub-packet to the second Bluetooth receiving device.
[0099] In the case where the first audio coding packet includes the first sub-packet and the second sub-packet, step 202 may be implemented as follows:
[0100] Encoding the first audio data to obtain a first sub-packet;
[0101] Splitting the second audio data to determine low-order data and high-order data to be transmitted in the second audio data;
[0102] Encoding the low-order data to be transmitted in the second audio data to obtain a second sub-packet;
[0103] Encoding the high-order data to be transmitted in the second audio data to obtain a second audio encoding packet;
[0104] The first sub-packet and the second sub-packet are combined to obtain a first audio coding packet.
[0105] The encoding of the first audio data can be performed according to the high-bit interception in the above content. If the high-bit interception is not performed on the first audio data, the first audio data is encoded as the data to be transmitted to obtain the first sub-packet; if the high-bit interception is performed on the first audio data, the first audio data after the high-bit interception is encoded as the data to be transmitted to obtain the first sub-packet.
[0106] The data splitting of the second audio data may be determined according to the transmission bandwidths of the first channel and the second channel.
[0107] For the encoding of the high-order data to be transmitted in the second audio data, reference may be made to the relevant description of the encoding of the first audio data.
[0108] Optionally, taking the case where the first channel is a high-bandwidth channel and the second channel is a low-bandwidth channel as an example, the generation of the first audio coding packet and the second audio coding packet may be specifically implemented as follows:
[0109] 1. Obtain the transmission bandwidths of the first channel and the second channel to determine the average transmission bandwidth.
[0110] First, the Bluetooth transmitting device obtains the Bluetooth bandwidth of the first channel and the second channel to obtain the transmission bandwidth of the first channel and the second channel. Then, when the transmission bandwidths of the first channel and the second channel are different, the second audio data is split to determine the low-order data and the high-order data to be transmitted in the second audio data.
[0111] The average transmission bandwidth of the first channel and the second channel can be determined according to the transmission bandwidth of the first channel and the second channel. For example, if the transmission bandwidth of the first channel is 5 and the transmission bandwidth of the second channel is 3, the average transmission bandwidth of the first channel and the second channel is (5+3) / 2=4.
[0112] Then, the average transmission amount of the first channel and the second channel is determined according to the average transmission bandwidth.
[0113] The data transmission volume is affected by the data compression rate and the transmission bandwidth, and can be expressed by the following formula: data transmission volume × data compression rate = transmission bandwidth. The data compression rate can be set according to actual needs, and the transmission bandwidth is measured by the Bluetooth sending device. Similarly, the average transmission volume of the first channel and the second channel can be calculated by the following formula: average transmission volume × data compression rate = average transmission bandwidth. For ease of description, the corresponding transmission volumes are still represented by 5, 3, and 4 in the above example.
[0114] Exemplarily, in the embodiment of the present application, the transmission bandwidth should be the Bluetooth audio bandwidth, and the Bluetooth audio bandwidth can be determined by the Bluetooth bandwidth, and the Bluetooth audio bandwidth is jointly affected by the Bluetooth transmitter and the Bluetooth receiver. Among them, the relationship between the Bluetooth audio bandwidth and the Bluetooth bandwidth can be expressed by the following formula: Bluetooth bandwidth × effective parameter = Bluetooth audio bandwidth. Among them, the effective parameter can be set according to actual needs. For example, the effective parameter is 0.7, and Bluetooth bandwidth × 0.7 = Bluetooth audio bandwidth.
[0115] It should be understood that in the above example, the data transmission volume can be determined according to the Bluetooth audio bandwidth, which can be specifically expressed as: data transmission volume × data compression rate = Bluetooth audio bandwidth. For ease of description, based on the relationship between Bluetooth bandwidth and Bluetooth audio bandwidth, the Bluetooth bandwidth and Bluetooth audio bandwidth are no longer distinguished below, and the two can be regarded as the same bandwidth.
[0116] After determining the average transmission amount, the amount of data that the first Bluetooth receiving device and the second Bluetooth receiving device need to receive can be determined. According to the above example, the amount of data that the first Bluetooth receiving device and the second Bluetooth receiving device need to receive can be expressed as 4.
[0117] 2. Splitting the second audio data according to the average transmission bandwidth.
[0118] According to the above content, the transmission bandwidth of the first channel is 5, and the transmission bandwidth of the second channel is 3. Among them, the amount of data that can be received by the first Bluetooth receiving device is 5, and the actual amount of data to be received is 4; the amount of data that can be received by the second Bluetooth receiving device is 3, and the actual amount of data to be received is 4. At this time, the second Bluetooth receiving device needs to receive 1 unit of data through the first Bluetooth receiving device, and the first Bluetooth receiving device can be regarded as a device for transferring and transmitting the 1 unit of data.
[0119] Based on this, the Bluetooth sending device needs to split the second audio data corresponding to the second channel so as to split the second audio data into two parts, which are transmitted through the first Bluetooth receiving device and the second Bluetooth receiving device respectively.
[0120] Exemplarily, the Bluetooth transmitting device may split the second audio data according to the average transmission bandwidth, wherein the data at the bit corresponding to the splitting number is determined as the low-order data to be transmitted in the second audio data, and the data other than the data at the bit corresponding to the splitting number is determined as the high-order data to be transmitted in the second audio data.
[0121] Optionally, the number of split digits is determined according to at least one of the following information:
[0122] The data volume of one frame of data corresponding to the second audio data;
[0123] Illustratively, the data size of one frame of data is determined according to the number of bits of the audio data. For example, if the second audio data is 32 bits, then the data size of one frame of data corresponding to the second audio data is 32 bits.
[0124] Audio compression rate;
[0125] Schematically, the audio compression rate is determined according to the audio resource and the compression algorithm. The audio resource is obtained by the Bluetooth sending device, and the compression algorithm is set according to actual needs.
[0126] The Bluetooth transmitting device can obtain the audio resource to be transmitted; perform PCM decoding on the audio resource to be transmitted to obtain the first audio data and the second audio data. For example, the Bluetooth transmitting device is a mobile phone, and the user selects a song to play on the mobile phone, and the mobile phone obtains the audio resource corresponding to the song; the mobile phone performs PCM decoding on the audio resource to obtain the first audio data and the second audio data.
[0127] The audio compression rate varies according to the encoding method. Generally, in the case of lossless audio compression encoding, the audio compression rate ranges from 50% to 100%; in the case of lossy audio compression encoding, the audio compression rate ranges from 5% to 100%. Optionally, the audio compression rate ranges from 50% to 80%. For example, according to the audio resources and compression algorithm, a 100M song is compressed into 60M, and the audio compression rate is 60%.
[0128] Optionally, the audio compression rate may be a compression rate corresponding to a lossless audio compression code, and the lossless audio compression code may be FLAC.
[0129] Average transmission bandwidth.
[0130] Schematically, the average transmission bandwidth is determined according to the transmission bandwidths of the first channel and the second channel, wherein the transmission bandwidths of the first channel and the second channel are measured by a Bluetooth transmitting device.
[0131] Based on the above information, the mapping relationship between the average transmission bandwidth and the number of split bits can be obtained, as shown below:
[0132] The data volume of one frame of data corresponding to the second audio data×audio compression rate×(total number of bits of the second audio data-number of splitting bits) / total number of bits of the second audio data<average transmission bandwidth.
[0133] The number of split bits is the number of bits that satisfies the above mapping relationship.
[0134] Take the second audio data as 32 bits. Then the data volume of one frame of data corresponding to the second audio data is 32 bits, the audio compression rate can be determined according to the audio resource and the compression algorithm corresponding to the first terminal, and the average transmission bandwidth is determined according to the transmission bandwidth of the first channel and the second channel. Then, according to the above mapping relationship, the number of split bits can be calculated.
[0135] For example, the number of splitting digits obtained by calculation is less than 3.9. Based on the fact that the number of splitting digits should be a positive integer, the calculated number of splitting digits can be rounded. Among them, rounding can be carried out in one of the following ways: rounding down, rounding up, and rounding off. For example, the number of splitting digits can be determined as the lower 3 digits or the lower 4 digits. Optionally, in order to achieve the best data transmission effect, the number of splitting digits is rounded off. Optionally, when the calculated number of splitting digits is less than 1, the number of splitting digits is determined to be the lower 1 digit.
[0136] 3. Coding and packaging.
[0137] According to the foregoing content, after splitting the second audio data, the Bluetooth sending device can split the second audio data into two parts, namely: high-order data to be transmitted in the second audio data and low-order data to be transmitted in the second audio data.
[0138] Subsequently, the Bluetooth transmitting device encodes the high-order data to be transmitted in the first audio data and the second audio data, and the low-order data to be transmitted in the second audio data, respectively, to obtain three corresponding coded packets. Taking the three coded packets obtained as coded packet 1, coded packet 2, and coded packet 3 as an example, coded packet 1 includes the first audio data, coded packet 2 includes the high-order data to be transmitted in the second audio data, and coded packet 3 includes the low-order data to be transmitted in the second audio data.
[0139] For example, the first audio data and the second audio data are both 32 bits, and the splitting bit is the lower 8 bits. Figure 4 A schematic diagram of data splitting provided by an exemplary embodiment of the present application is shown, wherein the coding packet 1 includes 32 bits of first audio data, the coding packet 2 includes the high 24 bits of audio data of the second audio data, and the coding packet 3 includes the low 8 bits of low-order data to be transmitted in the second audio data.
[0140] Referring to the above example, the transmission bandwidth of the first channel is 5, the transmission bandwidth of the second channel is 3, and the average transmission bandwidth is 4. The second Bluetooth receiving device needs to receive 1 unit of data through the first Bluetooth receiving device.
[0141] Correspondingly, the Bluetooth sending device sends 5 units of data to the first Bluetooth receiving device, 4 units of data are used to transmit the first audio data, and 1 unit of data is used to send the low-order data to be transmitted in the second audio data; the Bluetooth sending device sends 3 units of data to the second Bluetooth receiving device, and 3 units of data are used to transmit the high-order data to be transmitted in the second audio data.
[0142] According to the above example, the 5 units of data sent by the Bluetooth transmitting device to the first Bluetooth receiving device are: 4 units of data are used to transmit the 32-bit first audio data (i.e., the data in the encoding package 1), and 1 unit of data is used to transmit the lower 8 bits of the second audio data (i.e., the data in the encoding package 3). The Bluetooth transmitting device sends 3 units of data to the second Bluetooth receiving device for transmitting the upper 24 bits of the second audio data (i.e., the data in the encoding package 2).
[0143] Based on this, the Bluetooth sending device can combine code package 1 and code package 3 to obtain the first audio code package, and determine code package 2 as the second audio code package. Then, the first audio code package is sent to the first Bluetooth receiving device, and the second audio code package is sent to the second Bluetooth receiving device.
[0144] In an optional implementation scenario, after receiving the first audio encoding package, the first Bluetooth receiving device can unpack it and send the encoding package 2 to the second Bluetooth receiving device, so that the second Bluetooth receiving device can obtain the lower 8 bits of the second audio data.
[0145] Taking the transmission bandwidth of the first channel as 5 and the transmission bandwidth of the second channel as 3 as an example, the data encoding method provided in the embodiment of the present application can make the total transmission bandwidth capacity of the two channels reach 8, thereby maximizing the utilization of the total transmission bandwidth.
[0146] To summarize, in the audio encoding method provided in the embodiment of the present application, by carrying the low-bit data to be transmitted in the second channel in the first audio encoding packet, the low-bit data to be transmitted in the second channel can be forwarded to the second Bluetooth receiving device via the first Bluetooth receiving device, thereby maximizing the utilization of the total transmission bandwidth of the first channel and the second channel.
[0147] Figure 5 A flowchart of a data decoding method provided by an exemplary embodiment of the present application is shown. The method is executed by a first Bluetooth receiving device, and the first Bluetooth receiving device corresponds to a first channel, and includes the following steps:
[0148] Step 302: Receive a first audio coding packet.
[0149] Illustratively, the first audio coding packet includes at least data to be transmitted in the first audio data corresponding to the first channel and low-bit data to be transmitted in the second audio data corresponding to the second channel.
[0150] Among them, the relevant descriptions of the first audio data, the second audio data, and the first audio coding packet can refer to the aforementioned content and will not be repeated here.
[0151] In an optional implementation scenario, if the transmission of the first sub-packet and / or the second sub-packet fails, the Bluetooth transmitting device may transmit the first sub-packet and / or the second sub-packet to the first Bluetooth receiving device again. For example, if the transmission of the first sub-packet fails, the Bluetooth transmitting device may retransmit the first sub-packet to the first Bluetooth receiving device.
[0152] Step 304: Decode the first audio coding packet to obtain third audio data.
[0153] Illustratively, the number of bits of the third audio data is the same as the number of bits of the first audio data.
[0154] According to the foregoing content, the first audio coding packet optionally includes a first sub-packet and a second sub-packet, the first sub-packet includes the data to be transmitted in the first audio data, and the second sub-packet includes the low-bit data to be transmitted in the second audio data. After acquiring the first audio code, the first Bluetooth receiving device can unpack the first audio coding packet to obtain the first sub-packet and the second sub-packet.
[0155] Subsequently, the first Bluetooth receiving device may decode the first sub-packet to obtain decoded audio data, and the decoded audio data may be PCM data; the first Bluetooth receiving device may determine the third audio data according to the decoded audio data.
[0156] According to the above content, the Bluetooth sending device can determine whether to perform high-order interception on the first audio data. Based on this, there are two implementation methods for determining the third audio data according to the decoded audio data:
[0157] 1. The Bluetooth sending device does not intercept the high bits of the first audio data.
[0158] In a case where the first subpacket includes the first audio data, the first subpacket is decoded and the decoded audio data is determined as the third audio data.
[0159] 2. The Bluetooth sending device intercepts the high bits of the first audio data.
[0160] In a case where the first sub-packet includes data to be transmitted in the first audio data, decoding the first sub-packet, and determining the decoded audio data as first decoded data, where the first decoded data is audio data obtained after the Bluetooth sending device deletes low-bit data of the first audio data;
[0161] The third audio data is obtained by adding low-order data after the first decoded data, and the number of bits of the added low-order data is the same as the first number of bits of the low-order data deleted from the first audio data.
[0162] Among them, the process of the Bluetooth sending device deleting the low-bit data of the first audio data is the process of intercepting the high-bit of the first audio data; the determination of the first digit of the low-bit data deleted from the first audio data can refer to the method for determining the number of splitting digits.
[0163] Optionally, the first digit is determined according to at least one of the following information: the data volume of a frame of data corresponding to the first audio data; the audio compression rate; and the average transmission bandwidth of the first channel and the second channel.
[0164] Based on the above information, taking the first digit as i as an example, the following mapping relationship can be obtained:
[0165] The data volume of one frame of data corresponding to the first audio data×audio compression rate×(the total number of bits of the first audio data-i) / the total number of bits of the first audio data<the average transmission bandwidth.
[0166] The first digit is the number of digits that satisfies the above mapping relationship.
[0167] According to the above content, when the high bit of the first audio data is intercepted, the first sub-packet includes the data to be transmitted in the first audio data. After the first Bluetooth receiving device decodes the first sub-packet, the first decoded data obtained should be the data to be transmitted in the first audio data.
[0168] Among them, the first decoded data can also be understood as the audio data obtained after the Bluetooth sending device deletes the low-bit data of the first audio data. It should be understood that when decoding the first sub-packet, there is a slight difference between the decoded audio data and the original data, that is, there may be loss in the decoded audio data. Exemplarily, when the Bluetooth sending device performs lossless compression on the first sub-packet, the first decoded data obtained by the first Bluetooth receiving device is completely consistent with the data to be transmitted in the first audio data; when the Bluetooth sending device performs lossy compression on the first sub-packet, there is a slight difference between the first decoded data obtained by the first Bluetooth receiving device and the data to be transmitted in the first audio data, and the difference does not affect subsequent operations.
[0169] Subsequently, the first Bluetooth receiving device adds low-bit data after the first decoded data, so that the number of bits of the third audio data is the same as the number of bits of the first audio data, wherein the number of bits of the added low-bit data is the same as the first number.
[0170] Optionally, the first sub-packet carries first bit digit information, where the first bit digit information is used to indicate the first bit of low-bit data deleted from the first audio data.
[0171] Optionally, the data on the bits of the added low-order data are all zero; or, the data on the bits of the added low-order data are all one; or, the data on the bits of the added low-order data are either zero or one.
[0172] For example, the low-order data added after the first decoded data, the data on the bit positions of the added low-order data are all zero. For another example, the low-order data added after the first decoded data, the data with the same first digit in the first decoded data is determined as the added low-order data. For another example, the low-order data is added after the first decoded data, and each added low-order data is randomly assigned a value of zero or one.
[0173] Taking the first audio data as 32 bits as an example, Figure 6 FIG. 1 is a schematic diagram showing an audio transmission provided by an exemplary embodiment of the present application. Figure 6 In the encoding stage, the Bluetooth transmitting device deletes the low-order data of the first audio data, and the first digit of the low-order data deleted in the first audio data is the low 8 bits. In the decoding stage, the first Bluetooth receiving device decodes the first sub-packet to obtain 24-bit first decoded data; at the same time, according to the first digit information, the first Bluetooth receiving device determines that the first digit is the low 8 bits.
[0174] Subsequently, the first Bluetooth receiving device adds 8 low-order bits of low-order data after the 24-bit first decoded data, wherein the added low-order data are all zero, or the added low-order data are all one, or the first Bluetooth receiving device randomly assigns a value of zero or one to each of the added low-order bits of low-order data, or the first Bluetooth receiving device determines the low-order bits of low-order data of the 24-bit first decoded data as the low-order bits of low-order data added after the 24-bit first decoded data.
[0175] Optionally, after unpacking the first audio encoding packet, the first Bluetooth receiving device can obtain the first sub-packet and the second sub-packet; in order to enable the second Bluetooth receiving device corresponding to the second channel to obtain the low-bit data to be transmitted in the second audio data, the first Bluetooth receiving device can send the second sub-packet to the second Bluetooth receiving device.
[0176] To summarize, in the data decoding method provided in the embodiment of the present application, by receiving a first audio coding packet that includes at least data to be transmitted in the first audio data corresponding to the first channel and low-bit data to be transmitted in the second audio data, the first Bluetooth receiving device can decode the first audio coding packet to obtain third audio data with the same bit number as the first audio data.
[0177] Optionally, the first Bluetooth receiving device may also send the low-bit data to be transmitted in the second audio data to the second Bluetooth receiving device corresponding to the second channel to meet the transmission requirement of the second channel.
[0178] Figure 7 A flowchart of a data decoding method provided by an exemplary embodiment of the present application is shown. The method is executed by a second Bluetooth receiving device, and the second Bluetooth receiving device corresponds to a second channel, and includes the following steps:
[0179] Step 402: Receive a second audio coding packet.
[0180] Illustratively, the second audio coding packet includes high-order data to be transmitted in the second audio data corresponding to the second channel.
[0181] The relevant description of the second audio data and the second audio coding packet can be referred to the aforementioned content and will not be repeated here.
[0182] Step 404: Decode the second audio coding packet to obtain fourth audio data.
[0183] Illustratively, the number of bits of the fourth audio data is the same as the number of bits of the second audio data.
[0184] After acquiring the second audio encoding packet, the second Bluetooth receiving device decodes the second audio encoding packet to obtain decoded audio data. Optionally, the decoded audio data is PCM data.
[0185] It should be understood that when decoding the second audio coding packet, there is a slight difference between the decoded audio data and the original data, that is, there may be loss in the decoded audio data. Exemplarily, when the Bluetooth transmitting device performs lossless compression on the second audio coding packet, the decoded audio data obtained by the second Bluetooth receiving device is completely consistent with the high-bit data to be transmitted in the second audio data; when the Bluetooth transmitting device performs lossy compression on the second audio coding packet, there is a slight difference between the decoded audio data obtained by the second Bluetooth receiving device and the high-bit data to be transmitted in the second audio data, and the difference does not affect subsequent operations.
[0186] Subsequently, the second Bluetooth receiving device determines the fourth audio data based on the decoded audio data. It should be understood that the fourth audio data determined in different situations are different. For example, when the Bluetooth sending device does not perform high-bit interception on the second audio data, low-bit data is added after the decoded audio data to obtain the second audio data with the same number of bits as the second audio data, and the number of bits of the added low-bit data is the number of bits of the low-bit data to be transmitted in the second audio data included in the first audio coding packet.
[0187] Optionally, the second Bluetooth receiving device may also receive a second sub-packet sent by the first Bluetooth receiving device, where the second sub-packet is a sub-packet in the first audio encoding and includes low-bit data to be transmitted in the second audio data.
[0188] The second sub-packet has two possibilities: successful transmission and failed transmission. According to different situations, there are two implementation methods for determining the fourth audio data:
[0189] 1. The second sub-packet is transmitted successfully.
[0190] In the case where the second sub-packet is successfully transmitted, step 404 may be implemented as follows:
[0191] Decoding the second audio coding packet to obtain second decoded data;
[0192] Decoding the second sub-packet to obtain third decoded data;
[0193] Fourth audio data is determined based on the second decoded data and the third decoded data.
[0194] The second decoded data is the high-order data to be transmitted in the second audio data, and the third decoded data is the low-order data to be transmitted in the second audio data. Exemplarily, there is a time difference between decoding the second audio encoding packet and the second sub-packet, and the receiving time of the second audio encoding packet is earlier than the receiving time of the second sub-packet. For example, the second Bluetooth receiving device receives the second audio encoding packet and receives the second sub-packet 5ms later.
[0195] According to the above content, the Bluetooth sending device can determine whether to perform high-order interception on the second audio data. Based on this, there are two implementation methods for determining the fourth audio data according to the second decoded data and the third decoded data:
[0196] (1) The Bluetooth sending device does not intercept the high bits of the second audio data.
[0197] When the Bluetooth sending device does not delete the low-order data of the second audio data, the audio data obtained by arranging the second decoded data and the third decoded data according to the high and low orders of the second audio data is determined as the fourth audio data.
[0198] For example, the Bluetooth sending device splits the 32-bit second audio data, determines the lower 8-bit low-order data as the low-order data to be transmitted in the second audio data included in the second sub-packet, and the number of bits of the low-order data to be transmitted in the second audio data is the lower 8 bits. At the same time, the second audio coding packet includes the upper 24-bit high-order data of the second audio data.
[0199] Based on this, the second decoded data obtained by the second Bluetooth receiving device is the high-order data of the upper 24 bits in the second audio data, and the third decoded data is the low-order data of the lower 8 bits in the second audio data. Subsequently, the second Bluetooth receiving device sorts the second decoded data and the third decoded data according to the high and low bits of the second audio data to obtain the 32-bit fourth audio data.
[0200] (2) The Bluetooth sending device intercepts the high bits of the second audio data.
[0201] In the case where the Bluetooth sending device deletes the low-order data of the second audio data, the audio data obtained by arranging the second decoded data and the third decoded data according to the high and low orders of the second audio data is determined as the fifth audio data;
[0202] Low-order data is added after the fifth audio data to obtain fourth audio data, and the number of bits of the added low-order data is the same as the second number of bits of the low-order data deleted from the second audio data.
[0203] Among them, the determination of the second digit can refer to the method of determining the number of split digits.
[0204] Optionally, the second bit number is determined based on at least one of the following information: the data volume of one frame of data corresponding to the second audio data; the audio compression rate; and the average transmission bandwidth of the first channel and the second channel.
[0205] Based on the above information, taking the second digit as n as an example, the following mapping relationship can be obtained:
[0206] The data volume of one frame of data corresponding to the second audio data×audio compression rate×(the total number of bits of the second audio data-n) / the total number of bits of the second audio data<the average transmission bandwidth.
[0207] The second digit is the digit that satisfies the above mapping relationship.
[0208] Optionally, the second audio coding packet or the second sub-packet carries second bit information, where the second bit information is used to indicate the second bit of low-bit data deleted from the second audio data.
[0209] Optionally, the data on the bits of the added low-order data are all zero; or, the data on the bits of the added low-order data are all one; or, the data on the bits of the added low-order data are either zero or one.
[0210] Taking the second audio data as 32 bits, Figure 8 The schematic diagram of the audio transmission in which the second sub-packet is successfully transmitted is shown. In the encoding stage, the Bluetooth sending device intercepts the high bits of the 32-bit second audio data, retains the high-bit data of the upper 24 bits, and deletes the low-bit data of the lower 8 bits, so that the second digit is the lower 8 bits.
[0211] Subsequently, the Bluetooth sending device splits the 24-bit second audio data, determines the lower 8-bit low-order data as the low-order data to be transmitted in the second audio data included in the second sub-packet, and the number of bits of the low-order data to be transmitted in the second audio data is the lower 8 bits. At the same time, the second audio encoding packet includes the upper 16-bit high-order data of the second audio data.
[0212] Based on this, in the decoding stage, the second Bluetooth receiving device decodes the second audio encoding packet, and the second decoded data obtained is the high-order data of the upper 16 bits in the 24-bit second audio data, and the third decoded data obtained is the low-order data of the lower 8 bits in the 24-bit second audio data; the second sub-packet is decoded.
[0213] Subsequently, the second Bluetooth receiving device sorts the second decoded data and the third decoded data according to the high and low bits of the second audio data to obtain 24-bit fifth audio data. Based on the obtained 24-bit fifth audio data, the second Bluetooth receiving device adds the lower 8-bit low-order data after the 24-bit fifth audio data to obtain 32-bit fourth audio data.
[0214] 2. The second sub-packet transmission fails.
[0215] In the case where the second sub-packet transmission fails, step 404 may be implemented as follows:
[0216] In case that the transmission of the second sub-packet fails, decoding the second audio coding packet to obtain second decoded data;
[0217] Lower-order data is added after the second decoded data to obtain fourth audio data.
[0218] The second decoded data is high-order data to be transmitted in the second audio data.
[0219] According to the above content, the Bluetooth sending device can determine whether to perform high-order interception on the second audio data. Based on this, there are two implementation methods for determining the fourth audio data according to the second decoded data:
[0220] (1) The Bluetooth sending device does not intercept the high bits of the second audio data.
[0221] When the Bluetooth transmitting device does not delete the low-bit data of the second audio data, the low-bit data having the third digit is added after the second decoded data to obtain the fourth audio data;
[0222] The third bit number is the bit number of the low-bit data to be transmitted in the second audio data included in the second sub-packet.
[0223] According to the foregoing content, taking the second audio data being 32 bits as an example, when the Bluetooth sending device does not delete the low-bit data of the second audio data, the low-bit data to be transmitted in the second audio data should be the lower n bits of the 32-bit second audio data.
[0224] For example, if the low-order data to be transmitted in the second audio data is the low-order 8-bit data, then the third digit is the low-order 8-bit data. After decoding the second audio coding packet, the second Bluetooth receiving device obtains 24-bit second decoded data; and adds the low-order 8-bit data after the 24-bit second decoded data to obtain 32-bit fourth audio data.
[0225] Optionally, the data on the bits of the added low-order data are all zero; or, the data on the bits of the added low-order data are all one; or, the data on the bits of the added low-order data are either zero or one.
[0226] (2) The Bluetooth sending device intercepts the high bits of the second audio data.
[0227] When the Bluetooth transmitting device deletes the low-bit data of the second audio data, the low-bit data having the fourth digit is added after the second decoded data to obtain the fourth audio data;
[0228] The fourth bit is the sum of the number of bits of low-bit data to be transmitted in the second audio data included in the second sub-packet and the second bit of the low-bit data deleted in the second audio data.
[0229] The low-order data deleted from the second audio data is the low-order data deleted after the Bluetooth transmitting device intercepts the high-order data of the second audio data. For example, the Bluetooth transmitting device intercepts the high-order data of the 32-bit second audio data, retains the high-order data of the upper 24 bits, and deletes the low-order data of the lower 8 bits, so that the second digit is the lower 8 bits.
[0230] For determining the number of bits of the low-bit data to be transmitted in the second audio data and determining the second number of bits, reference may be made to the foregoing content and will not be repeated herein.
[0231] Optionally, the second bit number is determined based on at least one of the following information: the data volume of a frame of data corresponding to the second audio data; the audio compression rate; and the average transmission bandwidth of the first channel and the second channel.
[0232] Optionally, the second audio coding packet or the second sub-packet carries second bit information, where the second bit information is used to indicate the first bit of low-bit data deleted from the first audio data.
[0233] Optionally, the data on the bits of the added low-order data are all zero; or, the data on the bits of the added low-order data are all one; or, the data on the bits of the added low-order data are either zero or one.
[0234] Taking the second audio data as 32 bits, Fig. 9 The schematic diagram of the audio transmission in which the second sub-packet transmission fails is shown. In the encoding stage, the Bluetooth sending device intercepts the high bits of the 32-bit second audio data, retains the high-bit data of the upper 24 bits, and deletes the low-bit data of the lower 8 bits, so that the second digit is the lower 8 bits.
[0235] Subsequently, the Bluetooth sending device splits the 24-bit second audio data, determines the lower 8-bit low-order data as the low-order data to be transmitted in the second audio data included in the second sub-packet, and the number of bits of the low-order data to be transmitted in the second audio data is the lower 8 bits. At the same time, the second audio encoding packet includes the upper 16-bit high-order data of the second audio data.
[0236] Based on the above example, it can be concluded that the fourth digit is the sum of the deleted lower 8 bits and the lower 8 bits when split, that is, the lower 16 bits.
[0237] In the decoding stage, the second Bluetooth receiving device decodes the second audio coding packet to obtain 16-bit second decoded data; then, the second Bluetooth receiving device adds 16 low-bit data after the 16-bit second decoded data to obtain 32-bit fourth audio data.
[0238] In an optional implementation scenario, if the second sub-packet transmission fails, the first Bluetooth receiving device may send the second sub-packet to the second Bluetooth receiving device again to increase the possibility that the second Bluetooth receiving device obtains the low-bit data to be transmitted in the second audio data.
[0239] To sum up, in the data decoding method provided in the embodiment of the present application, the second Bluetooth receiving device can obtain the high-bit data to be transmitted in the second audio data corresponding to the second channel by receiving the second audio encoding packet, and thereby obtain the fourth audio data with the same number of bits as the second audio data.
[0240] Optionally, the second Bluetooth receiving device can also receive the second sub-packet sent by the first Bluetooth receiving device to obtain the low-bit data to be transmitted in the second audio data. The fourth audio data is obtained according to the second decoded data obtained from the second audio encoding packet and the third decoded data obtained from the second sub-packet.
[0241] Optionally, the second Bluetooth receiving device may further add low-bit data after the second decoded data to obtain fourth audio data having the same bit number as the second audio data.
[0242] Fig.10 A flowchart of a data transmission method provided by an exemplary embodiment of the present application is shown. The first Bluetooth receiving device and the second Bluetooth receiving device may constitute a Bluetooth system, the first Bluetooth receiving device corresponds to the first channel, and the second Bluetooth receiving device corresponds to the second channel. The method provided by the embodiment of the present application includes the following steps:
[0243] Step 501: Generate a first audio coding package and a second audio coding package.
[0244] Illustratively, the first audio coding packet includes at least data to be transmitted in the first audio data corresponding to the first channel and low-bit data to be transmitted in the second audio data corresponding to the second channel.
[0245] The related description of the first audio data and the second audio data can be referred to the aforementioned content and will not be repeated here.
[0246] Optionally, the first audio data and the second audio data are PCM data obtained after PCM decoding of the audio resource to be transmitted, wherein the first audio data is audio data corresponding to the first channel, and the second audio data is audio data corresponding to the second channel.
[0247] Illustratively, the first audio data and the second audio data involved in the embodiments of the present application are used to indicate all the data in the PCM data obtained after PCM decoding according to the audio resource. Among them, the first audio data can also be regarded as the initial PCM data corresponding to the first channel, and the second audio data can also be the initial PCM data corresponding to the second channel. Optionally, the initial PCM data can also be referred to as the original PCM data.
[0248] In an optional implementation scenario, the transmission bandwidths of the first channel and the second channel are different. For example, the following examples all take the case where the first channel is a high-bandwidth channel and the second channel is a low-bandwidth channel, and the data transmission volume corresponding to the first channel is greater than the data transmission volume corresponding to the second channel.
[0249] Optionally, when the average transmission bandwidth of the first channel and the second channel does not meet the transmission requirements, it is necessary to delete the low-order data of the first audio data and / or the second audio data, which can also be regarded as intercepting the high-order data of the first audio data and / or the second audio data to retain the high-order data of the first audio data and / or the second audio data as much as possible.
[0250] Among them, the relevant description of high-order interception can be referred to the above content and will not be repeated here.
[0251] Taking the case where the first channel is a high-bandwidth channel and the second channel is a low-bandwidth channel as an example, after splitting the second audio data, the Bluetooth sending device can carry the low-bit data to be transmitted in the second audio data in the first audio coding packet for transmission. In an optional implementation scenario, the low-bit data to be transmitted in the second audio data is forwarded to the second Bluetooth receiving device via the first Bluetooth receiving device, so that the low-bit data corresponding to the low-bandwidth channel can be forwarded with the help of the first Bluetooth receiving device corresponding to the high-bandwidth channel, thereby maximizing the total transmission bandwidth of the two channels.
[0252] Optionally, the first audio coding packet includes a first sub-packet and a second sub-packet, the first sub-packet includes at least the data to be transmitted in the first audio data, and the second sub-packet includes the high-order data to be transmitted in the second audio data. In this case, the first Bluetooth receiving device can unpack the first audio coding packet after receiving it, and then send the second sub-packet to the second Bluetooth receiving device.
[0253] Among them, the process of data splitting, encoding and packaging the second audio data by the Bluetooth sending device can refer to the above content and will not be repeated here.
[0254] Step 502: The first Bluetooth receiving device receives a first audio coding packet sent by the Bluetooth sending device.
[0255] Illustratively, the first audio coding packet includes low-bit data of first audio data corresponding to the first channel and second audio data corresponding to the second channel.
[0256] Among them, the relevant descriptions of the first audio data, the second audio data, and the first audio coding packet can refer to the aforementioned content and will not be repeated here.
[0257] In an optional implementation scenario, if the transmission of the first sub-packet and / or the second sub-packet fails, the Bluetooth transmitting device may transmit the first sub-packet and / or the second sub-packet to the first Bluetooth receiving device again. For example, if the transmission of the first sub-packet fails, the Bluetooth transmitting device may retransmit the first sub-packet to the first Bluetooth receiving device.
[0258] Step 503: The first Bluetooth receiving device decodes the first audio encoding packet to obtain third audio data.
[0259] Illustratively, the number of bits of the third audio data is the same as the number of bits of the first audio data.
[0260] According to the foregoing, the first audio encoding packet may optionally include a first sub-packet and a second sub-packet. The first Bluetooth receiving device may obtain the first sub-packet by unpacking; then, the first Bluetooth receiving device may decode the first sub-packet to obtain decoded audio data, which may be PCM data; and the first Bluetooth receiving device may determine the third audio data based on the decoded audio data.
[0261] According to the above content, the Bluetooth sending device can determine whether to perform high-order interception on the first audio data. Based on this, there are two implementation methods for determining the third audio data according to the decoded audio data. Among them, the two implementation methods can refer to step 304 and will not be repeated.
[0262] After unpacking the first audio encoding packet, the first Bluetooth receiving device can obtain the second sub-packet. Optionally, the first Bluetooth receiving device can send the second sub-packet to the second Bluetooth receiving device to facilitate the transmission of the low-bit data to be transmitted in the second audio data to meet the transmission requirements of the second channel.
[0263] Step 504: The second Bluetooth receiving device receives the second audio coding packet sent by the Bluetooth sending device.
[0264] Illustratively, the second audio coding packet includes high-order data to be transmitted in the second audio data corresponding to the second channel.
[0265] The relevant description of the second audio data and the second audio coding packet can be referred to the aforementioned content and will not be repeated here.
[0266] Step 505: The second Bluetooth receiving device decodes the second audio encoding packet to obtain fourth audio data.
[0267] Illustratively, the number of bits of the fourth audio data is the same as the number of bits of the second audio data.
[0268] After acquiring the second audio encoding packet, the second Bluetooth receiving device decodes the second audio encoding packet to obtain decoded audio data. Optionally, the decoded audio data is PCM data.
[0269] Subsequently, the second Bluetooth receiving device determines fourth audio data according to the decoded audio data.
[0270] Optionally, the second Bluetooth receiving device may also receive a second sub-packet sent by the first Bluetooth receiving device, where the second sub-packet is a sub-packet in the first audio encoding and includes low-bit data to be transmitted in the second audio data.
[0271] According to the foregoing content, there are two possibilities for the second sub-packet: successful transmission or failed transmission.
[0272] Among them, when the second sub-packet is transmitted successfully, the second Bluetooth receiving device can obtain second decoded data by decoding the second audio encoding packet, obtain third decoded data by decoding the second sub-packet, and then determine the fourth audio data according to the second decoded data and the third decoded data.
[0273] According to the above content, the Bluetooth sending device can determine whether to perform high-order interception on the first audio data. Based on this, there are two implementation methods for determining the fourth audio data according to the second decoded data and the third decoded data. The two implementation methods can refer to step 404 and will not be repeated here.
[0274] In the case where the transmission of the second sub-packet fails, the second Bluetooth receiving device may decode the second audio coding packet to obtain second decoded data; and add low-bit data after the second decoded data to obtain fourth audio data.
[0275] According to the above content, the Bluetooth sending device can determine whether to perform high-order interception on the first audio data. Based on this, there are two implementation methods for determining the fourth audio data according to the second decoded data. The two implementation methods can refer to step 404 and will not be described in detail.
[0276] Taking the first audio data and the second audio data both as 32 bits as an example, Fig.11 A schematic diagram of audio transmission provided by an exemplary embodiment of the present application is shown.
[0277] First, the Bluetooth sending device intercepts the high bits of the first audio data and the second audio data, deletes the lower 8 bits of low-bit data, and retains the upper 24 bits of high-bit data, thereby obtaining 24 bits of first audio data and 24 bits of second audio data respectively.
[0278] Secondly, the Bluetooth transmitting device encodes the 24-bit first audio data to obtain a first sub-packet, wherein the first sub-packet includes the high-order data of the high-order 24 bits of the 32-bit first audio data.
[0279] Subsequently, the Bluetooth transmitting device splits the 24-bit second audio data, determines the lower 8 bits of the 24-bit second audio data as the lower bits to be transmitted, and encodes them to obtain a second sub-packet, and encodes the upper 16 bits of the 24-bit second audio data to obtain a second audio encoding packet. For the convenience of transmission, the Bluetooth transmitting device combines the first sub-packet and the second sub-packet to obtain a first audio encoding packet.
[0280] After completing the encoding and packetization, the Bluetooth transmitting device sends the first audio encoding packet to the first Bluetooth receiving device, and sends the second audio encoding packet to the second Bluetooth receiving device. The first Bluetooth receiving device unpacks the first audio encoding packet to obtain the first sub-packet and the second sub-packet, and the first Bluetooth receiving device sends the second sub-packet to the second Bluetooth receiving device.
[0281] Then, the first Bluetooth receiving device decodes the first sub-packet to obtain 24-bit audio data, which is the high-order data of the upper 24 bits of the 32-bit first audio data; after the second Bluetooth receiving device decodes the second sub-packet and the second audio encoding packet respectively, the decoded audio data is sorted in order of high and low bits, and 24-bit audio data can also be obtained, which is the high-order data of the upper 24 bits of the 32-bit second audio data.
[0282] Finally, the first Bluetooth receiving device and the second Bluetooth receiving device respectively add 8 low-bit data after the 24-bit audio data to obtain 32-bit audio data.
[0283] It should be understood that in the embodiments of the present application, the steps on the Bluetooth sending device side can independently become an embodiment of the data encoding method, and the first Bluetooth receiving device side and the second Bluetooth receiving device side can independently become an embodiment of the data decoding method. The specific explanation of the data encoding method and the data decoding method steps can refer to the above content.
[0284] To summarize, in the data transmission method provided in the embodiment of the present application, by carrying the low-bit data of the second channel in the first audio coding packet, the low-bit data to be transmitted in the second channel can be forwarded to the second Bluetooth receiving device via the first Bluetooth receiving device, thereby maximizing the utilization of the total transmission bandwidth of the first channel and the second channel.
[0285] exist Fig.10 On the basis of Fig.12 The flowchart of a data transmission method provided by an exemplary embodiment of the present application is shown. Among them, step 501 can be implemented as steps 5011-5015; step 503 can be implemented as steps 5031 and 5032; the data transmission method provided by the present application also includes step 506. In the case of including step 506, step 505 can be implemented as steps 5051 and 5052. The details are as follows:
[0286] Step 5011: The Bluetooth sending device encodes the data to be transmitted in the first audio data to obtain a first sub-packet.
[0287] According to the foregoing, before encoding the data to be transmitted in the first audio data, the Bluetooth sending device can determine whether to perform high-bit interception on the first audio data. Exemplarily, the Bluetooth sending device measures the Bluetooth bandwidth corresponding to the first channel and the second channel, and then calculates the average transmission bandwidth. When the average transmission bandwidth meets the transmission requirements of the first audio data, the first audio data is not intercepted at a high bit; when the average transmission bandwidth does not meet the transmission requirements of the first audio data, the first audio data is intercepted at a high bit to obtain the first audio data after high-bit interception.
[0288] It should be understood that the encoding of the first audio data can be performed according to the high-bit truncation in the aforementioned content. If the high-bit truncation is not performed on the first audio data, the first audio data is encoded as the data to be transmitted to obtain the first sub-packet; if the high-bit truncation is performed on the first audio data, the first audio data after the high-bit truncation is encoded as the data to be transmitted to obtain the first sub-packet.
[0289] Optionally, step 5011 may be implemented as follows:
[0290] Encoding the first audio data as data to be transmitted to obtain a first sub-packet;
[0291] or,
[0292] According to the transmission bandwidth corresponding to the first sound channel, the low-order data of the first audio data is deleted; and the deleted first audio data is encoded as the data to be transmitted to obtain a first sub-packet.
[0293] Take the first audio data of 32 bits as an example. If the high bits of the first audio data are not truncated, the 32-bit first audio data is directly encoded to obtain the first sub-packet, and the first sub-packet includes the 32-bit first audio data. If the high bits of the first audio data are truncated, the low-bit data of the low i bits are deleted to obtain the first audio data with the low i bits deleted; then the low i bits of the first audio data are encoded to obtain the first sub-packet, and the first sub-packet includes the high-bit data of the high 32-i bits of the first audio data.
[0294] For example, the lower 8 bits of the 32-bit first audio data are deleted to obtain the 24-bit first audio data. Subsequently, the 24-bit first audio data is encoded to obtain a first sub-packet, which includes the upper 24 bits of the 32-bit first audio data.
[0295] Among them, the relevant description of the first bit of the low-bit data deleted from the first audio data can be referred to the above content and will not be repeated here.
[0296] Optionally, the first digit is determined based on at least one of the following information: the amount of data in a frame corresponding to the first audio data; the audio compression rate; and the average transmission bandwidth of the first channel and the second channel.
[0297] Optionally, the first sub-packet carries first bit digit information, where the first bit digit information is used to indicate the first bit of low-bit data deleted from the first audio data.
[0298] Step 5012: The Bluetooth sending device splits the second audio data to determine the low-order data and the high-order data to be transmitted in the second audio data.
[0299] Similar to the encoding of the first audio data, the Bluetooth sending device may first determine whether to perform high-bit interception on the second audio data, and then perform data splitting on the second audio data that has not been subjected to high-bit interception or has been subjected to high-bit interception.
[0300] Among them, if the second audio data is not intercepted at a high position, the Bluetooth sending device can directly split the second audio data to determine the low-order data and high-order data to be transmitted in the second audio data. If the second audio data is intercepted at a high position, the Bluetooth sending device needs to split the second audio data after the high-order interception, and the low-order data and high-order data to be transmitted in the obtained second audio data should also be for the second audio data after the high-order interception.
[0301] Take the second audio data as 32 bits as an example. Among them, if the second audio data is not intercepted at high bits, the Bluetooth sending device splits the 32-bit second audio data, and the low-bit data and high-bit data to be transmitted in the obtained second audio data should be the low-bit data and high-bit data corresponding to the 32-bit second audio data. If the second audio data is intercepted at high bits, the low-bit data of the lower n bits are deleted, and the second audio data with the lower n bits deleted is obtained, then the Bluetooth sending device splits the second audio data with the lower n bits deleted, and the low-bit data and high-bit data to be transmitted in the obtained second audio data should be the low-bit data and high-bit data corresponding to the second audio data with the lower n bits deleted.
[0302] Optionally, step 5012 may be implemented as follows:
[0303] Deleting low-order data of the second audio data according to a transmission bandwidth corresponding to the second sound channel;
[0304] The deleted second audio data is split into data to determine the low-order data and the high-order data to be transmitted in the deleted second audio data.
[0305] Illustratively, deleting the low-bit data of the second audio data can also be understood as intercepting the high-bit of the second audio data, deleting the low-bit data of the second audio data of the lower n bits, retaining the high-bit data of the second audio data, and obtaining the deleted second audio data.
[0306] Optionally, the second bit number of the low-bit data deleted from the second audio data is determined based on at least one of the following information: the data volume of a frame of data corresponding to the second audio data; the audio compression rate; and the average transmission bandwidth of the first channel and the second channel.
[0307] Optionally, the second audio coding packet or the second sub-packet carries second bit information, where the second bit information is used to indicate the second bit of low-bit data deleted from the second audio data.
[0308] Among them, the relevant description of deleting the low-order data of the second audio data can be referred to the above content and will not be repeated here.
[0309] Schematically, the data splitting of the second audio data can be determined according to the transmission bandwidth of the first channel and the second channel. Taking the case where the first channel is a high-bandwidth channel and the second channel is a low-bandwidth channel as an example, the data transmission volume corresponding to the first channel will be greater than the data transmission volume corresponding to the second channel. In an optional implementation scenario, the data transmission volume corresponding to the second channel cannot transmit all the data of the second audio data, and the data transmission volume corresponding to the first channel, in addition to transmitting the first audio data, still has a certain amount of bandwidth that can carry data, and this part of the bandwidth is idle. At this time, in order to maximize the utilization of the total transmission bandwidth of the first channel and the second channel, the amount of data that cannot be transmitted in the second channel can be transmitted through the first channel.
[0310] Optionally, step 5012 may be implemented as follows:
[0311] In the case that the transmission bandwidths of the first channel and the second channel are different, the second audio data is split to determine the low-order data and the high-order data to be transmitted in the second audio data.
[0312] The different transmission bandwidths can also be understood as different transmission bandwidth capabilities of the first channel and the second channel. For example, the transmission bandwidth capability of the first channel is 5, and the transmission bandwidth capability of the second channel is 3. In this case, the first channel can be regarded as a high-bandwidth channel, and the second channel can be regarded as a low-bandwidth channel, and the data transmission volume corresponding to the first channel will be greater than the data transmission volume corresponding to the second channel.
[0313] According to the foregoing content, when the transmission bandwidths of the first channel and the second channel are different, the audio data corresponding to the second channel can be split according to the average transmission bandwidths of the first channel and the second channel to determine the low-order data and the high-order data to be transmitted in the second audio data.
[0314] The Bluetooth transmitting device measures the Bluetooth bandwidth of the first channel and the second channel, and calculates the average transmission bandwidth according to the transmission bandwidth of the first channel and the second channel. For example, if the transmission bandwidth capability of the first channel is 5 and the transmission bandwidth capability of the second channel is 3, the average transmission bandwidth of the first channel and the second channel should be (5+3) / 2=4.
[0315] According to the above content, the audio data corresponding to the second channel can be split according to the average transmission bandwidth of the first channel and the second channel, which can be specifically implemented as follows:
[0316] Determine the average transmission amount of the first channel and the second channel according to the average transmission bandwidth;
[0317] The audio data corresponding to the second channel is split according to the average transmission amount to determine the low-order data and the high-order data to be transmitted in the second audio data.
[0318] The data transmission volume is affected by the data compression rate and the transmission bandwidth, and can be expressed by the following formula: data transmission volume × data compression rate = transmission bandwidth. The data compression rate can be set according to actual needs, and the transmission bandwidth is measured by the Bluetooth sending device. Similarly, the average transmission volume of the first channel and the second channel can be calculated by the following formula: average transmission volume × data compression rate = average transmission bandwidth. For ease of description, the corresponding transmission volumes are still represented by 5, 3, and 4 in the above example.
[0319] It should be understood that the transmission bandwidth should be the Bluetooth audio bandwidth, and the Bluetooth audio bandwidth is determined by the Bluetooth bandwidth. For details, please refer to the above content and will not be repeated here.
[0320] After determining the average transmission amount, the amount of data that the first Bluetooth receiving device and the second Bluetooth receiving device need to receive can be determined. According to the above example, the amount of data that the first Bluetooth receiving device and the second Bluetooth receiving device need to receive can be expressed as 4.
[0321] Optionally, the splitting of the audio data corresponding to the second channel according to the average transmission bandwidth may also be specifically implemented as follows:
[0322] According to the average transmission bandwidth, the data on the bit positions corresponding to the number of splitting bits are determined as the low-order data to be transmitted in the second audio data, and the data other than the data on the bit positions corresponding to the number of splitting bits are determined as the high-order data to be transmitted in the second audio data.
[0323] According to the above example, the transmission bandwidth of the first channel is 5, and the transmission bandwidth of the second channel is 3. Among them, the amount of data that can be received by the first Bluetooth receiving device is 5, and the actual amount of data to be received is 4; the amount of data that can be received by the second Bluetooth receiving device is 3, and the actual amount of data to be received is 4. At this time, the second Bluetooth receiving device needs to receive 1 unit of data through the first Bluetooth receiving device, and the first Bluetooth receiving device can be regarded as a device for transferring and transmitting the 1 unit of data.
[0324] Based on this, the Bluetooth sending device needs to split the second audio data corresponding to the second channel so as to split the second audio data into two parts, which are transmitted through the first Bluetooth receiving device and the second Bluetooth receiving device respectively.
[0325] Exemplarily, the Bluetooth transmitting device may split the second audio data according to the average transmission bandwidth, wherein the data at the bit corresponding to the splitting number is determined as the low-order data to be transmitted in the second audio data, and the data other than the data at the bit corresponding to the splitting number is determined as the high-order data to be transmitted in the second audio data.
[0326] Optionally, the number of splitting bits is determined based on at least one of the following information: the data volume of one frame of data corresponding to the second audio data; the audio compression rate; and the average transmission bandwidth.
[0327] Exemplarily, the average transmission bandwidth and the number of split bits have the following mapping relationship:
[0328] The data volume of one frame of data corresponding to the second audio data×audio compression rate×(total number of bits of the second audio data-number of splitting bits) / total number of bits of the second audio data<average transmission bandwidth.
[0329] The number of split bits is the number of bits that satisfies the above mapping relationship.
[0330] Take the second audio data as 32 bits. Then the data volume of one frame of data corresponding to the second audio data is 32 bits, the audio compression rate can be determined according to the audio resource and the compression algorithm corresponding to the first terminal, and the average transmission bandwidth is determined according to the transmission bandwidth of the first channel and the second channel. Then, according to the above mapping relationship, the number of split bits can be calculated.
[0331] For the related description on determining the number of split digits, please refer to the above content and will not be repeated here.
[0332] exist Figure 1 On the basis of Fig.13 A schematic diagram of audio transmission provided by an exemplary embodiment of the present application is shown. Fig.14 A schematic diagram of audio transmission provided by an exemplary embodiment of the present application is shown.
[0333] Among them, after adopting the data encoding method provided in the embodiment of the present application, the following steps are added in the encoding process: data splitting of the second audio data.
[0334] This step is performed by a Bluetooth sending device.
[0335] Exemplarily, after PCM decoding of the audio resource, the Bluetooth transmitting device determines the obtained PCM data as the first audio data and the second audio data according to the first channel and the second channel. Subsequently, the Bluetooth transmitting device splits the second audio data so as to carry the low-bit data to be transmitted in the second audio data in the first audio coding packet transmitted in the first channel for transmission.
[0336] refer to Fig.14, the Bluetooth transmitting device is located on the left side of the human head, then the Bluetooth signal strength of the first Bluetooth receiving device located on the left side will be greater than the Bluetooth strength of the second Bluetooth receiving device. Assuming that the left channel is the first channel and the right channel is the second channel, the transmission capacity of the first channel will be greater than the transmission capacity of the second channel.
[0337] Still referring to the above example, the transmission bandwidth of the first channel is 5, and the transmission bandwidth of the second channel is 3. Assuming that the data volume of the first audio data and the second audio data are both 4, after adopting the data encoding method provided in the embodiment of the present application, the Bluetooth sending device splits the second audio data into 3 units of data volume and 1 unit of data volume respectively; then, the Bluetooth sending device encodes the 1 unit of data volume and sends it to the first Bluetooth receiving device together with the encoded packet of the first audio data (4 units of data volume), and encodes the 3 units of data volume and sends it to the second Bluetooth receiving device.
[0338] That is, the Bluetooth transmitting device sends 5 units of data to the first Bluetooth receiving device and 3 units of data to the second Bluetooth receiving device. Subsequently, the first Bluetooth receiving device sends 1 unit of data to the second Bluetooth receiving device, so that the second Bluetooth receiving device can obtain 3+1=4 units of data.
[0339] Therefore, reference Fig.13 and Fig.14 By adopting the data transmission method provided in the embodiment of the present application, the total transmission bandwidth of the first channel and the second channel can be maximized.
[0340] Step 5013: The Bluetooth sending device encodes the low-order data to be transmitted in the second audio data to obtain a second sub-packet.
[0341] Taking the second audio data as 32 bits and the number of split bits as the lower 8 bits as an example, the data on the bit positions corresponding to the lower 8 bits can be determined as the low-order data to be transmitted in the second audio data, and the other data in the second audio data except the data on the bit positions corresponding to the lower 8 bits can be determined as the high-order data to be transmitted in the second audio data.
[0342] Subsequently, the Bluetooth sending device encodes the lower 8 bits of the 32-bit second audio data to obtain a second sub-packet.
[0343] Step 5014: The Bluetooth sending device encodes the high-order data to be transmitted in the second audio data to obtain a second audio encoding packet.
[0344] According to the above example, the Bluetooth sending device determines the other data in the second audio data except the data on the bit corresponding to the lower 8 bits as the high-order data to be transmitted in the second audio data. That is, after splitting the second audio data, the high-order data to be transmitted in the second audio data obtained should be the high-order data of the upper 24 bits in the 32-bit second audio data.
[0345] Subsequently, the Bluetooth sending device encodes the high-order data of the upper 24 bits of the 32-bit second audio data to obtain a second audio encoding packet.
[0346] Step 5015: The Bluetooth sending device combines the first sub-packet and the second sub-packet to obtain a first audio coding packet.
[0347] For the convenience of transmission, after encoding the first sub-packet and the second sub-packet, the Bluetooth transmitting device may group them to obtain the first audio encoding packet. To further explain the generation of the first audio encoding packet, Fig.15 A flow chart of a data encoding method provided by an exemplary embodiment of the present application is shown, and the method is executed by a Bluetooth sending device.
[0348] The Bluetooth sending device first measures the Bluetooth bandwidth of the second channel to obtain an average transmission bandwidth of the second channel, and then determines whether the transmission bandwidth meets the transmission requirement of the second audio data.
[0349] When the transmission bandwidth meets the transmission requirements of the second audio data, the Bluetooth sending device retains all the data of the second audio data. When the transmission bandwidth does not meet the transmission requirements of the second audio data, the Bluetooth sending device splits the second audio data to obtain the low-order data and the high-order data to be transmitted in the second audio data.
[0350] Among them, the data splitting of the second audio data can refer to the relevant description in step 5012.
[0351] Subsequently, the Bluetooth transmitting device encodes the low-order data to be transmitted in the second audio data to obtain a second sub-packet. In addition, the Bluetooth transmitting device encodes the first audio data to obtain a first audio encoding packet. Finally, the Bluetooth transmitting device combines the first sub-packet with the second sub-packet to obtain a first audio encoding packet, and sends it to the first Bluetooth receiving device.
[0352] For example, the transmission bandwidth of the first channel is 5 and the transmission bandwidth of the second channel is 3. Fig.16 A schematic diagram of audio transmission provided by an exemplary embodiment of the present application is shown.
[0353] According to the average transmission bandwidth of the first channel and the second channel, the average data volume of the second audio data to be transmitted by the second channel is 4, and the transmission bandwidth of the second channel 3 cannot meet the transmission requirements of the second audio data. At this time, the Bluetooth sending device needs to split the second audio data.
[0354] Exemplarily, the Bluetooth sending device splits the 4 units of data in the second audio data into two parts, corresponding to 3 units of data and 1 unit of data respectively. After encoding the 1 unit of data, it is packaged into the encoding package of the first audio data. Based on this, the 1 unit of data that should be transmitted in the second channel can be transmitted through the second channel.
[0355] To further clarify the first audio code packet and the second audio code, Fig.17 A schematic diagram showing a first audio coding packet format provided by an exemplary embodiment of the present application is shown. Fig.18 A schematic diagram of a second audio coding packet format provided by an exemplary embodiment of the present application is shown.
[0356] Indicative, reference Fig.17 The first audio coding packet includes a header part and a data part.
[0357] The header includes the following information:
[0358] The first channel Header: contains the original header information of the codec.
[0359] Left and right channel bandwidth unequal flag: also called the first bandwidth flag, used to indicate that the transmission bandwidths of the first channel and the second channel are different. For example, 1 means unequal, and 0 means equal.
[0360] High-bandwidth channel flag: It can also be called the second bandwidth flag, which is used to indicate that the transmission bandwidth of the first channel is higher than the transmission bandwidth of the second channel. For example, 1 represents high bandwidth and 0 represents low bandwidth. In the embodiment of the present application, the first channel is a high-bandwidth channel, and the high-bandwidth channel flag is 1.
[0361] Time sequence code: a time information mark used to indicate the first audio coding packet, which can be used for time synchronization and correct identification during packet assembly.
[0362] Verification code of the first channel: verify the data of the first channel to verify the integrity of the first channel packet.
[0363] The low-order data packet check code of the second channel is used to implement the integrity verification of the low-order data packet of the second channel.
[0364] Total packet check code of the first channel: check code of the first audio coding packet, used to implement integrity verification of the first audio coding packet.
[0365] Illustratively, the data portion of the first audio coding packet includes the following information: a data packet of the first channel; and a low-order data packet of the second channel.
[0366] Indicative, reference Fig.18 The second audio coding packet includes a header part and a data part.
[0367] The header includes the following information:
[0368] The second channel Header: contains the original header information of the codec.
[0369] Left and right channel bandwidth unequal flag: also called the first bandwidth flag, used to indicate that the transmission bandwidths of the first channel and the second channel are different. For example, 1 means unequal, and 0 means equal.
[0370] High bandwidth channel flag: It can also be called the third bandwidth flag, which is used to indicate that the transmission bandwidth of the second channel is lower than the transmission low bandwidth of the first channel. For example, 1 is high bandwidth and 0 is low bandwidth; in the embodiment of the present application, the second channel is a low bandwidth channel, and the low bandwidth channel flag is 0.
[0371] Time sequence code: a time information mark used to indicate the second audio coding packet, which can be used for time synchronization and correct identification during packet assembly.
[0372] The check code of the high-order data packet of the second audio data is used to implement integrity verification of the high-order data packet of the second audio data.
[0373] Illustratively, the data portion of the second audio encoding packet includes a high-order data packet of the second audio data.
[0374] Optionally, the first audio coding packet includes at least one of the following information: a first bandwidth identifier; a second bandwidth identifier. Optionally, the second audio coding packet includes at least one of the following information: a first bandwidth identifier; a third bandwidth identifier.
[0375] According to the foregoing, the first audio coding packet may optionally include a first sub-packet and a second sub-packet, wherein the first sub-packet includes at least the data to be transmitted in the first audio data, and the second sub-packet includes the high-order data to be transmitted in the second audio data. At this time, the first Bluetooth receiving device may unpack the first audio coding packet after receiving it, and then send the second sub-packet to the second Bluetooth receiving device.
[0376] Based on this, the first Bluetooth receiving device may perform steps 5031 and 5032, as follows:
[0377] Step 5031: The first Bluetooth receiving device unpacks the first audio coding packet to obtain a first sub-packet and a second sub-packet.
[0378] Illustratively, the first sub-packet includes at least the data to be transmitted in the first audio data, and the second sub-packet includes the low-bit data to be transmitted in the second audio data.
[0379] Among them, the relevant descriptions of the data to be transmitted in the first audio data and the low-bit data to be transmitted in the second audio data can be referred to the above content and will not be repeated here.
[0380] refer to Fig.17 , Fig.19 A schematic diagram of a first sub-packet format provided by an exemplary embodiment of the present application is shown. Schematically, the first sub-packet includes a header portion and a data portion.
[0381] The header includes the following information:
[0382] The first channel Header: contains the original header information of the codec.
[0383] Left and right channel bandwidth unequal flag: also called the first bandwidth flag, used to indicate that the transmission bandwidths of the first channel and the second channel are different. For example, 1 means unequal, and 0 means equal.
[0384] High-bandwidth channel flag: It can also be called the second bandwidth flag, which is used to indicate that the transmission bandwidth of the first channel is higher than the transmission bandwidth of the second channel. For example, 1 represents high bandwidth and 0 represents low bandwidth. In the embodiment of the present application, the first channel is a high-bandwidth channel, and the high-bandwidth channel flag is 1.
[0385] Time sequence code: a time information mark used to indicate the first audio coding packet, which can be used for time synchronization and correct identification during packet assembly.
[0386] The low-order data packet check code of the second channel is used to implement the integrity verification of the low-order data packet of the second channel.
[0387] The data portion of the first audio coding packet includes the following low-order data packet of the second channel.
[0388] refer to Fig.13 After adopting the data decoding method provided in the embodiment of the present application, the following steps are added to the decoding process: unpacking of the first audio coding packet.
[0389] Wherein, this step is performed by the first Bluetooth receiving device.
[0390] Exemplarily, the first Bluetooth receiving device receives the first audio coding packet sent by the Bluetooth sending device through the first receiving component; then, the first Bluetooth receiving device unpacks the first audio coding packet to obtain a first sub-packet and a second sub-packet.
[0391] The first sub-packet is PCM-decoded by the first Bluetooth receiving device, and the third audio data having the same number of bits as the first audio data is determined based on the obtained PCM data, and the determination of the third audio data is carried out in step 5032. In addition, the second sub-packet is sent by the first Bluetooth receiving device to the second receiving component of the second Bluetooth receiving device through the first sending component, so that the second Bluetooth receiving device can obtain the audio data to be transmitted in the second audio data.
[0392] Step 5032: The first Bluetooth receiving device decodes the first sub-packet to obtain third audio data.
[0393] Illustratively, the number of bits of the third audio data is the same as the number of bits of the first audio data.
[0394] After unpacking the first audio coding packet, the first Bluetooth receiving device can obtain the first sub-packet and the second sub-packet. Subsequently, the first Bluetooth receiving device can obtain the third audio data with the same number of bits as the first audio data by processing the first sub-packet.
[0395] Optionally, the first Bluetooth receiving device may send the second sub-packet to the second Bluetooth receiving device, so that the second Bluetooth receiving device can obtain the low-bit data to be transmitted in the second audio data.
[0396] According to the above content, in the data encoding stage, the Bluetooth sending device can determine whether to perform high-bit interception on the first audio data before encoding the data. Depending on different situations, the first sub-packet encoded by the Bluetooth sending device is different. The following will be described from two perspectives:
[0397] 1. The Bluetooth sending device does not intercept the high bits of the first audio data.
[0398] According to the above content, if the Bluetooth sending device does not perform high-bit interception on the first audio data, the first sub-packet includes all the data of the first audio data. Taking the first audio data as 32 bits as an example, if the first audio data is not intercepted at a high bit, the first sub-packet includes 32 bits of the first audio data.
[0399] Optionally, step 5032 may be implemented as follows:
[0400] In a case where the first subpacket includes the first audio data, the first subpacket is decoded and the decoded audio data is determined as the third audio data.
[0401] Still taking the first audio data as 32 bits as an example, when the Bluetooth transmitting device does not intercept the high bits of the first audio data, the first sub-packet includes the 32 bits of the first audio data. The first Bluetooth receiving device decodes the first sub-packet to obtain the 32 bits of the third audio data.
[0402] Based on the foregoing, it should be understood that during the decoding process, there may be slight differences between the decoded audio data and the original data, that is, there may be losses in the decoded audio data, but this difference does not affect subsequent operations.
[0403] 2. The Bluetooth sending device intercepts the high bits of the first audio data.
[0404] According to the above content, if the Bluetooth transmitting device performs high-bit interception on the first audio data, the data to be transmitted in the first audio data included in the first sub-packet. Taking the first audio data as 32 bits as an example, if the first audio data is intercepted at a high bit to obtain the first audio data with the lower i bits deleted, the data to be transmitted in the first audio data included in the first sub-packet should be the 32-i bits of the first audio data.
[0405] Optionally, step 5032 may be implemented as follows:
[0406] In a case where the first sub-packet includes data to be transmitted in the first audio data, decoding the first sub-packet to obtain first decoded data, where the first decoded data is audio data obtained by deleting low-order data of the first audio data;
[0407] The third audio data is obtained by adding low-order data after the first decoded data, and the number of bits of the added low-order data is the same as the first number of bits of the low-order data deleted from the first audio data.
[0408] Still taking the first audio data of 32 bits as an example. When the Bluetooth transmitting device performs high-bit interception on the first audio data, such as deleting the lower 8 bits of low-bit data to obtain 24 bits of the first audio data, the first sub-packet includes 24 bits of the first audio data. The first Bluetooth receiving device decodes the first sub-packet to obtain 24 bits of first decoded data. It should be understood that the 24 bits of the first decoded data are equivalent to the upper 24 bits of the high-bit data in the 32 bits of the first audio data.
[0409] Similarly, during the decoding process, there may be slight differences between the first decoded data obtained after decoding and the high-order data of the upper 24 bits in the 32-bit first audio data, but the difference does not affect subsequent operations.
[0410] After obtaining the first decoded data, in order to obtain the third audio data having the same bit number as the first audio data, the first Bluetooth receiving device may add low-bit data after the first decoded data.
[0411] Optionally, the first digit is determined according to at least one of the following information: the data volume of a frame of data corresponding to the first audio data; the audio compression rate; and the average transmission bandwidth of the first channel and the second channel.
[0412] Optionally, the first sub-packet carries first bit digit information, where the first bit digit information is used to indicate the first bit of low-bit data deleted from the first audio data.
[0413] Optionally, the data on the bits of the added low-order data are all zero; or, the data on the bits of the added low-order data are all one; or, the data on the bits of the added low-order data are either zero or one.
[0414] Among them, the determination of the first digit and the added low-order data can refer to the above content and will not be repeated here.
[0415] For example, still taking the first audio data as 32 bits, deleting the lower 8 bits of low-order data to obtain the first audio data of 24 bits, the first Bluetooth receiving device decodes the first sub-packet to obtain the first decoded data of 24 bits.
[0416] Subsequently, the first Bluetooth receiving device adds the lower 8 bits of low-order data after the first decoded data. The data on the bits of the added lower 8 bits of low-order data are all zero. Alternatively, the first Bluetooth receiving device determines the lower 8 bits of low-order data in the first decoded data as the lower 8 bits of low-order data added after the first decoded data. Alternatively, the first Bluetooth receiving device randomly assigns a value of zero or one to each of the added lower 8 bits of low-order data.
[0417] Optionally, the data transmission method provided in the embodiment of the present application further includes the following:
[0418] Step 506: The second Bluetooth receiving device receives the second sub-packet sent by the first Bluetooth receiving device.
[0419] After unpacking the first audio encoding packet, the first Bluetooth receiving device can obtain the second sub-packet. Optionally, in order to enable the second channel to obtain the low-bit data transmitted in the second audio data, the first Bluetooth receiving device can also send the second sub-packet to the second Bluetooth receiving device.
[0420] Among them, the relevant description of the second sub-packet can refer to the above content and will not be repeated here.
[0421] It should be understood that when the first Bluetooth receiving device sends the second sub-packet to the second Bluetooth receiving device, there are two possibilities: the second sub-packet is transmitted successfully or fails to be transmitted. Fig.10On the basis of, if the data transmission method provided by the embodiment of the present application includes step 506, then step 505 can be implemented as step 5051 and step 5052. Among them, step 5051 and step 5052 are executed one by one, and cannot be executed at the same time. The following will be expanded from the two aspects of successful transmission and failed transmission of the second sub-packet:
[0422] 1. The second sub-packet is transmitted successfully, and the second Bluetooth receiving device executes step 5051.
[0423] Step 5051: decode the second audio coding packet to obtain second decoded data; if the second sub-packet is successfully transmitted, decode the second sub-packet to obtain third decoded data; determine the fourth audio data based on the second decoded data and the third decoded data.
[0424] The second decoded data is the high-order data to be transmitted in the second audio data, and the third decoded data is the low-order data to be transmitted in the second audio data. Exemplarily, there is a time difference between decoding the second audio encoding packet and the second sub-packet, and the receiving time of the second audio encoding packet is earlier than the receiving time of the second sub-packet. For example, the second Bluetooth receiving device receives the second audio encoding packet and receives the second sub-packet 5ms later.
[0425] Similar to the first decoded data, during the decoding process, there may be slight differences between the decoded data obtained after decoding and the original data, but the difference does not affect subsequent operations. For ease of description, the subtle differences in decoding are not described separately in the embodiments of the present application, and the decoded data is assumed to be consistent with the original data, but this default does not limit the present application.
[0426] According to the foregoing content, the Bluetooth sending device can determine whether to perform high-bit interception on the second audio data. Optionally, according to whether the Bluetooth sending device performs high-bit interception on the second audio data, there are two implementation methods for determining the fourth audio data according to the second decoded data and the third decoded data:
[0427] (1) The Bluetooth sending device does not intercept the high bits of the second audio data.
[0428] Optionally, when the Bluetooth sending device does not delete the low-order data of the second audio data, step 5051 may be implemented as follows:
[0429] Decoding the second audio coding packet to obtain second decoded data;
[0430] If the second sub-packet is successfully transmitted, decoding the second sub-packet to obtain third decoded data;
[0431] The audio data obtained by arranging the second decoded data and the third decoded data according to the high and low bits of the second audio data is determined as the fourth audio data.
[0432] For example, the Bluetooth sending device splits the 32-bit second audio data, determines the lower 8-bit low-order data as the low-order data to be transmitted in the second audio data included in the second sub-packet, and the number of bits of the low-order data to be transmitted in the second audio data is the lower 8 bits. At the same time, the second audio coding packet includes the upper 24-bit high-order data of the second audio data.
[0433] Based on this, the second decoded data obtained by the second Bluetooth receiving device is the high-order data of the upper 24 bits in the second audio data, and the third decoded data is the low-order data of the lower 8 bits in the second audio data. Subsequently, the second Bluetooth receiving device sorts the second decoded data and the third decoded data according to the high and low bits of the second audio data to obtain the 32-bit fourth audio data.
[0434] (2) The Bluetooth sending device intercepts the high bits of the second audio data.
[0435] Optionally, when the Bluetooth sending device deletes the low-order data of the second audio data, step 5051 may be implemented as follows:
[0436] Decoding the second audio coding packet to obtain second decoded data;
[0437] If the second sub-packet is successfully transmitted, decoding the second sub-packet to obtain third decoded data;
[0438] The audio data obtained by arranging the third decoded data and the second decoded data according to the high and low bits of the second audio data is determined as the fifth audio data;
[0439] Low-order data is added after the fifth audio data to obtain fourth audio data, and the number of bits of the added low-order data is the same as the second number of bits of the low-order data deleted from the second audio data.
[0440] For the determination of the second digit, please refer to the above content.
[0441] Optionally, the second bit number is determined based on at least one of the following information: the data volume of one frame of data corresponding to the second audio data; the audio compression rate; and the average transmission bandwidth of the first channel and the second channel.
[0442] Optionally, the second audio coding packet or the second sub-packet carries second bit information, where the second bit information is used to indicate the second bit of low-bit data deleted from the second audio data.
[0443] Optionally, the data on the bits of the added low-order data are all zero; or, the data on the bits of the added low-order data are all one; or, the data on the bits of the added low-order data are either zero or one.
[0444] Taking the second audio data as 32 bits as an example, if the Bluetooth sending device intercepts the high bits of the 32-bit second audio data, retains the high-bit data of the upper 24 bits, and deletes the low-bit data of the lower 8 bits, the second digit is the lower 8 bits.
[0445] Subsequently, the Bluetooth sending device splits the 24-bit second audio data, determines the lower 8-bit low-order data as the low-order data to be transmitted in the second audio data included in the second sub-packet, and the number of bits of the low-order data to be transmitted in the second audio data is the lower 8 bits. At the same time, the second audio encoding packet includes the upper 16-bit high-order data of the second audio data.
[0446] Based on this, the second Bluetooth receiving device decodes the second audio encoding packet, and the obtained third decoded data is the low-order data of the lower 8 bits in the 24-bit second audio data; the second sub-packet is decoded, and the obtained second decoded data is the high-order data of the upper 16 bits in the 24-bit second audio data.
[0447] Subsequently, the second Bluetooth receiving device sorts the third decoded data and the second decoded data according to the high and low bits of the second audio data to obtain 24-bit fifth audio data. Based on the obtained 24-bit fifth audio data, the second Bluetooth receiving device adds the lower 8 bits of low-order data after the 24-bit fifth audio data to obtain 32-bit fourth audio data.
[0448] refer to Fig.13 After adopting the data decoding method provided in the embodiment of the present application, the following steps are added in the decoding process: a combination of the decoded data of the second sub-packet and the second audio coding packet.
[0449] This step is performed by the second Bluetooth receiving device.
[0450] Exemplarily, the second Bluetooth receiving device receives the second sub-packet sent by the first receiving component of the first Bluetooth receiving device through the second receiving component. Subsequently, the second Bluetooth receiving device decodes the second audio encoding packet to obtain second decoded data; if the second sub-packet is successfully received, the second Bluetooth receiving device decodes the second sub-packet to obtain third decoded data. Subsequently, the second Bluetooth receiving device can combine the second decoded data and the third decoded data, and sort the two decoded data according to the high and low bits of the second audio data to obtain fourth audio data with the same number of bits as the second audio data.
[0451] 2. If the transmission of the second sub-packet fails, the second Bluetooth receiving device executes step 5052.
[0452] Step 5052: When the transmission of the second sub-packet fails, decode the second audio coding packet to obtain second decoded data; add low-order data after the second decoded data to obtain fourth audio data.
[0453] The second decoded data is high-order data to be transmitted in the second audio data.
[0454] For the related description of the second decoded data, please refer to the aforementioned content and will not be repeated here.
[0455] Similar to step 5051, depending on whether the Bluetooth sending device intercepts the high bits of the second audio data, there are two implementation methods for determining the fourth audio data according to the second decoded data:
[0456] (1) The Bluetooth sending device does not intercept the high bits of the second audio data.
[0457] Optionally, when the Bluetooth sending device does not delete the low-order data of the second audio data, step 5052 may be implemented as follows:
[0458] In case that the transmission of the second sub-packet fails, decoding the second audio coding packet to obtain second decoded data;
[0459] adding low-order data having a third digit number after the second decoded data to obtain fourth audio data;
[0460] The third bit number is the bit number of the low-bit data to be transmitted in the second audio data included in the second sub-packet.
[0461] Still taking the second audio data being 32 bits as an example, when the Bluetooth sending device does not delete the low-bit data of the second audio data, the low-bit data to be transmitted in the second audio data should be the lower n bits of the 32-bit second audio data.
[0462] For example, if the low-order data to be transmitted in the second audio data is the low-order data of the lower 8 bits, then the third digit is the lower 8 bits. After decoding the second audio encoding packet, the second Bluetooth receiving device obtains 24-bit second decoded data. Since the second Bluetooth receiving device does not receive the second sub-packet, in order to obtain the fourth audio data with the same number of bits as the second audio data, the second Bluetooth receiving device can add the low-order data of the lower 8 bits after the 24-bit second decoded data to obtain 32-bit fourth audio data.
[0463] Optionally, the data on the bits of the added low-order data are all zero; or, the data on the bits of the added low-order data are all one; or, the data on the bits of the added low-order data are either zero or one.
[0464] (2) The Bluetooth sending device intercepts the high bits of the second audio data.
[0465] Optionally, when the Bluetooth sending device deletes the low-order data of the second audio data, step 5052 may be implemented as follows:
[0466] In case that the transmission of the second sub-packet fails, decoding the second audio coding packet to obtain second decoded data;
[0467] adding low-order data having a fourth digit number after the second decoded data to obtain fourth audio data;
[0468] The fourth bit is the sum of the number of bits of low-bit data to be transmitted in the second audio data included in the second sub-packet and the second bit of the low-bit data deleted in the second audio data.
[0469] The low-order data deleted from the second audio data is the low-order data deleted after the Bluetooth transmitting device intercepts the high-order data of the second audio data. For example, the Bluetooth transmitting device intercepts the high-order data of the 32-bit second audio data, retains the high-order data of the upper 24 bits, and deletes the low-order data of the lower 8 bits, so that the second digit is the lower 8 bits.
[0470] For determining the number of bits of the low-bit data to be transmitted in the second audio data and determining the second number of bits, reference may be made to the foregoing content and will not be repeated herein.
[0471] Optionally, the second bit number is determined based on at least one of the following information: the data volume of one frame of data corresponding to the second audio data; the audio compression rate; and the average transmission bandwidth of the first channel and the second channel.
[0472] Optionally, the second audio coding packet or the second sub-packet carries second bit information, where the second bit information is used to indicate the first bit of low-bit data deleted from the first audio data.
[0473] Optionally, the data on the bits of the added low-order data are all zero; or, the data on the bits of the added low-order data are all one; or, the data on the bits of the added low-order data are either zero or one.
[0474] Still taking the second audio data of 32 bits as an example, the Bluetooth sending device intercepts the high bits of the 32-bit second audio data, retains the high-bit data of the upper 24 bits, and deletes the low-bit data of the lower 8 bits, so that the second digit is the lower 8 bits.
[0475] Subsequently, the Bluetooth sending device splits the 24-bit second audio data, determines the lower 8-bit low-order data as the low-order data to be transmitted in the second audio data included in the second sub-packet, and the number of bits of the low-order data to be transmitted in the second audio data is the lower 8 bits. At the same time, the second audio encoding packet includes the upper 24-bit high-order data of the second audio data.
[0476] Based on the above example, it can be concluded that the fourth digit is the sum of the deleted lower 8 bits and the lower 8 bits when split, that is, the lower 16 bits.
[0477] After decoding the second audio coding packet, the second Bluetooth receiving device obtains 24-bit second decoded data; then, the second Bluetooth receiving device adds 8 low-bit data after the 24-bit second decoded data to obtain 32-bit fourth audio data.
[0478] In an optional implementation scenario, if the second sub-packet transmission fails, the first Bluetooth receiving device may send the second sub-packet to the second Bluetooth receiving device again to increase the possibility that the second Bluetooth receiving device obtains the low-bit data to be transmitted in the second audio data.
[0479] contrast Figure 1 and Fig.13 After adopting the data encoding method and data decoding method provided in the embodiment of the present application, the following three steps are added in the audio transmission process:
[0480] (1) Data separation of the second audio data.
[0481] This step is performed by a Bluetooth sending device.
[0482] Exemplarily, after PCM decoding of the audio resource, the Bluetooth transmitting device determines the obtained PCM data as the first audio data and the second audio data according to the first channel and the second channel. Subsequently, the Bluetooth transmitting device splits the second audio data so as to carry the low-bit data to be transmitted in the second audio data in the first audio coding packet transmitted in the first channel for transmission.
[0483] (2) Unpacking of the first audio coding packet.
[0484] Wherein, this step is performed by the first Bluetooth receiving device.
[0485] Exemplarily, the first Bluetooth receiving device receives the first audio coding packet sent by the Bluetooth sending device through the first receiving component; then, the first Bluetooth receiving device unpacks the first audio coding packet to obtain a first sub-packet and a second sub-packet.
[0486] The first sub-packet is PCM decoded by the first Bluetooth receiving device, and the third audio data having the same number of bits as the first audio data is determined based on the obtained PCM data. In addition, the second sub-packet is sent by the first Bluetooth receiving device to the second receiving component of the second Bluetooth receiving device through the first sending component, so that the second Bluetooth receiving device can obtain the audio data to be transmitted in the second audio data.
[0487] (3) Combination of the decoded data of the second subpacket and the second audio coding packet.
[0488] This step is performed by the second Bluetooth receiving device.
[0489] Exemplarily, the second Bluetooth receiving device receives the second sub-packet sent by the first receiving component of the first Bluetooth receiving device through the second receiving component. Subsequently, the second Bluetooth receiving device decodes the second audio encoding packet to obtain second decoded data; if the second sub-packet is successfully received, the second Bluetooth receiving device decodes the second sub-packet to obtain third decoded data. Subsequently, the second Bluetooth receiving device can combine the second decoded data and the third decoded data, and sort the two decoded data according to the high and low bits of the second audio data to obtain fourth audio data with the same number of bits as the second audio data.
[0490] It should be understood that in the embodiments of the present application, the steps on the Bluetooth sending device side can independently become an embodiment of the data encoding method, and the first Bluetooth receiving device side and the second Bluetooth receiving device side can independently become an embodiment of the data decoding method. The specific explanation of the data encoding method and the data decoding method steps can refer to the above content.
[0491] To summarize, in the data transmission method provided in the embodiment of the present application, by carrying the low-bit data of the second channel in the first audio coding packet, the low-bit data to be transmitted in the second channel can be forwarded to the second Bluetooth receiving device via the first Bluetooth receiving device, thereby maximizing the utilization of the total transmission bandwidth of the first channel and the second channel.
[0492] Optionally, the embodiment of the present application further provides two encoding methods for the first sub-packet, and determines the data information included in the first sub-packet according to whether the Bluetooth sending device performs high-bit interception on the first audio data.
[0493] Optionally, an embodiment of the present application also provides an implementation method for data splitting of the second audio data. While fully utilizing the transmission bandwidth, the high-order data to be transmitted in the second audio data is retained in the second audio coding package as much as possible, and the low-order data to be transmitted in the second audio data is sent through the first audio coding package.
[0494] Optionally, the embodiment of the present application also provides an implementation method for determining the third audio data with the same number of bits as the first audio data according to the first sub-packet. Regardless of whether the Bluetooth transmitting device intercepts the high bits of the first audio data, the first Bluetooth receiving device can determine the third audio data according to the audio data obtained after decoding the first sub-packet, thereby restoring the original number of bits of the first audio data at the first Bluetooth receiving device end to ensure the transmission quality of the first audio data.
[0495] Optionally, the embodiment of the present application also provides an implementation method for determining the fourth audio data having the same number of bits as the second audio encoding according to the second audio encoding packet. Similar to the first Bluetooth receiving device, regardless of whether the Bluetooth sending device performs high-bit interception on the second audio data, and / or whether the physical second Bluetooth receiving device receives the first sub-packet sent by the first Bluetooth receiving device, the second Bluetooth receiving device can determine the fourth audio data according to the audio data obtained after decoding, thereby restoring the original number of bits of the second audio data on the second Bluetooth receiving device to ensure the transmission quality of the second audio data.
[0496] It should be understood that the multiple embodiments provided in the foregoing may be implemented in combination.
[0497] Exemplarily, the data encoding method may be implemented by the Bluetooth sending device as follows:
[0498] Step 1-1: Get the Bluetooth audio bandwidth of the first channel and the second channel.
[0499] Wherein, when the bandwidth capabilities of the first channel and the second channel are different, the following steps are performed.
[0500] Step 1-2: Determine the average transmission amount of the first channel and the second channel according to the average transmission bandwidth of the first channel and the second channel.
[0501] Step 1-3: Determine whether to perform high-order interception on the first audio data corresponding to the first channel and the second audio data corresponding to the second channel. This step is an optional step and is performed when the Bluetooth audio bandwidth does not meet the transmission requirements. If it does, it can be skipped. The determination of the Bluetooth audio bandwidth can refer to the above content and will not be repeated here.
[0502] Step 1-4: split the second audio data according to the average transmission amount to obtain low-order data and high-order data to be transmitted in the second audio data.
[0503] Step 1-5: Generate a first sub-packet, a second sub-packet and a second audio coding packet, and combine the first sub-packet and the second sub-packet to obtain a first audio coding packet.
[0504] The first sub-packet includes at least the data to be transmitted in the first audio data, the second sub-packet includes the low-order data to be transmitted in the second audio data, and the second audio coding packet includes the high-order data to be transmitted in the second audio data.
[0505] Step 1-6: Add header information to the first audio encoding packet and the second audio encoding packet, send the first audio encoding packet to the first Bluetooth receiving device, and send the second audio encoding packet to the second Bluetooth receiving device.
[0506] Exemplarily, the data decoding method may be implemented by the first Bluetooth receiving device as follows:
[0507] Step 2-1: Receive a first audio coding packet sent by a Bluetooth sending device.
[0508] Step 2-2: Unpack the first audio coding packet to obtain a first sub-packet and a second sub-packet.
[0509] Step 2-3: Decode the first sub-packet to obtain third audio data having the same bit number as the first audio data.
[0510] Among them, according to whether the Bluetooth sending device executes steps 1-3, steps 2-3 have the following two implementation methods:
[0511] Implementation method 1: the Bluetooth sending device does not intercept the high bits of the first audio data, the first Bluetooth receiving device decodes the first sub-packet, and determines the decoded audio data as the third audio data;
[0512] Implementation method two: The Bluetooth sending device intercepts the high bits of the first audio data, the first Bluetooth receiving device decodes the first sub-packet, and determines the decoded audio data as the first decoded data; low-bit data is added after the first decoded data to obtain third audio data, and the number of bits of the added low-bit data is the same as the first number of bits of the low-bit data deleted in the first audio data.
[0513] Step 2-4: Send the second sub-packet to the second Bluetooth receiving device.
[0514] Exemplarily, the data decoding method may be implemented by the second Bluetooth receiving device as follows:
[0515] Step 3-1: Receive a second audio encoding packet sent by a Bluetooth sending device.
[0516] Step 3-2: Receive the second sub-packet sent by the first Bluetooth receiving device.
[0517] If the second sub-packet is sent successfully, step 3-3-1 is executed; if the second sub-packet is sent unsuccessfully, step 3-3-2 is executed. Steps 3-3-1 and 3-3-2 are as follows:
[0518] Step 3-3-1: Decode the second audio coding packet to obtain second decoded data; if the second sub-packet is successfully transmitted, decode the second sub-packet to obtain third decoded data; based on the second decoded data and the third decoded data, determine the fourth audio data with the same number of bits as the second audio data.
[0519] Similar to step 2-3, step 3-3-1 has the following two implementation methods depending on whether the Bluetooth sending device executes step 1-3:
[0520] Implementation method 1: the Bluetooth sending device does not intercept the high bits of the second audio data, the second Bluetooth receiving device decodes the second audio encoding packet to obtain second decoded data; decodes the second sub-packet to obtain third decoded data; and arranges the second decoded data and the third decoded data according to the high and low bits of the second audio data to obtain audio data, which is determined as the fourth audio data;
[0521] Implementation method two: The Bluetooth sending device decodes the second audio encoding packet to obtain second decoded data; the second audio data is intercepted in high order, and the second Bluetooth receiving device decodes the second sub-packet to obtain third decoded data; the audio data obtained by arranging the second decoded data and the third decoded data according to the high and low orders of the second audio data is determined as the fifth audio data; low-order data is added after the fifth audio data to obtain fourth audio data, and the number of bits of the added low-order data is the same as the second number of bits of the low-order data deleted in the second audio data.
[0522] Step 3-3-2: When the transmission of the second sub-packet fails, decode the second audio coding packet to obtain second decoded data; add low-bit data after the second decoded data to obtain fourth audio data.
[0523] Similar to step 2-3, step 3-3-2 has the following two implementation methods depending on whether the Bluetooth sending device executes step 1-3:
[0524] Implementation method 1: the Bluetooth sending device does not intercept the high bits of the second audio data, the second Bluetooth receiving device decodes the second audio coding packet to obtain second decoded data; low-bit data having a third digit is added after the second decoded data to obtain fourth audio data, where the third digit is the number of digits of the low-bit data to be transmitted in the second audio data included in the second sub-packet;
[0525] Implementation method two: the Bluetooth sending device intercepts the high bits of the second audio data, and the second Bluetooth receiving device decodes the second audio encoding packet to obtain second decoded data; low-bit data with a fourth digit is added after the second decoded data to obtain fourth audio data; wherein the fourth digit is the sum of the number of bits of the low-bit data to be transmitted in the second audio data included in the second sub-packet and the second digit of the low-bit data deleted from the second audio data.
[0526] For the relevant descriptions involved in the above steps, please refer to the above content and will not be repeated here.
[0527] At the same time, the combination implementations that have not been listed are all within the protection scope of this application and will not be described in detail.
[0528] The following is an embodiment of the device of the present application. For details not described in detail in the embodiment of the device, reference can be made to the corresponding records in the above method embodiment, and they will not be repeated herein.
[0529] Fig. 20 A schematic diagram of a data encoding device provided by an exemplary embodiment of the present application is shown, the device comprising:
[0530] The encoding module 210 is used to generate a first audio encoding packet and a second audio encoding packet;
[0531] The first audio coding packet includes at least the data to be transmitted in the first audio data corresponding to the first channel and the low-order data to be transmitted in the second audio data corresponding to the second channel, and the second audio coding packet includes the high-order data to be transmitted in the second audio data.
[0532] Optionally, the first audio coding packet includes a first sub-packet and a second sub-packet, the first sub-packet includes at least data to be transmitted in the first audio data, and the second sub-packet includes low-bit data to be transmitted in the second audio data.
[0533] Optionally, the encoding module 2010 is used to encode the data to be transmitted in the first audio data to obtain a first sub-packet; split the second audio data to determine the low-order data and high-order data to be transmitted in the second audio data; encode the low-order data to be transmitted in the second audio data to obtain a second sub-packet; encode the high-order data to be transmitted in the second audio data to obtain a second audio encoding packet; and group the first sub-packet and the second sub-packet to obtain a first audio encoding packet.
[0534] Optionally, the encoding module 2010 is used to split the second audio data to determine the low-order data and the high-order data to be transmitted in the second audio data when the transmission bandwidths of the first channel and the second channel are different.
[0535] Optionally, the encoding module 2010 is used to split the audio data corresponding to the second channel according to the average transmission bandwidth of the first channel and the second channel, and determine the low-bit data and the high-bit data to be transmitted in the second audio data.
[0536] Optionally, the encoding module 2010 is used to determine the data on the bit positions corresponding to the number of splitting bits as the low-order data to be transmitted in the second audio data based on the average transmission bandwidth, and determine the data other than the data on the bit positions corresponding to the number of splitting bits as the high-order data to be transmitted in the second audio data.
[0537] Optionally, the number of splitting bits is determined based on at least one of the following information: the data volume of one frame of data corresponding to the second audio data; the audio compression rate; and the average transmission bandwidth.
[0538] Optionally, the encoding module 2010 is used to determine the average transmission amount of the first channel and the second channel according to the average transmission bandwidth; split the audio data corresponding to the second channel according to the average transmission amount, and determine the low-order data and high-order data to be transmitted in the second audio data.
[0539] Optionally, the encoding module 2010 is used to encode the first audio data as data to be transmitted to obtain a first sub-packet; or, according to the transmission bandwidth corresponding to the first channel, delete the low-order data of the first audio data; and encode the deleted first audio data as data to be transmitted to obtain a first sub-packet.
[0540] Optionally, the first bit of the low-bit data deleted from the first audio data is determined based on at least one of the following information: the amount of data of a frame corresponding to the first audio data; the audio compression rate; and the average transmission bandwidth of the first channel and the second channel.
[0541] Optionally, the first subpacket carries first bit digit information, where the first bit digit information is used to indicate the first bit of low-bit data deleted from the first audio data.
[0542] Optionally, the encoding module 2010 is used to delete the low-order data of the second audio data according to the transmission bandwidth corresponding to the second channel; split the deleted second audio data, and determine the low-order data and high-order data to be transmitted in the deleted second audio data.
[0543] Optionally, the second bit number of the low-bit data deleted from the second audio data is determined based on at least one of the following information: the data volume of a frame of data corresponding to the second audio data; the audio compression rate; and the average transmission bandwidth of the first channel and the second channel.
[0544] Optionally, the second audio coding packet or the second sub-packet carries second bit information, where the second bit information is used to indicate the second bit of low-bit data deleted from the second audio data.
[0545] Optionally, the first audio coding package also includes at least one of the following information: a first bandwidth identifier, the first bandwidth identifier is used to indicate that the transmission bandwidths of the first channel and the second channel are different; a second bandwidth identifier, the second bandwidth identifier is used to indicate that the transmission bandwidth of the first channel is higher than the transmission bandwidth of the second channel.
[0546] Optionally, the second audio coding package also includes at least one of the following information: a first bandwidth identifier, the first bandwidth identifier is used to indicate that the transmission bandwidths of the first channel and the second channel are different; a third bandwidth identifier, the third bandwidth identifier is used to indicate that the transmission bandwidth of the second channel is lower than the transmission low bandwidth of the first channel.
[0547] Fig.21 A schematic diagram of a data decoding device provided by an exemplary embodiment of the present application is shown, the device comprising:
[0548] The receiving module 2110 is configured to receive a first audio coding packet, where the first audio coding packet includes at least data to be transmitted in the first audio data corresponding to the first channel and low-bit data to be transmitted in the second audio data corresponding to the second channel;
[0549] The decoding module 220 is used to decode the first audio coding packet to obtain third audio data, where the number of bits of the third audio data is the same as that of the first audio data.
[0550] Optionally, the decoding module 2020 is used to unpack the first audio encoding packet to obtain a first sub-packet and a second sub-packet, wherein the first sub-packet includes at least the data to be transmitted in the first audio data, and the second sub-packet includes the low-bit data to be transmitted in the second audio data; and decode the first sub-packet to obtain third audio data.
[0551] Optionally, the decoding module 2020 is used to decode the first sub-packet when the first sub-packet includes the first audio data, and determine the decoded audio data as the third audio data.
[0552] Optionally, the decoding module 2020 is used to decode the first sub-packet to obtain first decoded data when the first sub-packet includes data to be transmitted in the first audio data, where the first decoded data is audio data obtained after deleting low-order data of the first audio data; and add low-order data after the first decoded data to obtain third audio data, where the number of bits of the added low-order data is the same as the first number of bits of the low-order data deleted from the first audio data.
[0553] Optionally, the first bit of the low-bit data deleted from the first audio data is determined based on at least one of the following information: the amount of data of a frame corresponding to the first audio data; the audio compression rate; and the average transmission bandwidth of the first channel and the second channel.
[0554] Optionally, the first sub-packet carries first bit digit information, where the first bit digit information is used to indicate the first bit of low-bit data deleted from the first audio data.
[0555] Optionally, the data on the bits of the added low-order data are all zero; or, the data on the bits of the added low-order data are all one; or, the data on the bits of the added low-order data are either zero or one.
[0556] Optionally, the apparatus further includes a sending module 2130, configured to send the second sub-packet to a second Bluetooth receiving device, where the second Bluetooth receiving device corresponds to the second channel.
[0557] Fig. 22 A schematic diagram of a data decoding device provided by an exemplary embodiment of the present application is shown, the device comprising:
[0558] The receiving module 2210 is used to receive a second audio coding packet sent by a Bluetooth sending device, where the second audio coding packet includes high-order data to be transmitted in the second audio data corresponding to the second channel;
[0559] The decoding module 2220 is used to decode the second audio coding packet to obtain fourth audio data, where the number of bits of the fourth audio data is the same as that of the second audio data.
[0560] Optionally, the receiving module 2210 is also used to receive a second sub-packet sent by a first Bluetooth receiving device, the first Bluetooth receiving device corresponds to the first channel, the second sub-packet is a sub-packet in the first audio coding packet, and the second sub-packet includes low-bit data to be transmitted in the second audio data.
[0561] Optionally, the decoding module 2220 is used to decode the second audio coding packet to obtain second decoded data; when the second sub-packet is successfully transmitted, decode the second sub-packet to obtain third decoded data; and determine the fourth audio data based on the second decoded data and the third decoded data.
[0562] Optionally, the decoding module 2220 is used to determine the audio data obtained by arranging the second decoded data and the third decoded data according to the high and low bits of the second audio data as the fourth audio data when the Bluetooth sending device does not delete the low-bit data of the second audio data.
[0563] Optionally, the decoding module 2220 is used to, when the Bluetooth sending device deletes the low-order data of the second audio data, determine the audio data obtained by arranging the second decoded data and the third decoded data according to the high and low orders of the second audio data as the fifth audio data; and add low-order data after the fifth audio data to obtain fourth audio data, the number of bits of the added low-order data being the same as the second number of bits of the low-order data deleted from the second audio data.
[0564] Optionally, the second bit number of the low-bit data deleted from the second audio data is determined based on at least one of the following information: the data volume of a frame of data corresponding to the second audio data; the audio compression rate; and the average transmission bandwidth of the first channel and the second channel.
[0565] Optionally, the second audio coding packet or the second sub-packet carries second bit information, where the second bit information is used to indicate the second bit of low-bit data deleted from the second audio data.
[0566] Optionally, the data on the bits of the added low-order data are all zero; or, the data on the bits of the added low-order data are all one; or, the data on the bits of the added low-order data are either zero or one.
[0567] Optionally, the decoding module 2220 is used to decode the second audio coding packet to obtain third decoded data when the transmission of the second sub-packet fails; and add low-bit data after the third decoded data to obtain fourth audio data.
[0568] Optionally, the decoding module 2220 is used to add low-bit data having a third bit number after the third decoded data to obtain fourth audio data when the Bluetooth sending device does not delete the low-bit data of the second audio data; wherein the third bit number is the number of bits of low-bit data to be transmitted in the second audio data included in the second sub-packet.
[0569] Optionally, the data on the bits of the added low-order data are all zero; or, the data on the bits of the added low-order data are all one; or, the data on the bits of the added low-order data are either zero or one.
[0570] Optionally, the decoding module 2220 is used to add low-order data having a fourth digit after the third decoded data to obtain fourth audio data when the Bluetooth sending device deletes the low-order data of the second audio data; wherein the fourth digit is the sum of the number of bits of the low-order data to be transmitted in the second audio data included in the second sub-packet and the second digit of the low-order data deleted from the second audio data.
[0571] Optionally, the second bit number of the low-bit data deleted from the second audio data is determined based on at least one of the following information: the data volume of a frame of data corresponding to the second audio data; the audio compression rate; and the average transmission bandwidth of the first channel and the second channel.
[0572] Optionally, the second audio coding packet or the second sub-packet carries second bit information, where the second bit information is used to indicate the first bit of low-bit data deleted from the first audio data.
[0573] Optionally, the data on the bits of the added low-order data are all zero; or, the data on the bits of the added low-order data are all one; or, the data on the bits of the added low-order data are either zero or one.
[0574] Fig.23 A schematic diagram of the structure of a communication device (terminal or network device) provided by an exemplary embodiment of the present application is shown. The communication device includes: a processor 2301, a receiver 2302, a transmitter 2303, a memory 2304 and a bus 2305.
[0575] The processor 2301 includes one or more processing cores. The processor 2301 executes various functional applications and information processing by running software programs and modules.
[0576] The receiver 2302 and the transmitter 2303 may be implemented as a communication component, which may be a communication chip.
[0577] The memory 2304 is connected to the processor 2301 via a bus 2305 .
[0578] The memory 2304 may be used to store at least one instruction, and the processor 2301 may be used to execute the at least one instruction to implement the data encoding method mentioned in the above method embodiment, or the various steps of the data decoding method.
[0579] In addition, memory 2304 can be implemented by any type of volatile or non-volatile storage device or a combination thereof. Volatile or non-volatile storage devices include but are not limited to: magnetic disks or optical disks, electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), read-only memory (ROM), magnetic memory, flash memory, and programmable read-only memory (PROM).
[0580] The present application also provides a Bluetooth sending device, which includes a memory and a processor; the memory stores at least one program code, and the program code is loaded and executed by the processor to implement the data encoding method as described above.
[0581] The present application also provides a first Bluetooth receiving device, which includes a memory and a processor; at least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the data decoding method as described above.
[0582] The present application also provides a second Bluetooth receiving device, which includes a memory and a processor; at least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the data decoding method as described above.
[0583] The present application also provides a Bluetooth system, which includes a first Bluetooth receiving device and a second Bluetooth receiving device; the first Bluetooth receiving device corresponds to the first channel, and the first Bluetooth receiving device is used to execute the data decoding method as described above; the second Bluetooth receiving device corresponds to the second channel, and the second Bluetooth receiving device is used to execute the data decoding method as described above.
[0584] The present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program is used to be executed by a processor to implement the data encoding method or data decoding method as described above.
[0585] The present application also provides a chip, which includes a programmable logic circuit and / or program instructions, and is used to implement the data encoding method or data decoding method as described above when an electronic device equipped with the chip is running.
[0586] The present application also provides a computer program product, which includes computer instructions stored in a computer-readable storage medium. A processor reads and executes the computer instructions from the computer-readable storage medium to implement the data encoding method or data decoding method as described above.
[0587] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0588] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0589] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A data encoding method, characterized in that: The method is performed by a Bluetooth sending device, and the method includes: generating a first audio coding packet and a second audio coding packet; The first audio coding packet at least includes data to be transmitted in the first audio data corresponding to the first channel and low-order data to be transmitted in the second audio data corresponding to the second channel, and the second audio coding packet includes high-order data to be transmitted in the second audio data; The low-bit data to be transmitted in the second audio data and the high-bit data to be transmitted in the second audio data are obtained by data splitting when the transmission bandwidths of the first channel and the second channel are different.
2. The method according to claim 1, characterized in that The first audio coding packet includes a first sub-packet and a second sub-packet, the first sub-packet includes at least the data to be transmitted in the first audio data, and the second sub-packet includes the low-bit data to be transmitted in the second audio data.
3. The method according to claim 2, characterized in that The generating of the first audio coding packet and the second audio coding packet comprises: Encoding the data to be transmitted in the first audio data to obtain the first sub-packet; Splitting the second audio data to determine low-order data and high-order data to be transmitted in the second audio data; Encoding the low-order data to be transmitted in the second audio data to obtain the second sub-packet; Encoding the high-order data to be transmitted in the second audio data to obtain the second audio encoding packet; The first sub-packet and the second sub-packet are combined to obtain the first audio coding packet.
4. The method according to claim 3, characterized in that The step of splitting the second audio data to determine the low-order data and the high-order data to be transmitted in the second audio data includes: In the case that the transmission bandwidths of the first channel and the second channel are different, the second audio data is split to determine the low-order data and the high-order data to be transmitted in the second audio data.
5. The method according to claim 4, characterized in that The step of splitting the second audio data to determine low-order data and high-order data to be transmitted in the second audio data when the transmission bandwidths of the first audio channel and the second audio channel are different includes: The audio data corresponding to the second channel is split according to the average transmission bandwidth of the first channel and the second channel, and the low-bit data and the high-bit data to be transmitted in the second audio data are determined.
6. The method according to claim 5, characterized in that The step of splitting the audio data corresponding to the second channel according to the average transmission bandwidth of the first channel and the second channel, and determining the low-bit data and the high-bit data to be transmitted in the second audio data, includes: According to the average transmission bandwidth, data on the bit positions corresponding to the number of splitting bits are determined as low-order data to be transmitted in the second audio data, and data other than the data on the bit positions corresponding to the number of splitting bits are determined as high-order data to be transmitted in the second audio data.
7. The method according to claim 6, characterized in that The number of splitting bits is determined according to at least one of the following information: The data volume of one frame of data corresponding to the second audio data; Audio compression rate; The average transmission bandwidth.
8. The method according to claim 5, characterized in that The step of splitting the audio data corresponding to the second channel according to the average transmission bandwidth of the first channel and the second channel, and determining the low-bit data and the high-bit data to be transmitted in the second audio data, includes: Determining average transmission amounts of the first channel and the second channel according to the average transmission bandwidth; The audio data corresponding to the second channel is split according to the average transmission amount to determine the low-order data and the high-order data to be transmitted in the second audio data.
9. The method according to claim 3, characterized in that: The step of encoding the data to be transmitted in the first audio data to obtain the first sub-packet includes: Encoding the first audio data as data to be transmitted to obtain the first sub-packet; or, According to the transmission bandwidth corresponding to the first sound channel, the low-order data of the first audio data is deleted; and the deleted first audio data is encoded as data to be transmitted to obtain the first sub-packet.
10. The method according to claim 9, characterized in that The first bit of the low-bit data deleted from the first audio data is determined according to at least one of the following information: The data volume of one frame of data corresponding to the first audio data; Audio compression rate; The average transmission bandwidth of the first channel and the second channel.
11. The method according to claim 9, characterized in that The first sub-packet carries first bit information, where the first bit information is used to indicate the first bit of low-bit data deleted from the first audio data.
12. The method according to claim 3, characterized in that The step of splitting the second audio data to determine the low-order data and the high-order data to be transmitted in the second audio data includes: Deleting low-order data of the second audio data according to a transmission bandwidth corresponding to the second sound channel; The deleted second audio data is split into data to determine the low-order data and the high-order data to be transmitted in the deleted second audio data.
13. The method according to claim 12, characterized in that The second number of the low-order data deleted from the second audio data is determined according to at least one of the following information: The data volume of one frame of data corresponding to the second audio data; Audio compression rate; The average transmission bandwidth of the first channel and the second channel.
14. The method according to claim 12, characterized in that The second audio coding packet or the second sub-packet carries second bit number information, where the second bit number information is used to indicate the second bit number of low-bit data deleted from the second audio data.
15. The method according to any one of claims 1 to 14, characterized in that: The first audio coding packet further includes at least one of the following information: a first bandwidth identifier, where the first bandwidth identifier is used to indicate that transmission bandwidths of the first sound channel and the second sound channel are different; A second bandwidth identifier, where the second bandwidth identifier is used to indicate that a transmission bandwidth of the first sound channel is higher than a transmission bandwidth of the second sound channel.
16. The method according to any one of claims 1 to 14, characterized in that: The second audio coding packet further includes at least one of the following information: a first bandwidth identifier, where the first bandwidth identifier is used to indicate that transmission bandwidths of the first sound channel and the second sound channel are different; A third bandwidth identifier is used to indicate that a transmission bandwidth of the second sound channel is lower than a transmission low bandwidth of the first sound channel.
17. A data decoding method, characterized in that: The method is performed by a first Bluetooth receiving device, the first Bluetooth receiving device corresponds to a first channel, and the method includes: Receive a first audio coding packet, where the first audio coding packet includes at least data to be transmitted in first audio data corresponding to the first channel and low-bit data to be transmitted in second audio data corresponding to the second channel; Decoding the first audio coding packet to obtain third audio data, where the number of bits of the third audio data is the same as the number of bits of the first audio data; The low-bit data to be transmitted in the second audio data is obtained by data splitting when the transmission bandwidths of the first channel and the second channel are different, and the high-bit data to be transmitted in the second audio data is transmitted via a second audio coding packet.
18. The method according to claim 17, characterized in that The decoding of the first audio coding packet to obtain the third audio data includes: Unpacking the first audio coding packet to obtain a first sub-packet and a second sub-packet, wherein the first sub-packet includes at least the data to be transmitted in the first audio data, and the second sub-packet includes the low-order data to be transmitted in the second audio data; The first sub-packet is decoded to obtain the third audio data.
19. The method according to claim 18, characterized in that The decoding of the first sub-packet to obtain the third audio data includes: In a case where the first sub-packet includes the first audio data, the first sub-packet is decoded, and the decoded audio data is determined as the third audio data.
20. The method according to claim 18, characterized in that The decoding of the first sub-packet to obtain the third audio data includes: In a case where the first sub-packet includes data to be transmitted in the first audio data, decoding the first sub-packet to obtain first decoded data, where the first decoded data is audio data obtained by deleting low-order data of the first audio data; The third audio data is obtained by adding low-order data after the first decoded data, and the number of bits of the added low-order data is the same as the first number of bits of the low-order data deleted from the first audio data.
21. The method according to claim 20, characterized in that The first bit of the low-bit data deleted from the first audio data is determined according to at least one of the following information: The data volume of one frame of data corresponding to the first audio data; Audio compression rate; The average transmission bandwidth of the first channel and the second channel.
22. The method according to claim 20, characterized in that The first sub-packet carries first bit information, where the first bit information is used to indicate the first bit of low-bit data deleted from the first audio data.
23. The method according to claim 20, characterized in that The data on the bits of the added low-order data are all zero; Alternatively, the data on the bits of the added low-order data are all ones; Alternatively, the data on the bit position of the added low-order data is either zero or one.
24. The method according to claim 18, characterized in that The method further comprises: The second sub-packet is sent to a second Bluetooth receiving device, where the second Bluetooth receiving device corresponds to the second channel.
25. A data decoding method, characterized in that: The method is performed by a second Bluetooth receiving device, the second Bluetooth receiving device corresponds to a second channel, and the method includes: Receive a second audio coding packet sent by a Bluetooth sending device, where the second audio coding packet includes high-order data to be transmitted in the second audio data corresponding to the second channel; Decoding the second audio coding packet to obtain fourth audio data, where the number of bits of the fourth audio data is the same as the number of bits of the second audio data; The high-bit data to be transmitted in the second audio data is obtained by data splitting when the transmission bandwidths of the first channel and the second channel are different, and the low-bit data to be transmitted in the second audio data is transmitted via the first audio coding packet.
26. The method according to claim 25, characterized in that The method further comprises: Receive a second sub-packet sent by a first Bluetooth receiving device, where the first Bluetooth receiving device corresponds to the first channel, the second sub-packet is a sub-packet in the first audio coding packet, and the second sub-packet includes low-bit data to be transmitted in the second audio data.
27. The method according to claim 26, characterized in that The decoding the second audio coding packet to obtain fourth audio data includes: Decoding the second audio coding packet to obtain second decoded data; If the second sub-packet is successfully transmitted, decoding the second sub-packet to obtain third decoded data; The fourth audio data is determined according to the second decoded data and the third decoded data.
28. The method according to claim 27, characterized in that The determining the fourth audio data according to the second decoded data and the third decoded data comprises: When the Bluetooth sending device does not delete the low-order data of the second audio data, the audio data obtained by arranging the second decoded data and the third decoded data according to the high and low orders of the second audio data is determined as the fourth audio data.
29. The method according to claim 27, characterized in that The determining the fourth audio data according to the second decoded data and the third decoded data comprises: In a case where the Bluetooth sending device deletes the low-order data of the second audio data, the audio data obtained by arranging the second decoded data and the third decoded data according to the high and low orders of the second audio data is determined as the fifth audio data; The fourth audio data is obtained by adding low-bit data after the fifth audio data, and the number of bits of the added low-bit data is the same as the second number of bits of the low-bit data deleted from the second audio data.
30. The method according to claim 29, characterized in that The second number of the low-order data deleted from the second audio data is determined according to at least one of the following information: The data volume of one frame of data corresponding to the second audio data; Audio compression rate; The average transmission bandwidth of the first channel and the second channel.
31. The method according to claim 29, characterized in that The second audio coding packet or the second sub-packet carries second bit number information, where the second bit number information is used to indicate the second bit number of low-bit data deleted from the second audio data.
32. The method according to claim 29, characterized in that The data on the bits of the added low-order data are all zero; Alternatively, the data on the bits of the added low-order data are all ones; Alternatively, the data on the bit position of the added low-order data is either zero or one.
33. The method according to claim 26, characterized in that The decoding the second audio coding packet to obtain fourth audio data includes: In case that the transmission of the second sub-packet fails, decoding the second audio coding packet to obtain second decoded data; Add low-order data after the second decoded data to obtain the fourth audio data.
34. The method according to claim 33, characterized in that The step of adding low-order data after the second decoded data to obtain the fourth audio data comprises: When the Bluetooth sending device does not delete the low-bit data of the second audio data, add the low-bit data having the third digit number after the second decoded data to obtain the fourth audio data; The third bit number is the number of bits of low-bit data to be transmitted in the second audio data included in the second sub-packet.
35. The method according to claim 34, characterized in that The data on the bits of the added low-order data are all zero; Alternatively, the data on the bits of the added low-order data are all ones; Alternatively, the data on the bit position of the added low-order data is either zero or one.
36. The method according to claim 33, characterized in that The step of adding low-order data after the second decoded data to obtain the fourth audio data comprises: In a case where the Bluetooth sending device deletes the low-bit data of the second audio data, adding low-bit data having a fourth digit after the second decoded data to obtain the fourth audio data; The fourth bit number is the sum of the number of bits of low-bit data to be transmitted in the second audio data included in the second sub-packet and the second bit number of low-bit data deleted in the second audio data.
37. The method according to claim 36, characterized in that The second number of the low-order data deleted from the second audio data is determined according to at least one of the following information: The data volume of one frame of data corresponding to the second audio data; Audio compression rate; The average transmission bandwidth of the first channel and the second channel.
38. The method according to claim 36, characterized in that The second audio coding packet or the second sub-packet carries second bit information, where the second bit information is used to indicate the first bit of low-bit data deleted from the first audio data.
39. The method according to claim 36, characterized in that The data on the bits of the added low-order data are all zero; Alternatively, the data on the bits of the added low-order data are all ones; Alternatively, the data on the bit position of the added low-order data is either zero or one.
40. A data encoding device, characterized in that: The device comprises: An encoding module, used to generate a first audio encoding packet and a second audio encoding packet; The first audio coding packet at least includes data to be transmitted in the first audio data corresponding to the first channel and low-order data to be transmitted in the second audio data corresponding to the second channel, and the second audio coding packet includes high-order data to be transmitted in the second audio data; The low-bit data to be transmitted in the second audio data and the high-bit data to be transmitted in the second audio data are obtained by data splitting when the transmission bandwidths of the first channel and the second channel are different.
41. A data decoding device, characterized in that: The device comprises: A receiving module, configured to receive a first audio coding packet, wherein the first audio coding packet includes at least data to be transmitted in the first audio data corresponding to the first channel and low-bit data to be transmitted in the second audio data corresponding to the second channel; A decoding module, used to decode the first audio coding packet to obtain third audio data, where the number of bits of the third audio data is the same as that of the first audio data; The low-bit data to be transmitted in the second audio data is obtained by data splitting when the transmission bandwidths of the first channel and the second channel are different, and the high-bit data to be transmitted in the second audio data is transmitted via a second audio coding packet.
42. A data decoding device, characterized in that: The device comprises: A receiving module, used for receiving a second audio coding packet sent by a Bluetooth sending device, wherein the second audio coding packet includes high-order data to be transmitted in the second audio data corresponding to the second channel; a decoding module, configured to decode the second audio coding packet to obtain fourth audio data, wherein the number of bits of the fourth audio data is the same as the number of bits of the second audio data; The high-bit data to be transmitted in the second audio data is obtained by data splitting when the transmission bandwidths of the first channel and the second channel are different, and the low-bit data to be transmitted in the second audio data is transmitted via the first audio coding packet.
43. A Bluetooth sending device, characterized in that: The Bluetooth sending device includes a memory and a processor; At least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the data encoding method according to any one of claims 1 to 16.
44. A first Bluetooth receiving device, characterized in that: The first Bluetooth receiving device includes a memory and a processor; At least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the data decoding method according to any one of claims 17 to 24.
45. A second Bluetooth receiving device, characterized in that: The second Bluetooth receiving device includes a memory and a processor; At least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the data decoding method as described in any one of claims 25 to 39.
46. A Bluetooth system, characterized in that: The Bluetooth system includes a first Bluetooth playback device and a second Bluetooth playback device; The first Bluetooth receiving device corresponds to the first sound channel, and the first Bluetooth receiving device is used to execute the data decoding method according to any one of claims 17 to 24; The second Bluetooth receiving device corresponds to the second sound channel, and the second Bluetooth receiving device is used to execute the data decoding method as described in any one of claims 25 to 39.
47. A computer-readable storage medium, characterized in that The storage medium stores a computer program, which is used to be executed by a processor to implement the data encoding method as described in any one of claims 1 to 16, or the data decoding method as described in any one of claims 17 to 39.
48. A chip, characterized in that: The chip includes a programmable logic circuit and / or program instructions, which are used to implement the data encoding method as described in any one of claims 1 to 16, or the data decoding method as described in any one of claims 17 to 39 when an electronic device equipped with the chip is running.
49. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. The processor reads and executes the computer instructions from the computer-readable storage medium to implement the data encoding method as described in any one of claims 1 to 16, or the data decoding method as described in any one of claims 17 to 39.
Citation Information
Patent Citations
Multichannel platform audio data transmission method and device
CN112218020A
Audio transmission method and electronic equipment
CN113223539A