Audio transmission method and electronic device
By exchanging noise and transmission efficiency data between audio transmission devices and dynamically adjusting the encoding code rate, the existing audio transmission methods are solved, and the good sound quality experience and low power consumption are achieved in a noisy environment Consumption.
Patent Information
- Application Number
- CN202010086704.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-11
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2040-02-11
AI Technical Summary
The existing audio transmission methods have high computational complexity and high power consumption, so they cannot provide a good sound quality experience in noisy environments.
By exchanging noise energy data and transmission efficiency data between audio transmission devices, the encoding code rate is dynamically adjusted to reduce the complexity and power consumption of the encoding and decoding while maintaining the user's listening experience.
It effectively reduces the computational complexity and power consumption during the audio encoding and decoding process, improves the sound quality experience, and adapts to different noise environments and wireless channel quality.
Smart Images

Figure CN113314133B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an audio transmission method and electronic equipment. Background Art
[0002] With the development of communication technology, audio data can be transmitted between two devices through wireless communication. Figure 1 As shown, the mobile phone and the wireless headset establish a connection, for example, via Bluetooth (BT), and then the mobile phone can transmit audio data to the wireless headset via Bluetooth. The mobile phone can encode the audio stream to be transmitted to obtain audio data, and then the mobile phone sends the audio data to the wireless headset via Bluetooth. After receiving the audio data, the wireless headset decodes the audio data to obtain an audio stream of the audio to be played, and then plays the audio to be played.
[0003] In the prior art, in order to minimize the difference between the sound quality of the played audio and the sound quality of the source, mobile phones usually encode at the maximum bit rate, which refers to the maximum bit rate that the Bluetooth signal quality can support when the mobile phone encodes. However, there may be noise in the actual usage scenario of the user, so the user cannot experience good sound quality at all. The mobile phone encodes the audio stream at a higher bit rate, which not only has high computational complexity, but also consumes a lot of power for encoding, transmission and decoding. Summary of the invention
[0004] The present application provides an audio transmission method and an electronic device, which can solve the problems of high computational complexity and high power consumption of existing audio transmission methods.
[0005] In a first aspect, the present application provides an audio transmission method, including: a first device receives noise energy data and transmission efficiency data from a second device, wherein the noise energy data is used to indicate noise energy or noise loudness, and the transmission efficiency data is used to indicate the quality of a wireless channel between the first device and the second device; the first device determines a first bit rate according to the noise energy data, and determines a second bit rate according to the transmission efficiency data; the first device encodes an audio stream according to the smaller bit rate between the first bit rate and the second bit rate to obtain audio data; and the first device sends the audio data to the second device.
[0006] In this application, there is a wireless connection relationship between the first device and the second device. The first device can be an electronic device with an audio encoding function, such as a mobile phone, a tablet computer, a smart TV, a car device, a wearable electronic device with an audio encoding function and a wireless communication function (such as a smart bracelet), etc. The second device can be an electronic device with an audio playback function, such as a wireless headset, a wireless speaker, a smart TV, a tablet computer, a music playback device, etc.
[0007] After the first device establishes a wireless connection with the second device, the first device can encode the first audio data according to a random encoding rate, and then send the first audio data to the second device. Then, the first device receives the noise energy data and the transmission efficiency data of the received audio data from the second device. Furthermore, the first device determines the first bit rate according to the noise energy data, determines the second bit rate according to the transmission efficiency data, and encodes the audio stream according to the smaller bit rate between the first bit rate and the second bit rate to obtain audio data. Among them, the noise energy data is used to indicate the noise energy or noise loudness, and the transmission efficiency data is used to indicate the quality of the wireless channel between the first device and the second device.
[0008] It can be seen that, with this implementation, the first device uses the noise and wireless signal quality of the second device as reference factors when determining the encoding bit rate. This not only can determine a relatively small encoding bit rate, reduce the computational complexity and power consumption of encoding and decoding, but also can balance power consumption and user's hearing experience.
[0009] In a possible design, the first code rate includes: if it is determined that the noise energy data is less than a first threshold, the first code rate is a first value; or, if it is determined that the noise energy data is greater than the first threshold and less than a second threshold, the first code rate is a second value; or, if it is determined that the noise energy data is greater than the second threshold, the first code rate is a third value; wherein the first threshold is less than the second threshold, the first value is greater than the second value, and the second value is greater than the third value. Wherein, when the noise energy data is less than the first threshold, it means that the loudness of the noise heard by the user is relatively small, and the first device can use a relatively large encoding code rate to encode the audio. When the noise energy data is greater than the first threshold and less than the second threshold, it means that the loudness of the noise heard by the user is relatively medium, and the first device can use a relatively medium encoding code rate to encode the audio. When the noise energy data is greater than the second threshold, it means that the loudness of the noise heard by the user is relatively large, and the first device can use a relatively small encoding code rate to encode the audio. By adopting this implementation, the complexity of encoding can be reduced, and the power consumption and the user's hearing experience can be better balanced.
[0010] In a possible design, the first value, the second value and the third value are all preset fixed values. In some embodiments, the user has no requirements for the sound quality of the audio. Accordingly, the first device can adaptively adjust the encoding bit rate of the output audio. Based on this, in this embodiment, the first value, the second value and the third value can be preset fixed values. By adopting this implementation, the computational complexity and power consumption of encoding and decoding can be reduced, and the user's auditory experience can be maintained unchanged.
[0011] In a possible design, the first value, the second value, and the third value are all preset percentages of the initial bit rate corresponding to the audio data. In some embodiments, the user may have certain requirements for the sound quality of the audio. For example, the user may choose high-quality music, etc., and the initial bit rates of audios with different sound qualities are different. Accordingly, the first device can determine the encoding bit rate of the audio according to the initial bit rate of the audio. Based on this, in this embodiment, the first value, the second value, and the third value can be preset percentages of the initial bit rate of the audio. Using this implementation, the first device can determine the encoding bit rate according to the initial bit rate of the audio, so as to better balance the power consumption and the user's sense of hearing.
[0012] In a second aspect, the present application provides an audio transmission method, including: a second device determines noise energy data and transmission efficiency data, wherein the noise energy data is used to indicate noise energy or noise loudness, and the transmission efficiency data is used to indicate the quality of a wireless channel between the second device and a first device; the second device sends the noise energy data and the transmission efficiency data to the first device; the second device receives audio data from the first device; the second device decodes the audio data and plays the decoded audio.
[0013] In the present application, the second device is in a wireless connection relationship with the first device. After the second device establishes a wireless connection relationship with the first device, the second device can receive audio data from the first device. Furthermore, the second device can determine the noise energy data of the second device and the transmission efficiency data of the second device receiving the audio data. Then, the second device sends both the noise energy data and the transmission efficiency data to the first device, so that the first device determines a bit rate according to the quality of the noise and the wireless channel, and then selects a smaller bit rate as the encoding bit rate. This can not only reduce the power consumption of audio encoding and decoding and audio transmission, but also balance the power consumption and the user's hearing experience.
[0014] In a possible design, the second device determines the noise energy data including: the second device collects noise sound waves; the second device samples the noise sound waves to obtain a digital signal of the noise; the second device selects k consecutive sample points in the digital signal, where k is an integer greater than or equal to 1; the second device calculates the energy data corresponding to each of the k sample points to obtain k energy data; the second device uses the energy data with the smallest value among the k energy data as the noise energy data. With this implementation, the second device can determine the energy or loudness of the noise perceived by the user, and thus provide a data reference for determining the encoding bit rate of the audio.
[0015] In a possible design, the second device samples the noise sound wave to obtain a digital signal x(n) of the noise, where x(n) is greater than -1 and less than 1, and n is an integer greater than or equal to 1; the second device samples the noise sound wave to obtain a digital signal x(n), where x(n) is greater than -1 and less than 1, and n is an integer greater than or equal to 1; and the second device samples the noise sound wave according to l(n)=min(x 2 (n),x 2 (n-1), ...x 2 (nk)) determines the noise energy data l(n). The second device can collect noise sound waves through the microphone of the second device. In some embodiments, the loudness of the noise received by the microphone of the second device is the same as the loudness of the noise actually perceived by the user. Based on this, in this embodiment, the second device can accurately determine the noise energy or noise loudness actually perceived by the user according to the above algorithm, and then, can provide data reference for determining the encoding bit rate of the audio.
[0016] In a possible design, the second device samples the noise sound wave to obtain a digital signal x′(n) of the noise, where x′(n) is greater than x(n), and x′(n) is greater than -1 and less than 1; the second device converts x′(n) into x(n) according to x(n)=α1×x′(n), where α1 is greater than 0 and less than 1; the second device converts x′(n) into x(n) according to l(n)=min(x 2 (n), x 2 (n-1), ...x 2 (nk)) determines the noise energy data l(n). In some embodiments, the loudness of the noise received by the microphone of the second device is greater than the loudness of the noise actually perceived by the user. Based on this, in this embodiment, the second device can accurately determine the noise energy or noise loudness actually perceived by the user according to the above algorithm, and further, can provide data reference for determining the encoding bit rate of the audio.
[0017] In a possible design, the second device samples the noise sound wave to obtain a digital signal x′(n) of the noise, where x′(n) is greater than x(n), and x′(n) is greater than -1 and less than 1; ... and the second device samples the noise sound wave according to l′(n)=min(x ′2 (n), x ′2 (n-1), ...x ′2 (nk)) determines the initial energy data l'(n); the second device converts the initial energy data l'(n) into the noise energy data l(n) according to l(n)=α2×l'(n), where α2 is greater than 0 and less than 1. In some embodiments, the loudness of the noise received by the microphone of the second device is greater than the loudness of the noise actually perceived by the user. Based on this, in this embodiment, the second device can accurately determine the noise energy or noise loudness actually perceived by the user according to the above algorithm, and further, can provide a data reference for determining the encoding bit rate of the audio.
[0018] In a third aspect, the present application provides an electronic device having the function of implementing the method of the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. In a possible design, the structure of the above electronic device includes a processor and a transceiver, and the processor is configured to process the electronic device to perform the corresponding functions in the above method. The transceiver is used to realize the transmission and reception of data. The electronic device may also include a memory, which is used to couple with the processor and store the necessary program instructions and data for the electronic device.
[0019] In a fourth aspect, the present application provides an electronic device having the function of implementing the method of the second aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. In a possible design, the structure of the above electronic device includes a processor and a transceiver, and the processor is configured to process the electronic device to perform the corresponding functions in the above method. The transceiver is used to realize the transmission and reception of data. The electronic device may also include a memory, which is used to couple with the processor and store the necessary program instructions and data for the electronic device.
[0020] In a fifth aspect, the present application further provides a chip system, which is arranged in the electronic device in the third aspect, and includes at least one processor and an interface. The interface is coupled to the processor, and is used to receive code instructions and transmit the code instructions to the at least one processor. The at least one processor runs the code instructions and implements some or all steps of the audio transmission method in the first aspect and various possible implementations of the first aspect.
[0021] In a sixth aspect, the present application further provides a chip system, which is arranged in the electronic device in the fourth aspect, and includes at least one processor and an interface. The interface is coupled to the processor, and is used to receive code instructions and transmit the code instructions to the at least one processor. The at least one processor runs the code instructions and implements some or all steps of the audio transmission method in the second aspect and various possible implementations of the second aspect.
[0022] In the seventh aspect, the present application provides a computer storage medium, which stores instructions. When the instructions are executed on a computer, the computer executes part or all of the steps of the audio transmission method in the first aspect, the second aspect, various possible implementations of the first aspect, and various possible implementations of the second aspect.
[0023] In an eighth aspect, the present application provides a computer program product, which, when running on a computer, enables the computer to execute part or all of the steps of the audio transmission method in the first aspect, the second aspect, various possible implementations of the first aspect, and various possible implementations of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A schematic diagram of a typical audio transmission scenario provided for this application;
[0025] Figure 2 A schematic diagram of an exemplary audio transmission scenario provided for this application;
[0026] Figure 3A This is a schematic diagram of an exemplary architecture of a first device 100 provided in this application;
[0027] Figure 3B This is a schematic diagram of an exemplary architecture of a second device 200 provided in this application;
[0028] Figure 4 An exemplary signaling interaction diagram of the audio transmission method 10 provided in the present application;
[0029] Figure 5 An exemplary signaling interaction diagram of the audio transmission method 20 provided in the present application;
[0030] Fig. 6A This is a schematic diagram of an exemplary structure of an electronic device 60 provided in this application;
[0031] Figure 6B This is a schematic diagram of an exemplary structure of an electronic device 61 provided in this application;
[0032] Fig. 7A This is a schematic diagram of an exemplary structure of an electronic device 70 provided in this application;
[0033] Figure 7B This is a schematic diagram of an exemplary structure of an electronic device 71 provided in this application. DETAILED DESCRIPTION
[0034] The technical solution of the present application will be clearly described below in conjunction with the drawings in the present application.
[0035] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear contrary indication in the context. It should also be understood that although the terms first, second, etc. may be used to describe a certain class of objects in the following embodiments, the objects should not be limited to these terms. These terms are only used to distinguish the specific objects of this class of objects. For example, the terms first, second, etc. may be used to describe the bit rate in the following embodiments, but the bit rate should not be limited to these terms. These terms are only used to distinguish different bit rates. The same is true for other classes of objects that may be described by the terms first, second, etc. in the following embodiments, which will not be repeated here.
[0036] The implementation scenario of this application is described below.
[0037] like Figure 2 As shown, the present application relates to a first device and a second device, and the first device and the second device are connected to each other through a wireless channel. The first device can be used to encode audio data, and then send the audio data to the second device through the wireless channel. The second device can be used to decode the audio data, and then play the decoded audio.
[0038] The first device involved in the present application may be an electronic device with an audio coding function, such as a mobile phone, a tablet computer, a smart TV, a car device, a wearable electronic device with an audio coding function and a wireless communication function (such as a smart bracelet), etc. For example, the first device may include but is not limited to a device equipped with Or other electronic devices such as vehicle-mounted devices with other operating systems.
[0039] The second device involved in the present application may be an electronic device with an audio playback function, such as wireless headphones, wireless speakers, smart TVs, tablet computers, music playback devices (such as MP3 players, MP4 players, etc.), car-mounted devices and other electronic devices.
[0040] In the present application, the connection method between the first device and the second device may include wireless fidelity (WiFi) connection, Bluetooth connection, etc.
[0041] The audio encoding involved in this application refers to the process of sampling, quantizing, encoding, and converting the waveform signal of the audio (i.e., analog audio signal) into a digital audio signal. Correspondingly, the audio decoding involved in this application refers to the process of restoring the digital audio signal to an analog audio signal. The "sound source", "audio stream" or "input audio" described in the embodiment of this application is an analog audio signal, and the "audio data" described in the embodiment of this application is the digital audio signal obtained after encoding. Among them, the embodiment of this application can support a variety of audio codec formats, such as: pulse code modulation (PCM), waveform sound file (WAV), MP3, WMA (windows media audio), advanced audio coding (AAC), MPEG4, etc. The format supported by the encoding of the first device is the same as the format supported by the decoding of the second device.
[0042] The noise involved in this application may also be referred to as environmental noise, which refers to sounds other than the audio corresponding to the audio data received by the second device from the first device. For example, noise may include sounds emitted by vehicles in operation, sounds in public places and entertainment venues, and sounds emitted by household appliances such as televisions and washing machines. In the embodiments of this application, noise energy data may be used to represent the energy of noise or the loudness of noise.
[0043] Combination Figure 2 In an existing implementation, when determining the encoding bit rate of the audio, the first device usually uses the quality of wireless communication as a reference, without considering the influence of noise, so that the determined bit rate is relatively large. However, the actual use environment of the user usually has noise. Based on this, even if a higher bit rate is used to encode the audio data, the user's listening experience cannot be improved. Instead, it will lead to a higher computational complexity of audio encoding and decoding, and cause higher power consumption during the encoding and decoding process of the device.
[0044] The present application provides an audio transmission method and electronic device, wherein a second device can send noise at the second device end to a first device, so that the first device uses the noise as one of the reference factors when determining the encoding bit rate. In this way, not only a relatively small encoding bit rate can be determined, the computational complexity and power consumption of encoding and decoding can be reduced, but also the user's auditory experience can be maintained unchanged.
[0045] In one embodiment of the present application, Figure 3A A schematic structural diagram of the first device 100 is shown.
[0046] The first device 100 may include a processor 110, a memory 120, an antenna 130, a wireless communication module 140, an audio module 150, a power management module 160A, a battery 160B, a speaker 170A, a microphone 170B, and an earphone interface 170C, etc. The wireless communication module 140 may include a Bluetooth (BT) module, a wireless fidelity (WiFi) module, a near field communication (NFC) module, etc.
[0047] It is understood that the structure illustrated in the present application does not constitute a specific limitation on the first device 100. In other embodiments of the present application, the first device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0048] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a controller, an audio codec, a baseband processor, etc. Among them, different processing units may be independent devices or integrated into one or more processors. In some embodiments, the first device 100 may also include one or more processors 110.
[0049] The controller may be the nerve center and command center of the first device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of determining the target bit rate and the like.
[0050] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs the sound signal through an audio device (not limited to the speaker 170A). In some embodiments, the modem processor can be an independent device. In other embodiments, the modem processor can be independent of the processor 110 and be set in the same device with other functional modules.
[0051] The audio codec is used to compress (i.e., encode) or decompress (i.e., decode) digital audio. For example, the audio to be transmitted is encoded according to the target bit rate. The first device 100 may support one or more audio codecs. In this way, the first device 100 can play or record audio in a variety of encoding formats, such as PCM, WAV, MP3, WMA, AAC, MPEG4, etc.
[0052] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, etc.
[0053] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 150 via the I2S bus to achieve communication between the processor 110 and the audio module 150. In some embodiments, the audio module 150 can transmit an audio signal to the wireless communication module 140 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0054] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 150 and the wireless communication module 140 can be coupled via a PCM bus interface. In some embodiments, the audio module 150 can also transmit audio signals to the wireless communication module 140 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0055] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 140. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 140 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 150 can transmit an audio signal to the wireless communication module 140 through the UART interface to implement the function of playing music through a Bluetooth playback device (e.g., a Bluetooth headset).
[0056] It is understandable that the interface connection relationship between the modules illustrated in the present application is only a schematic illustration and does not constitute a structural limitation on the first device 100. In other embodiments, the first device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0057] The memory 120 can be used to store one or more computer programs, which include instructions. The processor 110 can run the above instructions stored in the memory 120, so that the first device 100 performs the audio transmission method provided in some embodiments of the present application, as well as data processing, etc. The memory 120 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system; the program storage area can also store one or more application programs (such as a music player, etc.). The data storage area can store data involved in the process of the first device 100 executing the embodiments of the present application (such as a target bit rate, audio data, etc.). The memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0058] The wireless communication module 140 can provide communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), optical fiber, etc., applied on the first device 100. The wireless communication module 140 can be one or more devices integrating at least one communication processing module. The wireless communication module 140 receives electromagnetic waves via the antenna 130, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 110. The wireless communication module 140 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 130.
[0059] In some embodiments, the communication solution provided by the wireless communication module 140 may enable the first device 100 to communicate with the second device 200 , so that the first device 100 may perform audio transmission with the second device 200 .
[0060] The first device 100 can implement audio functions such as music playing and recording through the audio module 150, the speaker 170A, the microphone 170B, the headphone interface 170C, and the application processor.
[0061] The audio module 150 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 150 can also be used to encode and decode audio signals. In some embodiments, the audio module 150 can be arranged in the processor 110, or some functional modules of the audio module 150 can be arranged in the processor 110.
[0062] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The first device 100 can listen to music through the speaker 170A.
[0063] Microphone 170B, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When recording, making a call or sending a voice message, the user can move the sound source close to microphone 170B to input the sound signal into microphone 170B. The first device 100 can be provided with at least one microphone 170B. In other embodiments, the first device 100 can be provided with two microphones 170B, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the first device 100 can also be provided with three, four or more microphones 170B to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
[0064] The earphone interface 170C is used to connect a wired earphone and can be a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0065] The power management module 160A is used to connect to the battery 160B. The power management module 160A receives input from the battery 160B and supplies power to the processor 110, the memory 120, and the wireless communication module 140. The power management module 160A can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 160A can also be set in the processor 110. In some other embodiments, the power management module 160A can also be set in the same device.
[0066] Figure 3AThe first device 100 shown in the exemplary embodiment may determine the target bit rate through the processor 110. The first device 100 may encode the audio to be transmitted through the audio codec. The first device 100 may send audio data to the second device 200 through the wireless communication module 140, and so on.
[0067] Figure 3B A schematic diagram of an exemplary architecture of the second device 200 is shown.
[0068] The second device 200 may include a processor 210 , a memory 220 , a wireless communication module 230 , an audio module 240 , a speaker 240A, an earphone interface 240B, a microphone 240C, a power supply 250 , and the like.
[0069] It is understood that the structure illustrated in the present application does not constitute a specific limitation on the second device 200. In other embodiments of the present application, the second device 200 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0070] In this embodiment, the hardware and software included in the processor 210 and the functions of each hardware and software are similar to those of the processor 110, for example, the audio codec included in the processor 210. This application will not be described in detail here. The processor 210 can be used to call the microphone 240 to obtain a noise signal, and then calculate the noise energy data. The processor 210 can also be used to count the transmission efficiency data of the received audio data so that the first device 100 determines the quality of wireless communication based on the transmission efficiency data. The transmission efficiency data may include at least one of the following: packet loss rate, transmission delay and retransmission rate, etc. The processor 210 can also be used to call the speaker 240A or the headphone interface 240B to play audio.
[0071] The memory 220 may be used to store one or more computer programs, which include instructions. The processor 210 may enable the second device 200 to execute the audio transmission method provided in some embodiments of the present application by running the above instructions stored in the memory 220. For example, the memory 220 may be used to cache the audio data received by the second device 200 from the first device 100, as well as the collected noise signal, etc.
[0072] The communication solution provided by the wireless communication module 230 is similar to that of the wireless communication module 140 and will not be described in detail herein. The communication solution provided by the wireless communication module 230 enables the second device 200 to communicate with the first device 100 so that the second device 200 can perform data transmission with the first device 100.
[0073] The function of the audio module 240 is similar to that of the audio module 150 and will not be described in detail here.
[0074] The function of the speaker 240A is similar to that of the speaker 170A, which will not be described in detail here. In this embodiment, the speaker 240A can be used to convert the audio electrical signal decoded by the audio codec into a sound signal. The function of the headphone interface 240B is similar to that of the headphone interface 170C, which will not be described in detail here.
[0075] The function of the microphone 240C is similar to that of the microphone 170B and will not be described in detail here. In this embodiment, the microphone 240C can be used to collect the sound waves of the noise, and then transmit the collected sound waves of the noise to the processor 210. In some embodiments, the microphone 240C can be a device belonging to the second device 200. In other embodiments, the microphone 240C can be an external device independent of other components of the second device 200.
[0076] The power supply 250 can be used to power the processor 210 , the memory 220 , the microphone 240C, etc.
[0077] Figure 3B The second device 200 shown in the exemplary embodiment can obtain the noise signal through the microphone 240C. The second device 200 can send the noise energy data to the first device 100 through the wireless communication module 230. The second device 200 can play audio through the speaker 240A or the headphone interface 240B, and so on.
[0078] The audio transmission method of the present application is exemplarily described below in conjunction with the first device 100 and the second device 200.
[0079] Figure 4 A signaling interaction diagram of an audio transmission method 10 is illustrated. The audio transmission method 10 (hereinafter referred to as method 10) involves a first device and a second device, wherein the first device and the second device have a wireless connection relationship, and the wireless connection relationship is, for example, a Bluetooth connection relationship. The first device can be implemented as a first device 100, for example. The second device can be implemented as a second device 200, for example. Method 10 includes the following steps:
[0080] Step S11: The first device sends first audio data to the second device.
[0081] After the first device and the second device establish a wireless connection, the first device can encode the audio stream at a random encoding rate to obtain the first audio data. Afterwards, the first device sends the first audio data to the second device through the wireless connection between the first device and the second device.
[0082] Step S12: The second device determines noise energy data and transmission efficiency data.
[0083] Among them, the noise energy data is used to indicate the noise energy or noise loudness actually perceived by the user, and the unit of measurement of the noise energy data can be, for example, decibel (dB). The larger the noise energy data, the greater the energy of the noise or the louder the noise. The smaller the noise energy data, the smaller the energy of the noise or the louder the noise. The transmission efficiency data is used to indicate the quality of the wireless channel between the second device and the first device. The transmission efficiency data may include at least one of the following: packet loss rate, transmission delay, and retransmission rate. For example, the second device may determine the transmission efficiency data of the first audio data after receiving the first audio data. In some embodiments, the second device may use two threads to respectively determine the noise energy data and the transmission efficiency data.
[0084] Exemplarily, the second device may collect noise sound waves through a microphone of the second device, and then sample and quantize the collected noise sound waves to obtain a digital signal of the noise. Then, the second device selects k consecutive sample points in the digital signal, calculates the energy data corresponding to each sample point in the k sample points, and then the second device may use the minimum energy data as the noise energy data. k is an integer greater than or equal to 1.
[0085] It is understandable that in actual operation, the occurrence of noise is relatively random. In some scenarios, the second device may collect occasional short-term and loud noise. Based on this, if the maximum energy data among the energy data of the above k sample points is used as the noise energy data, or the average value of the energy data of the above k sample points is used as the noise energy data, the obtained noise energy data may be inaccurate. Based on this, in a possible implementation method of the present application, the second device uses the minimum energy data as the noise energy data.
[0086] It should be pointed out that when the implementation form of the second device is different, the implementation form of the microphone on the second device is also different. Accordingly, in some scenarios, the loudness of the noise received by the microphone is the same as the loudness of the noise actually perceived by the user. For example, the loudness of the noise received by the in-ear microphone of a wireless headset is the same as the loudness of the noise actually felt by the user. For another example, the loudness of the noise received by the external microphone of a wireless speaker is the same as the loudness of the noise actually felt by the user. In other embodiments, the loudness of the noise received by the microphone is different from the loudness of the noise actually felt by the user. For example, the loudness of the noise received by the external microphone of a wireless headset is greater than the loudness of the noise actually felt by the user. Based on this, in different scenarios, the second device determines the noise energy data in different ways.
[0087] Scenario 1: The loudness of the noise received by the microphone is the same as the loudness of the noise actually perceived by the user:
[0088] After the second device collects the noise sound wave through the microphone, it samples and quantizes the noise sound wave to obtain the noise data signal x(n), where 1>x(n)>-1, and n is an integer greater than or equal to 1. Then, the second device determines the noise energy data l(n), l(n)=min(x 2 (n), x 2 (n-1), ...x 2 (nk)). Wherein, k is the window length used to select the sample point, and the value of k is as described above and will not be repeated here.
[0089] Scenario 2: The loudness of the noise received by the microphone is greater than the loudness of the noise actually perceived by the user:
[0090] Method 1: After the second device collects the noise sound wave through the microphone, it samples and quantizes the noise sound wave to obtain the noise data signal x′(n), where 1>x′(n)>-1, and n is an integer greater than or equal to 1. Then, the second device converts x′(n) into x(n), where x(n)=α1×x′(n), and α1 is greater than 0 and less than 1.
[0091] Method 2: After the second device collects the noise sound wave through the microphone, it samples and quantizes the noise sound wave to obtain the noise data signal x′(n), where 1>x′(n)>-1, and n is an integer greater than or equal to 1. Then, the second device determines the initial energy data l′(n) according to x′(n), l′(n)=min(x ′2 (n), x ′2 (n-1), ...x ′2 Then, the second device converts l′(n) to l(n), where l(n)=α2×l′(n), and α2 is greater than 0 and less than 1.
[0092] It is understandable that the above process of determining noise energy data is only a schematic description and does not limit the embodiments of the present application. In some other embodiments of the present application, the second device can determine the noise energy data in other ways according to different microphone settings and different usage scenarios. It will not be described in detail here.
[0093] Step S13: The second device sends noise energy data and transmission efficiency data to the first device.
[0094] The second device may send the noise energy data and the transmission efficiency data to the first device via the wireless channel between the second device and the first device.
[0095] Exemplarily, the operation of the second device sending the noise energy data and the operation of sending the transmission efficiency data to the first device may be performed simultaneously or not simultaneously, which is not limited here.
[0096] Step S14: The first device determines a first code rate according to the noise energy data, and determines a second code rate according to the transmission efficiency data.
[0097] The first bit rate and the second bit rate are both audio coding bit rates, and the measurement unit may be, for example, kilobits per second (kbps). The coding bit rate indicates the bytes in each audio data packet.
[0098] Combined with the description of the noise energy data in step S12, further, after receiving the noise energy data, if it is determined that the noise energy data is less than the first threshold, the first device determines that the first code rate is a first value. If it is determined that the noise energy data is greater than the first threshold and less than the second threshold, the first device determines that the first code rate is a second value. If it is determined that the noise energy data is greater than the second threshold, the first device determines that the first code rate is a third value. Wherein, the first threshold is less than the second threshold. The first threshold is, for example, -80dB, and the second threshold is, for example, -20dB. The first value is greater than the second value, and the second value is greater than the third value.
[0099] In some embodiments, the user has no requirements for the sound quality of the audio. Accordingly, the first device can adaptively adjust the encoding bit rate of the output audio. Based on this, in this embodiment, the first value, the second value, and the third value can be preset fixed values. For example, the first value is 960kbps, the second value is 256kbps, and the third value is 96kbps. By adopting this implementation method, the computational complexity and power consumption of the encoding and decoding can be reduced, and the user's auditory experience can be maintained unchanged.
[0100] In other embodiments, the user may have certain requirements for the sound quality of the audio. For example, the user may choose high-quality music, etc., and the initial bit rates of audios with different sound qualities are different. Accordingly, the first device can determine the encoding bit rate of the audio according to the initial bit rate of the audio. Based on this, in this embodiment, the first value, the second value, and the third value can be preset percentages of the initial bit rate of the audio. For example, the first value is 95% of the initial bit rate, the second value is 40% of the initial bit rate, and the third value is 10% of the initial bit rate. Using this implementation method, the first device can determine the encoding bit rate according to the initial bit rate of the audio, so as to better balance the power consumption and the user's sense of hearing.
[0101] It is understandable that the above process of determining the first code rate according to the noise energy data is only a schematic description and does not limit the embodiments of the present application. In some other embodiments of the present application, the first device can determine the first code rate according to other conditions. In addition, the specific values of the first threshold, the second threshold, the first value, the second value and the third value, as well as the determination method, can also be other. It is not limited here.
[0102] On the other hand, after receiving the transmission efficiency data of the audio data, the first device can determine the quality of wireless communication based on the transmission efficiency data, and then determine the second bit rate based on the quality of wireless communication. Taking the transmission delay of the first audio data as an example, if the transmission delay is less than the third threshold, it means that the quality of wireless communication is good, and the first device can determine the second bit rate as a larger value. If the transmission delay is greater than the third threshold, it means that the quality of wireless communication is poor, and the first device can determine the second bit rate as a smaller value. Among them, the third threshold is, for example, 2 milliseconds (ms). It will not be described in detail here.
[0103] Step S15: The first device encodes the audio stream according to the smaller bit rate between the first bit rate and the second bit rate to obtain second audio data.
[0104] The first device may support multiple encoding formats, such as PCM, WAV, MP3, WMA, AAC, MPEG4, etc. The first device may encode using any encoding format supported by the first device, which will not be described in detail here.
[0105] Step S16: The first device sends second audio data to the second device.
[0106] The first device may send the second audio data to the second device via a wireless channel between the first device and the second device.
[0107] Step S17: The second device decodes the second audio data and plays the audio corresponding to the second audio data.
[0108] The decoding format of the second audio data by the second device may be the same as the encoding format of the first device. For example, the first device uses AAC for encoding, and in this step, the second device may also use AAC for decoding.
[0109] In summary, in the audio transmission method described in the embodiment of the present application, the second device sends the noise collected by the second device end and the transmission efficiency information reflecting the quality of the wireless channel to the first device. Furthermore, the first device determines a bit rate according to the quality of the noise and the wireless channel, and then selects the smaller bit rate as the encoding bit rate. This can not only reduce the power consumption of audio encoding and decoding and audio transmission, but also balance power consumption and user's listening experience.
[0110] The audio transmission method of the embodiment of the present application is described below with reference to examples.
[0111] Exemplarily, the first device 100 is, for example, a mobile phone. The second device 200 is, for example, a wireless headset. The mobile phone establishes a Bluetooth connection with the wireless headset. The wireless headset includes an in-ear microphone and an external-ear microphone.
[0112] Figure 5The signaling interaction diagram of the audio transmission method 20 is shown. The audio transmission method 20 (hereinafter referred to as 20) includes the following steps:
[0113] Step S21: The mobile phone sends first audio data to the wireless headset.
[0114] The first audio data is the first audio data sent by the mobile phone to the wireless headset after the mobile phone and the wireless headset establish a Bluetooth connection.
[0115] In actual implementation, after the mobile phone and the wireless headset establish a Bluetooth connection, the mobile phone can encode the audio stream at a random encoding rate to obtain the first audio data. Afterwards, the mobile phone sends the first audio data to the wireless headset via the Bluetooth connection.
[0116] Step S22: The wireless headset determines noise energy data based on the noise collected by the in-ear microphone.
[0117] Exemplarily, after receiving the noise sound waves collected by the in-ear microphone, the wireless headset converts the noise sound waves into data signals x(n), and then, according to l(n)=min(x 2 (n), x 2 (n-1), ...x 2 (nk)) determines the noise energy data l(n). The noise energy data l(n) is, for example, -50 dB.
[0118] It should be noted that in some other embodiments, the wireless headset can also determine the noise energy data l(n) based on the noise collected by the external ear microphone. Since the noise loudness collected by the external ear microphone is greater than the noise loudness heard by the user, in a possible implementation, after the wireless headset converts the noise sound wave collected by the external ear microphone into a data signal x′(n), for example, x′(n) can be converted to x(n) according to the algorithm x(n)=α1×x′(n), and then, according to l(n)=min(x 2 (n), x 2 (n-1), ...x 2 (nk)) determines the noise energy data l(n).
[0119] Step S23: The wireless headset determines a transmission delay of the first audio data.
[0120] The transmission delay is, for example, 1.5 ms.
[0121] After step S21, the wireless headset may further decode the first audio data and then play the audio corresponding to the first audio data.
[0122] It should be noted that the execution of step S22 and step S23 is not limited by the description of this embodiment. In some other embodiments, the wireless headset can execute step S22 and step S23 simultaneously. In some other embodiments, the wireless headset can first execute step S23 simultaneously and then execute step S22.
[0123] Step S24: The wireless headset sends transmission delay and noise energy data to the mobile phone.
[0124] In combination with the description of step S22 and step S23, the wireless headset may send the transmission delay and noise energy data at the same time, or may not send the transmission delay and noise energy data at the same time. This application does not limit this.
[0125] Step S25: The mobile phone determines a first bit rate according to the noise energy data, and determines a second bit rate according to the transmission delay.
[0126] When the noise energy data is -50 dB, the noise energy data is greater than -80 dB and less than -20 dB. Based on this, the mobile phone can determine that the first bit rate is 256 kbps.
[0127] In addition, the transmission delay is less than 2ms, indicating that the Bluetooth signal quality is good. The mobile phone can determine, for example, that the second bit rate is 480kbps.
[0128] Step S26: The mobile phone encodes the audio stream according to the first bit rate to obtain second audio data.
[0129] The first bit rate 256 kbps is less than the second bit rate 480 kbps, and the mobile phone encodes the audio stream according to the first bit rate.
[0130] Step S27: The mobile phone sends the second audio data to the wireless headset.
[0131] Step S28: The wireless headset decodes the second audio data and plays the decoded audio.
[0132] The mobile phone and the wireless headset cyclically execute the corresponding steps in step S22 to step S28 until the mobile phone stops audio transmission or the mobile phone and the wireless headset disconnect the Bluetooth connection.
[0133] Understandably, Figure 5 This is only a schematic description and does not constitute a limitation on the embodiments of the present application. In other embodiments, the noise energy data, the first bit rate, and the second bit rate involved in the present application may be other values. In addition, the embodiments of the present application may also be applicable to other similar implementation scenarios. For example, in some other embodiments, the first device 100 may be a smart TV, and the second device 200 may be a smart speaker. This will not be described in detail here.
[0134] In summary, in the audio transmission method illustrated in the embodiment of the present application, the second device determines the noise energy data of the second device end, and determines the transmission efficiency data of the audio data, and then sends both the noise energy data and the transmission efficiency data to the first device. Furthermore, the first device determines a bit rate according to the noise energy data and the transmission efficiency data, and then selects the smaller bit rate as the encoding bit rate. This can not only reduce the power consumption of audio encoding and decoding and audio transmission, but also balance the power consumption and the user's hearing experience.
[0135] The above embodiments introduce the various schemes of the audio transmission method provided by the present application from the perspective of the hardware structure of the electronic device, the software architecture, and the actions performed by each software and hardware. Those skilled in the art should easily realize that, in combination with the processing steps of determining the noise energy data, determining the transmission efficiency data, etc. described in the embodiments disclosed herein, the present application can not only be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0136] For example, the first device 100 may implement the above corresponding functions in the form of functional modules. In some embodiments, the first device 100 may include a processing module and a transceiver module. The transceiver module may be used to perform the above Figure 4 and Figure 5 The processing module can be used to execute the above Figure 4 and Figure 5 The operations other than data transmission and reception in any of the illustrated embodiments. For details, please refer to Figure 4 and Figure 5 The relevant descriptions in the corresponding embodiments will not be repeated here.
[0137] It can be understood that the division of the above modules is only a division of logical functions. In actual implementation, the functions of the transceiver module can be integrated into the transceiver, and the functions of the processing module can be integrated into the processor. Fig. 6A As shown, the electronic device 60 includes a transceiver 601 and a processor 602. The transceiver 601 can execute the above Figure 4 and Figure 5 The processor 602 may be used to execute the above Figure 4 and Figure 5 Operations other than data transmission and reception in any of the illustrated embodiments.
[0138] For example, the transceiver 601 may be used to receive noise energy data and transmission efficiency data from a second device, wherein the noise energy data is used to indicate noise energy or noise loudness, and the transmission efficiency data is used to indicate the quality of a wireless channel between the first device and the second device. The processor 602 may be used to determine a first bit rate according to the noise energy data, determine a second bit rate according to the transmission efficiency data, and encode an audio stream according to the bit rate with a smaller value between the first bit rate and the second bit rate to obtain audio data. In this embodiment, the transceiver 601 may also be used to send the audio data to the second device.
[0139] For specific content, please refer to Figure 4 and Figure 5 The description related to the first device 100 in the corresponding embodiment will not be repeated here.
[0140] Fig. 6A The first device 100 of the present application is described from the perspective of independent functional entities. In another implementation scenario, each independently running functional entity can be integrated into a hardware entity, such as a chip. Figure 6B As shown, in this implementation scenario, the electronic device 61 may include a processor 611, a transceiver 612, and a memory 613. The memory 613 may be used to store programs / codes pre-installed in the electronic device 61, and may also store codes for execution by the processor 611.
[0141] It should be understood that the electronic device 61 of the present application may correspond to the electronic device 61 of the present application. Figure 4 and Figure 5 In the corresponding embodiment, the first device, wherein the transceiver 612 is used to perform Figure 4 and Figure 5 In any of the embodiments shown, the processor 611 is used to perform the above Figure 4 and Figure 5 Other processing of the first device in any of the illustrated embodiments except for data transmission and reception will not be described in detail here.
[0142] For specific content, please refer to Figure 4 and Figure 5 The description related to the first device in the corresponding embodiment will not be repeated here.
[0143] The second device 200 may implement the above corresponding functions in the form of functional modules. In some embodiments, the second device 200 may include a processing module and a transceiver module. The transceiver module may be used to perform the above Figure 4 and Figure 5 The processing module can be used to execute the above Figure 4 and Figure 5The operations other than data transmission and reception in any of the illustrated embodiments. For details, please refer to Figure 4 and Figure 5 The relevant descriptions in the corresponding embodiments will not be repeated here.
[0144] It can be understood that the division of the above modules is only a division of logical functions. In actual implementation, the functions of the transceiver module can be integrated into the transceiver, and the functions of the processing module can be integrated into the processor. Fig. 7A As shown, the electronic device 70 includes a transceiver 701 and a processor 702. The transceiver 701 can execute the above Figure 4 and Figure 5 The processor 702 may be used to execute the above Figure 4 and Figure 5 Operations other than data transmission and reception in any of the illustrated embodiments.
[0145] For example, the processor 702 may be used to determine noise energy data and transmission efficiency data, wherein the noise energy data is used to indicate noise energy or noise loudness, and the transmission efficiency data is used to indicate the quality of the wireless channel between the second device and the first device. The transceiver 701 may be used to send the noise energy data and the transmission efficiency data to the first device, and receive audio data from the first device. In this embodiment, the processor 702 may also be used to decode the audio data and play the decoded audio.
[0146] For specific content, please refer to Figure 4 and Figure 5 The description related to the second device 100 in the corresponding embodiment will not be repeated here.
[0147] Fig. 7A The second device 100 of the present application is described from the perspective of independent functional entities. In another implementation scenario, each independently running functional entity can be integrated into a hardware entity, such as a chip. Figure 7B As shown, in this implementation scenario, the electronic device 71 may include a processor 711, a transceiver 712, and a memory 713. The memory 713 may be used to store programs / codes pre-installed in the electronic device 71, and may also store codes for execution by the processor 711.
[0148] It should be understood that the electronic device 71 of the present application may correspond to the electronic device 71 of the present application. Figure 4 and Figure 5 In the corresponding embodiment, the second device, wherein the transceiver 712 is used to perform Figure 4 and Figure 5In any of the embodiments shown, the processor 711 is used to execute the above Figure 4 and Figure 5 Other processing of the second device in any of the illustrated embodiments except for data transmission and reception will not be described in detail here.
[0149] For specific content, please refer to Figure 4 and Figure 5 The description related to the second device in the corresponding embodiment will not be repeated here.
[0150] In a specific implementation, corresponding to the above-mentioned electronic device, the present application also provides a computer storage medium, wherein the computer storage medium set in any device can store a program, and when the program is executed, it can implement the following Figure 4 and Figure 5 Some or all of the steps in each embodiment of the audio transmission method provided. The storage medium in any device can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0151] In the present application, the transceiver may be a wireless transceiver, for example, a wireless local area network transceiver, a cellular network transceiver or a combination thereof. The processor may be a central processing unit (CPU), a network processor (NP) or a combination of a CPU and a NP. The processor may further include a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The memory may include volatile memory, such as random-access memory (RAM); the memory may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD) or solid-state drive (SSD); the memory may also include a combination of the above types of memory.
[0152] Figure 6B and Figure 7B The bus interface may also include a bus interface, which may include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by the processor and memory represented by the memory. The bus interface may also link various other circuits such as peripherals, voltage regulators, and power management circuits together, which are all well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver provides a unit for communicating with various other devices over a transmission medium. The processor is responsible for managing the bus architecture and general processing, and the memory may store messages used by the processor when performing operations.
[0153] It is also known to those skilled in the art that the various illustrative logical blocks and steps listed in the embodiments of the present application can be implemented by electronic hardware, computer software, or a combination of the two. Whether such functions are implemented by hardware or software depends on the specific application and the design requirements of the entire system. Those skilled in the art can use various methods to implement the functions described for each specific application, but such implementation should not be understood as exceeding the scope of protection of the embodiments of the present application.
[0154] The various illustrative logic units and circuits described in the embodiments of the present application can be implemented or operated by a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or the design of any combination of the above functions. The general-purpose processor can be a microprocessor, and optionally, the general-purpose processor can also be any traditional processor, controller, microcontroller or state machine. The processor can also be implemented by a combination of computing devices, such as a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration to implement.
[0155] The steps of the method or algorithm described in the embodiments of the present application can be directly embedded in the hardware, the software unit executed by the processor, or the combination of the two. The software unit can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM or other storage media of any form in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be arranged in an ASIC, and the ASIC can be arranged in an electronic device. Optionally, the processor and the storage medium can also be arranged in different components in the electronic device.
[0156] It should be understood that in various embodiments of the present application, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment.
[0157] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in this application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or message center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or message center. The computer-readable storage medium can be any available medium that a computer can access or a message storage device such as a server, message center, etc. that contains one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0158] Each part of this specification is described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment part.
[0159] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0160] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. An audio transmission method, characterized in that: include: The first device receives noise energy data and transmission efficiency data from the second device, wherein the noise energy data is used to indicate noise energy or noise loudness, and the transmission efficiency data is used to indicate the quality of the wireless channel between the first device and the second device; when the loudness of the noise sampled by the second device is greater than the loudness of the noise actually perceived by the user, the noise energy data sent by the second device is the noise energy data determined by the second device based on the noise actually perceived by the user after the sampled noise is converted into the noise actually perceived by the user; or, the noise energy data sent by the second device is the initial energy data determined by the second device based on the sampled noise, and the initial energy data is converted into the noise energy data of the noise actually perceived by the user; The first device determines a first code rate according to the noise energy data, and determines a second code rate according to the transmission efficiency data; The first device encodes the audio stream according to the smaller bit rate between the first bit rate and the second bit rate to obtain audio data; The first device sends the audio data to the second device.
2. The method according to claim 1, characterized in that The first code rate includes: If it is determined that the noise energy data is less than a first threshold, the first code rate is a first value; or, If it is determined that the noise energy data is greater than the first threshold and less than the second threshold, the first code rate is a second value; or, If it is determined that the noise energy data is greater than the second threshold, the first code rate is a third value; The first threshold is smaller than the second threshold, the first value is larger than the second value, and the second value is larger than the third value.
3. The method according to claim 2, characterized in that The first value, the second value and the third value are all preset fixed values.
4. The method according to claim 2, characterized in that The first value, the second value, and the third value are all preset percentages of an initial bit rate corresponding to the audio data.
5. An audio transmission method, characterized in that: include: The second device determines noise energy data and transmission efficiency data, wherein the noise energy data is used to indicate noise energy or noise loudness, and the transmission efficiency data is used to indicate the quality of the wireless channel between the second device and the first device; when the loudness of the noise sampled by the second device is greater than the loudness of the noise actually perceived by the user, the second device converts the sampled noise into the noise actually perceived by the user, and determines the noise energy data based on the converted noise actually perceived by the user; or, the second device determines initial energy data based on the sampled noise, and converts the initial energy data into noise energy data of the noise actually perceived by the user; The second device sends the noise energy data and the transmission efficiency data to the first device; The second device receives audio data from the first device, where the audio data is determined by the first device based on the noise energy data and the transmission efficiency data; The second device decodes the audio data and plays the decoded audio.
6. The method according to claim 5, characterized in that The second device determines the noise energy data including: The second device collects noise sound waves; The second device samples the noise sound wave to obtain a digital signal of the noise; The second device selects k consecutive sample points in the digital signal, where k is an integer greater than or equal to 1; The second device calculates energy data corresponding to each of the k sample points to obtain k energy data; The second device uses the energy data with the smallest value among the k energy data as the noise energy data.
7. The method according to claim 6, characterized in that The second device samples the noise sound wave to obtain a digital signal x(n) of the noise, where x(b) is greater than -1 and less than 1, and n is an integer greater than or equal to 1; The second device is based on l(n)=min(x 2 (n),x 2 (n-1),…x 2 (nk)) determines the noise energy data l(n).
8. The method according to claim 6 or 7, characterized in that The second device samples the noise sound wave to obtain a digital signal x′(n) of the noise, where x′(n) is greater than x(n), and x′(n) is greater than -1 and less than 1; The second device converts x′(n) into x(n) according to x(n)=α1×x′(n), where α1 is greater than 0 and less than 1; The second device is based on l(n)=min(x 2 (n),x 2 (n-1),…x 2 (nk)) determines the noise energy data l(n).
9. The method according to claim 6 or 7, characterized in that The second device samples the noise sound wave to obtain a digital signal x′(n) of the noise, where x′(n) is greater than x(n), and x′(n) is greater than -1 and less than 1; The second device is based on l'(n)=min(x' 2 (n),x′ 2 (n-1),…x′ 2 (nk)) determine the initial energy data l′(n); The second device converts the initial energy data l′(n) into the noise energy data l(n) according to l(n)=α2×l′(n), where α2 is greater than 0 and less than 1.
10. An electronic device, characterized in that: A first device comprising a processor and a transceiver, wherein: The transceiver is used to receive noise energy data and transmission efficiency data from a second device, wherein the noise energy data is used to indicate noise energy or noise loudness, and the transmission efficiency data is used to indicate the quality of the wireless channel between the first device and the second device; in a case where the loudness of the noise sampled by the second device is greater than the loudness of the noise actually perceived by the user, the noise energy data sent by the second device is the noise energy data determined by the second device based on the noise actually perceived by the user after the sampled noise is converted into the noise actually perceived by the user; or, the noise energy data sent by the second device is the initial energy data determined by the second device based on the sampled noise, and the initial energy data is converted into the noise energy data of the noise actually perceived by the user; The processor is configured to determine a first code rate according to the noise energy data, and determine a second code rate according to the transmission efficiency data; The processor is further configured to encode the audio stream according to the smaller bit rate between the first bit rate and the second bit rate to obtain audio data; The transceiver is further configured to send the audio data to the second device.
11. The electronic device according to claim 10, characterized in that: The first code rate includes: If it is determined that the noise energy data is less than a first threshold, the first code rate is a first value; or, If it is determined that the noise energy data is greater than the first threshold and less than the second threshold, the first code rate is a second value; or, If it is determined that the noise energy data is greater than the second threshold, the first code rate is a third value; The first threshold is smaller than the second threshold, the first value is larger than the second value, and the second value is larger than the third value.
12. The electronic device according to claim 11, characterized in that: The first value, the second value and the third value are all preset fixed values.
13. The electronic device according to claim 11, characterized in that: The first value, the second value, and the third value are all preset percentages of an initial bit rate corresponding to the audio data.
14. An electronic device, characterized in that: A second device comprising a processor and a transceiver, wherein The processor is configured to determine noise energy data and transmission efficiency data, wherein the noise energy data is used to indicate noise energy or noise loudness, and the transmission efficiency data is used to indicate the quality of the wireless channel between the second device and the first device; when the loudness of the noise sampled by the second device is greater than the loudness of the noise actually perceived by the user, the second device converts the sampled noise into the noise actually perceived by the user, and determines the noise energy data based on the converted noise actually perceived by the user; or, the second device determines initial energy data based on the sampled noise, and converts the initial energy data into noise energy data of the noise actually perceived by the user; The transceiver is used to send the noise energy data and the transmission efficiency data to the first device; The transceiver is further configured to receive audio data from the first device, wherein the audio data is determined by the first device based on the noise energy data and the transmission efficiency data; The processor is further configured to decode the audio data and play the decoded audio.
15. The electronic device according to claim 14, characterized in that: The processor is also used to collect noise sound waves; The processor is further used to sample the noise sound wave to obtain a digital signal of the noise; The processor is further configured to select k consecutive sample points in the digital signal, where k is an integer greater than or equal to 1; The processor is further configured to calculate energy data corresponding to each of the k sample points to obtain k energy data; The processor is further configured to use the energy data with the smallest value among the k energy data as the noise energy data.
16. The electronic device according to claim 15, characterized in that: The processor is further used to sample the noise sound wave to obtain a digital signal x(n) of the noise, where x(n) is greater than -1 and less than 1, and n is an integer greater than or equal to 1; The processor is further configured to: 2 (n),x 2 (n-1),…x 2 (nk)) determines the noise energy data l(n).
17. The electronic device according to claim 15 or 16, characterized in that: The processor is further used to sample the noise sound wave to obtain a digital signal x′(n) of the noise, where x′(n) is greater than x(n), and x′(n) is greater than -1 and less than 1; The processor is further used to convert x′(n) into x(n) according to x(n)=α1×x′(n), where α1 is greater than 0 and less than 1; The processor is further configured to: 2 (n),x 2 (n-1),…x 2 (nk)) determines the noise energy data I(n).
18. The electronic device according to claim 15 or 16, characterized in that: The processor is further used to sample the noise sound wave to obtain a digital signal x′(n) of the noise, where x′(n) is greater than x(n), and x′(n) is greater than -1 and less than 1; The processor is further configured to: 2 (n),x′ 2 (n-1),…x′ 2 (nk)) determine the initial energy data l′(n); The processor is further used to convert the initial energy data l′(n) into the noise energy data l(n) according to l(n)=α2×l′(n), where α2 is greater than 0 and less than 1.
19. A computer-readable storage medium, characterized in that: The invention comprises a computer program, which, when being run on a computer, causes the computer to execute the method according to any one of claims 1 to 9.
20. A computer program product, characterized in that The invention comprises a computer program / instruction, which implements the steps of the method according to any one of claims 1 to 9 when executed by a processor.
