TECHNICAL FIELD

The present application relates to the communications field, and in particular, to an audio data transmission method and apparatus.

BACKGROUND

With rapid development of mobile communications technologies, portable devices such as mobile phones and tablet computers have become necessities in people's daily life, and a BLUETOOTH technology has become a standard configuration for these portable devices.

Listening to BLUETOOTH music based on a BLUETOOTH technology is one of the most valuable applications of BLUETOOTH. The advanced audio distribution profile (A2DP) is used for an application to implement a function of playing the BLUETOOTH music. Based on a conventional BLUETOOTH technology, audio data is transmitted using an asynchronous connection-oriented logical transport (ACL) connection between devices, and currently, a BLUETOOTH device can provide a maximum physical rate of 3 megabits per second (Mb/s).

However, limited by a physical rate in a current BLUETOOTH specification, BLUETOOTH audio is transmitted in a lossy compression mode with a relatively high compression ratio, and transmission of higher-definition audio data cannot be supported.

SUMMARY

Embodiments of this application provide an audio data transmission method and apparatus, to increase an audio data transmission rate, thereby supporting transmission of higher-definition audio data.

According to a first aspect, an embodiment of this application provides an audio data transmission method. The method includes encapsulating, based on a physical layer frame header, a protocol data unit (PDU) including audio data, to obtain an audio data packet, where the physical layer frame header is modulated using a first digital modulation scheme, the PDU is modulated using a second digital modulation scheme, a value of a modulation rate of the first digital modulation scheme is equal to a value of a data transmission rate, and a value of a modulation rate of the second digital modulation scheme is less than the value of the data transmission rate, and sending the audio data packet on a BLUETOOTH low energy (BLE) physical channel at the data transmission rate.

In the foregoing method, the physical layer frame header is modulated using the first digital modulation scheme, and the PDU is modulated using the second digital modulation scheme. Because the physical layer frame header and the PDU are modulated using two different modulation schemes, the modulation rate of the modulation scheme for the PDU is lower than the data transmission rate, that is, a same symbol can carry more bits, thereby increasing an audio data transmission rate. Therefore, transmission of high-definition audio data can be supported.

In a possible design, the method further includes generating a modulation scheme identifier of the BLE physical channel, based on the modulation scheme identifier, determining that the physical layer frame header uses the first digital modulation scheme, and determining that the PDU uses the second digital modulation scheme, and sending the modulation scheme identifier.

In the foregoing method, the modulation scheme used by the physical layer frame header and the modulation scheme used by the PDU can be determined based on the modulation scheme identifier. In this way, a receiving device can demodulate the PDU based on the determined modulation scheme. In a possible design, the data transmission rate is N times the modulation rate of the second digital modulation scheme, where N is an integer greater than 1.

In the foregoing method, high-definition audio data can be transmitted on the BLE physical channel at the data transmission rate based on the PDU that is modulated using the second digital modulation scheme.

In a possible design, the PDU includes a control layer frame header and a payload, the payload is used to carry the audio data, and the control layer frame header includes indication information used to indicate a length of the audio data.

In the foregoing method, the receiving device can verify, based on the indication information for the length of the audio data in the control layer frame header, whether the received audio data is complete.

In a possible design, a bandwidth of the BLE physical channel is 2 megahertz (MHz), or a bandwidth of the BLE physical channel is 4 MHz, and the physical channel having the bandwidth of 4 MHz is formed by combining two adjacent physical channels each having a bandwidth of 2 MHz.

In the foregoing method, the audio data can be transmitted at different data transmission rates using bandwidths of different physical channels.

In a possible design, the first digital modulation scheme includes Gaussian frequency-shift keying (GFSK), and the second digital modulation scheme includes differential quadrature phase-shift keying (DQPSK) or 8-differential phase shift keying (8DPSK).

In the foregoing method, the first digital modulation scheme is the GFSK, and the second digital modulation scheme is the DQPSK or the 8DPSK. In this way, compatibility between a BLE mode and an enhanced data rate (EDR) mode is implemented, and power consumption can be reduced while the audio data is transmitted at a high speed.

In a possible design, a modulation factor of the GFSK ranges from 0.45 to 0.55.

In the foregoing method, the modulation factor of the GFSK falls within the range from 0.45 to 0.55 such that an original hardware device can be used, thereby saving hardware resources.

In a possible design, an audio connection end command is sent on the BLE physical channel.

In the foregoing method, a sending device is disconnected from the receiving device using the audio connection end command, to avoid power consumption of the sending device and the receiving device, and avoid a waste of resources.

In a possible design, the method further includes querying a codec parameter using the logical link control and adaptation protocol (L2CAP), where the codec parameter includes a coding parameter of the audio data, and encoding original audio data based on the coding parameter, to obtain the audio data.

In the foregoing method, the coding parameter is queried using the L2CAP, and the original audio data is encoded, to ensure normal audio play.

According to a second aspect, an embodiment of this application provides an audio data transmission method. The method includes receiving an audio data packet on a BLE physical channel, where the audio data packet includes a physical layer frame header and a PDU, and demodulating the physical layer frame header using a first digital modulation scheme, and demodulating the PDU using a second digital modulation scheme, to obtain audio data, where a value of a modulation rate of the first digital modulation scheme is equal to a value of a data transmission rate, and a value of a modulation rate of the second digital modulation scheme is less than the value of the data transmission rate.

In the foregoing method, the audio data packet is received on the BLE physical channel, the physical layer frame header is demodulated using the first digital modulation scheme, and the PDU is demodulated using the second digital modulation scheme. The modulation rate of the modulation scheme for the PDU of the received audio data packet is lower than the data transmission rate, that is, a same symbol can carry more bits, thereby increasing an audio data transmission rate, and supporting transmission of high-definition audio data.

In a possible design, the method further includes receiving a modulation scheme identifier of the BLE physical channel, and determining, based on the modulation scheme identifier, that the physical layer frame header uses the first digital modulation scheme, and determining, based on the modulation scheme identifier, that the PDU uses the second digital modulation scheme.

In the foregoing method, the first digital modulation scheme and the second digital modulation scheme can be determined based on the modulation scheme identifier, and then the audio data can be successfully demodulated.

In a possible design, the modulation rate of the first digital modulation scheme is equal to the data transmission rate, and the data transmission rate is N times the modulation rate of the second digital modulation scheme, where N is an integer greater than 1.

In the foregoing method, high-definition audio data can be transmitted on the BLE physical channel at the data transmission rate based on the PDU that is modulated using the second digital modulation scheme.

In a possible design, after the obtaining audio data, the method further includes returning an acknowledgement message to a sending device, where the acknowledgement message is used to indicate a receiving status of the audio data.

In the foregoing method, the acknowledgement message is returned to the sending device, to notify the sending device whether a receiving device receives the audio data.

According to a third aspect, an embodiment of this application provides an audio data transmission apparatus. The apparatus includes a baseband processor and a transmitter, the baseband processor encapsulates, based on a physical layer frame header, a PDU including audio data, to obtain an audio data packet, where the physical layer frame header is modulated using a first digital modulation scheme, the PDU is modulated using a second digital modulation scheme, a value of a modulation rate of the first digital modulation scheme is equal to a value of a data transmission rate, and a value of a modulation rate of the second digital modulation scheme is less than the value of the data transmission rate, and the transmitter sends the audio data packet on a BLE physical channel at the data transmission rate.

For the foregoing apparatus, the physical layer frame header is modulated using the first digital modulation scheme, and the PDU is modulated using the second digital modulation scheme. Because the physical layer frame header and the PDU are modulated using two different modulation schemes, the modulation rate of the modulation scheme for the PDU is lower than the data transmission rate, that is, a same symbol can carry more bits, thereby increasing an audio data transmission rate. Therefore, transmission of high-definition audio data can be supported.

In a possible design, the apparatus further includes an audio codec configured to generate a modulation scheme identifier of the BLE physical channel, the baseband processor is configured to, based on the modulation scheme identifier, determine that the physical layer frame header uses the first digital modulation scheme, and determine that the PDU uses the second digital modulation scheme, and the transmitter is configured to send the modulation scheme identifier.

In a possible design, the data transmission rate is N times the modulation rate of the second digital modulation scheme, where N is an integer greater than 1.

In a possible design, the PDU includes a control layer frame header and a payload, the payload is used to carry the audio data, and the control layer frame header includes indication information used to indicate a length of the audio data.

In a possible design, a bandwidth of the BLE physical channel is 2 MHz, or a bandwidth of the BLE physical channel is 4 MHz, and the physical channel having the bandwidth of 4 MHz is formed by combining two adjacent physical channels each having a bandwidth of 2 MHz.

In a possible design, the first digital modulation scheme includes GFSK, and the second digital modulation scheme includes DQPSK or 8DPSK.

In a possible design, a modulation factor of the GFSK ranges from 0.45 to 0.55.

In a possible design, the apparatus further includes an audio codec, the codec is configured to query a codec parameter using the L2CAP, where the codec parameter includes a coding parameter of the audio data, and the codec is further configured to encode original audio data based on the coding parameter, to obtain the audio data.

According to a fourth aspect, an embodiment of this application provides an audio data transmission apparatus. The apparatus includes a receiver and a baseband processing module, the receiver is configured to receive an audio data packet on a BLE physical channel, where the audio data packet includes a physical layer frame header and a PDU, and the baseband processing module is configured to demodulate the physical layer frame header using a first digital modulation scheme, and demodulate the PDU using a second digital modulation scheme to obtain audio data, where a value of a modulation rate of the first digital modulation scheme is equal to a value of a data transmission rate, and a value of a modulation rate of the second digital modulation scheme is less than the value of the data transmission rate.

In the foregoing apparatus, the audio data packet is received on the BLE physical channel, the physical layer frame header is demodulated using the first digital modulation scheme, and the PDU is demodulated using the second digital modulation scheme. The modulation rate of the modulation scheme for the PDU is lower than the data transmission rate, that is, a same symbol can carry more bits, thereby increasing an audio data transmission rate, and supporting transmission of high-definition audio data.

In a possible design, the apparatus further includes an audio codec, the receiver is configured to receive a modulation scheme identifier of the BLE physical channel, and the codec is configured to determine, based on the modulation scheme identifier, that the physical layer frame header uses the first digital modulation scheme, and determine, based on the modulation scheme identifier, that the PDU uses the second digital modulation scheme.

In a possible design, the value of the data transmission rate is N times the value of the modulation rate of the second digital modulation scheme, where N is an integer greater than 1.

According to a fifth aspect, an embodiment of this application provides an audio data transmission apparatus. The apparatus includes an encapsulation module and a transmission module, the encapsulation module encapsulates, based on a physical layer frame header, a PDU including audio data, to obtain an audio data packet, where the physical layer frame header is modulated using a first digital modulation scheme, the PDU is modulated using a second digital modulation scheme, a value of a modulation rate of the first digital modulation scheme is equal to a value of a data transmission rate, and a value of a modulation rate of the second digital modulation scheme is less than the value of the data transmission rate, and the transmission module sends the audio data packet on a BLE physical channel at the data transmission rate.

In a possible design, the data transmission rate is N times the modulation rate of the second digital modulation scheme, where N is an integer greater than 1.

In a possible design, the PDU includes a control layer frame header and a payload, the payload is used to carry the audio data, and the control layer frame header includes indication information used to indicate a length of the audio data.

In a possible design, a bandwidth of the BLE physical channel is 2 MHz, or a bandwidth of the BLE physical channel is 4 MHz, and the physical channel having the bandwidth of 4 MHz is formed by combining two adjacent physical channels each having a bandwidth of 2 MHz.

In a possible design, the first digital modulation scheme includes GFSK, and the second digital modulation scheme includes DQPSK or 8DPSK.

In a possible design, a modulation factor of the GFSK ranges from 0.45 to 0.55.

In a possible design, the apparatus further includes a codec module, the codec module is configured to query a codec parameter using the L2CAP, where the codec parameter includes a coding parameter of the audio data, and the codec module is further configured to encode original audio data based on the coding parameter, to obtain the audio data.

According to a sixth aspect, an embodiment of this application provides a high-speed audio data transmission apparatus. The apparatus includes a receiving module and a demodulation module, the receiving module is configured to receive an audio data packet on a BLE physical channel, where the audio data packet includes a physical layer frame header and a PDU, and the demodulation module is configured to demodulate the physical layer frame header using a first digital modulation scheme, and demodulate the PDU using a second digital modulation scheme to obtain audio data, where a value of a modulation rate of the first digital modulation scheme is equal to a value of a data transmission rate, and a value of a modulation rate of the second digital modulation scheme is less than the value of the data transmission rate.

In a possible design, the apparatus further includes a codec module, the receiving module is configured to receive a modulation scheme identifier of the BLE physical channel, and the codec module is configured to determine, based on the modulation scheme identifier, that the physical layer frame header uses the first digital modulation scheme, and determine, based on the modulation scheme identifier, that the PDU uses the second digital modulation scheme.

In a possible design, the value of the data transmission rate is N times the value of the modulation rate of the second digital modulation scheme, where N is an integer greater than 1.

According to a seventh aspect, an embodiment of this application provides a computer-readable storage medium. The computer-readable storage medium stores an instruction, and when the instruction runs on a computer or a processor, the computer or the processor is enabled to perform the method according to any one of the first aspect or the second aspect or the possible designs thereof.

An eighth aspect of this application provides a computer program product including an instruction, where when the instruction runs on a computer or a processor, the computer or the processor is enabled to perform the method according to any one of the first aspect or the second aspect or the possible designs thereof.

