Audio processing method, device, chip, electronic device and storage medium
By adopting audio processing methods based on different sampling bit widths in the audio playback device, the problems of high power consumption and high delay in existing devices are solved, and the effect of reducing device power consumption and delay is achieved, while ensuring the quality of audio playback.
Patent Information
- Application Number
- CN202210773940.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-01
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-07-01
AI Technical Summary
Existing audio playback equipment has problems of high power consumption and high latency. How to reduce equipment power consumption and reduce audio playback delay has become a technical problem that needs to be solved urgently.
By adopting an audio processing method in the electronic device and the audio output device, the audio source data is decoded based on the first sample bit width, the first decoded data is obtained, and then the first decoded data is encoded based on the second sample bit width, and the audio coded data packet is obtained. This method does not change the sampling bit width set by the audio codec, avoids initialization, and reduces memory consumption and processing time.
This method can effectively reduce the power consumption and delay of electronic devices and audio output devices, reduce memory consumption and processing time, ensure the quality of audio playback, and avoid listening experience lag caused by reinitialization.
Smart Images

Figure CN115206352B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio and video technology, and specifically to an audio processing method, device, chip, electronic device and storage medium. Background Art
[0002] With the rapid development of electronic technology, users have higher and higher requirements for audio playback effects, especially for high-quality music experience with high-fidelity sound sources. Current audio playback has problems of high power consumption and high latency. How to reduce device power consumption and reduce audio playback latency has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The embodiments of the present application disclose an audio processing method, device, chip, electronic device and storage medium, which can reduce device power consumption and audio playback delay.
[0004] The present application discloses an audio processing method, which is applied to an electronic device. The method includes:
[0005] Decoding the sound source data based on the first sampling bit width to obtain first decoded data;
[0006] Encoding the first decoded data based on a second sampling bit width to obtain an audio encoding data packet;
[0007] The first sampling bit width corresponds to the sampling bit width set by the audio codec, and the second sampling bit width corresponds to the original sampling bit width of the sound source data.
[0008] The embodiment of the present application discloses a chip, including a processor and a communication unit;
[0009] The processor is configured to:
[0010] Decoding the sound source data based on the first sampling bit width to obtain first decoded data;
[0011] Encoding the first decoded data based on a second sampling bit width to obtain an audio encoding data packet; wherein the first sampling bit width corresponds to the sampling bit width set by the audio codec, and the second sampling bit width corresponds to the original sampling bit width of the sound source data;
[0012] The communication unit is configured to:
[0013] The audio encoding data packet is sent to an audio output device via a wireless communication channel.
[0014] The present application embodiment discloses an audio processing method, which is applied to an audio output device, and the method includes:
[0015] Get audio encoding data packet;
[0016] Decoding the audio encoding data packet based on a second sampling bit width to obtain second decoded data; the second sampling bit width corresponds to an original sampling bit width of the sound source data;
[0017] The second decoded data is converted into analog data.
[0018] The embodiment of the present application discloses a chip, including a processor and a communication unit;
[0019] The communication unit is configured to:
[0020] Acquiring an audio encoding data packet via a wireless communication channel;
[0021] The processor is configured to:
[0022] The audio encoding data packet is decoded based on a second sampling bit width to obtain second decoded data; the second sampling bit width corresponds to the original sampling bit width of the sound source data.
[0023] The present application discloses an audio processing device, which is applied to an electronic device. The device includes:
[0024] A decoding module, used for decoding the sound source data based on the first sampling bit width to obtain first decoded data;
[0025] An encoding module, configured to encode the first decoded data based on a second sampling bit width to obtain an audio encoding data packet;
[0026] The first sampling bit width corresponds to the sampling bit width set by the audio codec, and the second sampling bit width corresponds to the original sampling bit width of the sound source data.
[0027] The present application embodiment discloses an audio processing device, which is applied to an audio output device, and the device includes:
[0028] An acquisition module, used for acquiring audio encoding data packets;
[0029] A decoding module, configured to decode the audio encoding data packet based on a second sampling bit width to obtain second decoded data; the second sampling bit width corresponds to an original sampling bit width of the sound source data;
[0030] A conversion module is used to convert the second decoded data into analog data.
[0031] An embodiment of the present application discloses an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements any of the above methods.
[0032] An embodiment of the present application discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, any of the above methods is implemented.
[0033] The audio processing method, device, chip, electronic device and storage medium provided in the embodiments of the present application, the electronic device decodes the sound source data based on the first sampling bit width to obtain the first decoded data, encodes the first decoded data based on the second sampling bit width to obtain the audio encoding data packet, and encodes the sound source data with the second sampling bit width corresponding to the original sampling bit width of the sound source data, which can reduce the memory consumption of the electronic device and the processing time, thereby reducing the audio playback delay and the power consumption of the device.
[0034] The audio output device obtains an audio coding data packet and decodes the audio coding data packet with a second sampling bit width corresponding to the original sampling bit width of the sound source data to achieve audio playback. This can reduce the memory consumption of the audio output device and reduce the processing time, thereby reducing audio playback delay and device power consumption.
[0035] Moreover, in the embodiment of the present application, the audio codec is not initialized, and the sampling bit width set by the audio codec is not changed, which can avoid the problem of auditory stuttering caused by reinitializing the audio codec and ensure the audio playback quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1A A schematic diagram of audio data processing in the related art;
[0038] Figure 1B An application scenario diagram of an audio processing method in an embodiment;
[0039] Figure 2 is a flowchart of an audio processing method in one embodiment;
[0040] Figure 3A is a schematic diagram of upsampling sound source data in one embodiment;
[0041] Figure 3B is a schematic diagram of down-sampling the first decoded data in one embodiment;
[0042] Figure 4 is a flowchart of an audio processing method in one embodiment;
[0043] Figure 5A A schematic diagram of the structure of an audio coding data packet in one embodiment;
[0044] Figure 5B A schematic diagram of the structure of an audio coding data packet in another embodiment;
[0045] Figure 5C A schematic diagram of the structure of an audio coding data packet in another embodiment;
[0046] Figure 6 is a flowchart of an audio processing method in another embodiment;
[0047] Figure 7 is a block diagram of an audio processing device in one embodiment;
[0048] Figure 8 is a block diagram of an audio processing device in another embodiment;
[0049] Fig. 9 FIG. 4 is a structural block diagram of an electronic device in an embodiment. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0051] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0052] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another element. For example, without departing from the scope of this application, the first sampling bit width may be referred to as the second sampling bit width, and similarly, the second sampling bit width may be referred to as the first sampling bit width. Both the first sampling bit width and the second sampling bit width are sampling bit widths, but they are not the same sampling bit width. The term "plurality" used in this application refers to two or more. The term "and / or" used in this application refers to one of the schemes, or any combination of multiple schemes.
[0053] In the related art, when an electronic device transmits audio data to an audio output device for audio playback through a receiving device, the electronic device performs a series of encoding and decoding processes on the audio source data according to the sampling bit width set by the audio codec (Codec). Figure 1A FIG. 1 is a schematic diagram of audio data processing in the related art. Figure 1A As shown, taking the example of an electronic device transmitting audio data to an audio output device for playback via Bluetooth wireless communication, the sampling bit width set by the audio codec is 24 bits. The electronic device obtains the sound source data, performs PCM (Pulse Code Modulation) decoding on the sound source data based on 24 bits, obtains PCM data in 24-bit form, and then performs Bluetooth audio coding processing such as SBC (Sub Band Coding) and AAC (Advanced Audio Coding) on the 24-bit PCM data to obtain Bluetooth audio coded data corresponding to the 24-bit parameters. The electronic device can transmit the Bluetooth audio coded data corresponding to the 24-bit parameters to the audio output device via Bluetooth wireless communication, and the audio output device performs PCM decoding on the Bluetooth audio coded data corresponding to the 24-bit parameters to obtain PCM data in 24-bit form, and then uses DAC (Digital to Analog converter) and AMP (Amplifier for Power) to perform digital-to-analog conversion and power amplification to obtain analog data, thereby playing the analog data.
[0054] In order to ensure compatibility with most audio source data, the sampling bit width set by the audio codec is usually the upper limit of the sampling bit width. When the original sampling bit width of the audio data is a smaller sampling bit width, the entire audio transmission and encoding and decoding process will still be processed and transmitted according to the sampling bit width set by the audio codec. For example, the sampling bit width set by the audio codec is 24 bits, and the original sampling bit width of the audio data is 16 bits. The entire audio transmission and encoding and decoding process will still be encoded and decoded and transmitted according to 24 bits, resulting in a waste of resources, an increase in occupied memory, an increase in audio playback delay, an increase in device power consumption, and an increase in the bandwidth occupied by transmission.
[0055] The embodiments of the present application disclose an audio processing method, device, chip, electronic device and storage medium, which can reduce device power consumption and audio playback delay, reduce memory consumption during audio processing, and do not initialize the audio codec or change the sampling bit width set by the audio codec. This can avoid the problem of auditory stuttering caused by re-initializing the audio codec, thereby ensuring the audio playback quality.
[0056] Figure 1B FIG. 1 is an application scenario diagram of an audio processing method in an embodiment. Figure 1B As shown, the electronic device 110 can establish a communication connection with the audio output device 120. The electronic device 110 may include but is not limited to a mobile phone, a smart wearable device, a vehicle-mounted terminal, a tablet computer, a PC (Personal Computer), a PDA (Personal Digital Assistant), etc. The audio output device 120 may include but is not limited to headphones, speaker devices, vehicle-mounted terminals, etc. Further, the audio output device 120 may be a TWS (True Wireless Stereo) headset.
[0057] A wireless communication connection such as Bluetooth and WiFi can be established between the electronic device 110 and the audio output device 120, or a wired communication connection can be established through a USB (Universal Serial Bus) interface. The embodiment of the present application does not specifically limit the communication connection method between the electronic device 110 and the audio output device 120.
[0058] In the process of the electronic device 110 transmitting audio data to the audio output device 120 to play audio through the audio output device 120, the electronic device 110 can decode the sound source data based on the first sampling bit width to obtain the first decoded data, and then encode the first decoded data based on the second sampling bit width to obtain the audio encoding data packet. The first sampling bit width corresponds to the sampling bit width set by the audio codec, and the second sampling bit width corresponds to the original sampling bit width of the sound source data. The electronic device 110 can send the audio encoding data packet to the audio output device 120. After the audio output device 120 obtains the audio encoding data packet, it can decode the audio encoding data packet based on the second sampling bit width to obtain the second decoded data, and then convert the second decoded data into analog data to output the analog data.
[0059] like Figure 2 As shown, in one embodiment, an audio processing method is provided, which can be applied to the above electronic device. The method may include the following steps:
[0060] Step 210: Decode the sound source data based on the first sampling bit width to obtain first decoded data.
[0061] The sampling bit width is also called sampling depth, which refers to the number of binary bits of the digital signal of the sound card. It can be used to reflect the resolution of the sound card processing. The larger the sampling bit width, the higher the resolution. After the sound signal is sampled by digital pulses at a certain sampling frequency as a continuous analog signal, each discrete pulse signal is quantized into a binary code stream with a certain quantization accuracy. The number of bits of this binary code stream is the sampling bit width.
[0062] The sound source data may refer to audio data to be played or currently being played. The sound source data may be any audio data such as music, video sound, background sound of an application running on an electronic device, call voice, prompt sound, etc., but is not limited thereto. The electronic device may transmit the sound source data to an audio output device so that the sound source data is played through the audio output device.
[0063] Before the electronic device transmits the sound source data to the audio output device, the sound source data may be first coded and decoded. The electronic device may decode the sound source data based on the first sampling bit width to obtain first decoded data, and the first sampling bit width corresponds to the sampling bit width set by the audio codec. Optionally, the sampling bit width set by the audio codec may be an upper limit sampling bit width, which can be compatible with most audio data. For example, the sampling bit width set by the audio codec may be 24 bits, 32 bits, etc., but is not limited thereto.
[0064] In some embodiments, the data format of the sound source data may include but is not limited to FLAC (Free Lossless Audio Codec, lossless audio compression coding) format, APE (compressed by Monkey's Audio) format, ALAC (Apple lossless audio codec, lossless audio format developed by Apple) format, MP3 (Moving Picture Experts Group Audio Layer III, moving picture experts compression standard audio layer 3) format, RealAudio format, etc., but are not limited to these.
[0065] Furthermore, the original sampling bit width of the sound source data may be smaller than the sampling bit width set by the audio codec, and the number of bits of each binary code stream in the sound source data is the original sampling bit width. The electronic device may decode the sound source data based on the first sampling bit width to obtain first decoded data corresponding to the first sampling bit width, and decode the sound source data corresponding to the original sampling bit width into first decoded data in the form of the first sampling bit width. For example, if the original sampling bit width corresponding to the sound source data is 16 bits, and the first sampling bit width is 24 bits, the sound source data corresponding to the 16-bit parameter may be decoded into first decoded data in the form of 24 bits.
[0066] The electronic device may upsample the sound source data corresponding to the original sampling bit width according to a preset upsampling method, and decode the upsampled sound source data to obtain first decoded data corresponding to the first sampling bit width. As a specific implementation, the preset upsampling method may be to add a preset bit value to the low bit of the sound source data in binary form to obtain the sound source data corresponding to the first sampling bit width, and may add N-bit preset bit values at the end of the sound source data corresponding to the original sampling bit width, where N may be the difference between the first sampling bit width and the second sampling bit width. The preset bit value may be set according to actual needs, for example, it may be 0 or 1, etc., but is not limited thereto.
[0067] For example, Figure 3A FIG. 1 is a schematic diagram of upsampling sound source data in one embodiment. Figure 3A As shown, the original sampling bit width corresponding to the sound source data is 16 bits, and the first sampling bit width is 24 bits. Then, 8 bits of 0 can be added to the low bits of the 16-bit sound source data to obtain 24-bit sound source data. The electronic device can then decode the 24-bit sound source data to obtain 24-bit first decoded data. It should be noted that the sound source data corresponding to the original sampling bit width can also be decoded first, and then the decoded data can be upsampled to obtain the first decoded data. The embodiment of the present application does not limit the order of upsampling and decoding.
[0068] In some embodiments, the electronic device can perform PCM decoding processing on the sound source data based on the first sampling bit width to obtain the first decoded data in PCM format. Regardless of the original sampling bit width of the sound source data, the sound source data is decoded using the first sampling bit width corresponding to the sampling bit width set by the audio codec, without the need to initialize the audio codec, and without changing the sampling bit width set by the audio codec, the problem of hearing freeze caused by reinitializing the audio codec can be avoided, thereby ensuring the audio playback quality.
[0069] Step 220: Encode the first decoded data based on the second sampling bit width to obtain an audio encoding data packet.
[0070] The second sampling bit width may be smaller than the first sampling bit width. Optionally, the second sampling bit width may be greater than or equal to the original sampling bit width of the sound source data, thereby ensuring the music quality when the sound source data is played. For example, if the original sampling bit width of the sound source data is 8 bits, the second sampling bit width may be 16 bits, 8 bits, etc. The electronic device may encode the first decoded data based on the second sampling bit width to obtain audio encoding data corresponding to the second sampling bit width, encode the first decoded data in the form of the first sampling bit width according to the second sampling bit width to obtain audio encoding data corresponding to the second sampling bit width, and then encapsulate the audio encoding data to obtain an audio encoding data packet.
[0071] The electronic device may downsample the first decoded data in the form of the first sampling bit width according to a preset downsampling method, and encode the downsampled first decoded data to obtain audio coded data corresponding to the second sampling bit width. The preset downsampling method may be a sampling method that corresponds to and matches the above-mentioned preset upsampling method. As a specific implementation, the preset upsampling method may be to add a preset bit value to the low bit of the sound source data in binary form to obtain the sound source data corresponding to the first sampling bit width, and the preset downsampling method may be to clip the bit values arranged in the last N bits of the first decoded data corresponding to the first sampling bit width. The electronic device may clip the first decoded data in binary form from the low bit to retain the part of the first decoded data corresponding to the second sampling bit width, and may clip the bit values arranged in the last N bits of the first decoded data corresponding to the first sampling bit width, and encode the clipped first decoded data to obtain audio coded data corresponding to the second sampling bit width, and then encapsulate the audio coded data to obtain an audio coded data packet. The N is the difference between the first sampling bit width and the second sampling bit width.
[0072] For example, Figure 3B FIG. 4 is a schematic diagram of downsampling the first decoded data in one embodiment. Figure 3BAs shown, the first sampling bit width corresponding to the first decoded data is 24 bits, and the second sampling bit width is 16 bits. Then, the bit values arranged in the lower 8 bits of the first decoded data in the form of 24 bits can be cropped, and the upper 16 bits of the first decoded data are retained to obtain the 16-bit first decoded data. The electronic device can then encode the 16-bit first decoded data to obtain audio encoding data corresponding to the 16-bit parameters. In other embodiments, other preset upsampling methods and preset downsampling methods can also be used, which are not limited in the embodiments of the present application.
[0073] As a specific implementation, the second sampling bit width corresponds to the original sampling bit width of the sound source data, so that the memory consumption and processing time in the audio encoding process can be reduced as much as possible while ensuring the music quality of the sound source data when playing, thereby reducing the audio playback delay and device power consumption. Taking the first sampling bit width as 24 bits, the original sampling bit width of the sound source data as 16 bits, and the second sampling bit width as 16 bits as an example, the memory occupied in the audio encoding process can be reduced by 1 / 3, and the encoding processing time and corresponding power consumption can also be reduced by 1 / 3; and taking the first sampling bit width as 24 bits, the original sampling bit width of the sound source data as 8 bits, and the second sampling bit width as 8 bits as an example, the memory occupied in the audio encoding process can be reduced by 2 / 3, and the encoding processing time and corresponding power consumption can also be reduced by 2 / 3.
[0074] Optionally, encoding processing performed on the first decoded data may include but is not limited to performing SBC, AAC, etc. encoding processing on the first decoded data.
[0075] In some embodiments, after obtaining the audio coding data packet, the electronic device may send the audio coding data packet to the audio output device via a wireless communication channel. In some embodiments, the wireless communication channel may include a Bluetooth communication channel, which includes a broadcast channel and / or a data channel.
[0076] A Bluetooth connection can be established between the electronic device and the audio output device, and the Bluetooth connection may include a classic Bluetooth connection, a BLE (Bluetooth Low Energy) connection, etc., wherein the classic Bluetooth connection is a Bluetooth communication connection established based on the classic Bluetooth protocol, and the BLE connection is a Bluetooth communication connection established based on the BLE protocol. The classic Bluetooth protocol generally refers to Bluetooth protocols below Bluetooth protocol version 4.0, and the BLE protocol generally refers to Bluetooth protocols above Bluetooth protocol version 4.0. Furthermore, the Bluetooth connection may be an LE Audio Bluetooth connection established based on the BLE connection, which can support the transmission of audio data.
[0077] The electronic device can send the target audio data packet to the audio output device through the audio service transmission channel of the Bluetooth connection. If the Bluetooth connection is a classic Bluetooth connection, the audio service transmission channel can be a transmission channel established based on the A2DP (Advanced Audio Distribution Profile, Bluetooth audio transmission model agreement) protocol or the HFP (Hands-free Profile) protocol, etc. If the Bluetooth connection is an LE Audio Bluetooth connection, the audio service transmission channel can be a transmission channel such as CIS (Connected Isochronous Streams, based on connected synchronous data streams), but is not limited to this. It should be noted that the embodiments of the present application do not limit the specific Bluetooth connection method and communication channel between the electronic device and the audio output device, and can be changed according to the development of the Bluetooth standard protocol. The electronic device transmits an audio coding data packet with a smaller sampling bit width to the audio output device, which can reduce the transmission bandwidth occupied by the audio coding data packet and reduce the waste of communication transmission resources.
[0078] After acquiring the audio coding data packet, the audio output device can decode the audio coding data packet based on the second sampling bit width to obtain second decoded data, and then convert the second decoded data into analog data to output the analog data to achieve audio playback. In some embodiments, the audio output device can unpack the acquired audio coding data packet to extract the audio coding data corresponding to the second sampling bit width contained in the audio coding data packet. The audio output device can perform PCM decoding on the audio coding data based on the second sampling bit width to obtain second decoded data in the form of the second sampling bit width, and then convert the second decoded data from a digital signal to an analog signal through a digital-to-analog converter to obtain first analog data, and then power amplify the first analog data through a power amplifier to obtain second analog data. The power amplifier can transmit the second analog data to the playback unit, and the audio output device outputs the second analog data through the playback unit to achieve the effect of playing audio.
[0079] For example, Figure 4 FIG. 1 is a flow chart of an audio processing method in one embodiment. Figure 4As shown, the electronic device can perform PCM decoding on the sound source data based on the first sampling bit width (such as 24 bits) to obtain first decoded data, and then perform Bluetooth audio encoding on the first decoded data based on the second sampling bit width (such as 16 bits) to obtain audio encoding data corresponding to the second sampling bit width (such as 16 bits), and encapsulate the audio encoding data corresponding to the second sampling bit width (such as 16 bits) into an audio encoding data packet. The electronic device can transmit the audio encoding data packet to the audio output device via the Bluetooth wireless channel. After the audio output device receives the audio encoding data packet via the Bluetooth wireless channel, it can unpack the audio encoding data packet to extract the audio encoding data corresponding to the second sampling bit width (such as 16 bits), and perform PCM decoding on the audio encoding data based on the second sampling bit width (such as 16 bits) to obtain second decoded data. The audio output device can then perform digital-to-analog conversion and power amplification processing on the second decoded data through DAC and AMP respectively to obtain analog data, and finally output the analog data through the playback unit. Compared to Figure 1A The audio processing method shown can save memory consumption and processing time of electronic devices and audio output devices during the encoding and decoding process, effectively reduce audio delay and power consumption, and reduce the bandwidth occupied when transmitting audio encoding data packets.
[0080] In an embodiment of the present application, the electronic device encodes the first decoded data by using a second sampling bit width corresponding to the original sampling bit width of the sound source data, and the original sampling bit width is smaller than the sampling bit width set by the audio codec, which can reduce the memory consumption and processing time in the encoding process, thereby reducing the audio playback delay and device power consumption. The audio output device decodes the audio encoding data packet by using a second sampling bit width corresponding to the original sampling bit width of the sound source data, which can reduce the memory consumption and processing time in the decoding process, thereby reducing the audio playback delay and device power consumption. Moreover, in the embodiment of the present application, the audio codec is not initialized, and the sampling bit width set by the audio codec is not changed, which can avoid the problem of hearing jamming caused by reinitializing the audio codec, thereby ensuring the audio playback quality.
[0081] In some embodiments, the electronic device encodes the first decoded data based on the second sampling bit width to obtain audio encoding data corresponding to the second sampling bit width, and can encapsulate the audio encoding data according to a preset data packet format to obtain an audio encoding data packet. Several data packet formats of audio encoding data packets are introduced below:
[0082] (1) The audio coding data packet includes a packet header and a data portion, and the packet header includes a first bit width field and a second bit width field.
[0083] The first bit width field represents the sampling bit width set by the audio codec, and the first bit width field can be used to indicate the above-mentioned first sampling bit width.
[0084] The second bit width field represents the sampling bit width actually used in the encoding process of the audio encoding data packet, and the second bit width field is used to indicate the above-mentioned second sampling bit width.
[0085] The data portion is used to store audio encoding data corresponding to the second sampling bit width.
[0086] As an implementation, the first bit width field may be stored in the first data segment of the packet header of the audio coding data packet, and the second bit width field may be stored in the second data segment of the packet header of the audio coding data packet. Optionally, the first data segment may be located before the second data segment. In some embodiments, the second bit width field may be stored in a reserved field of the packet header, which is a field in the packet header that has been defined for a specific purpose. Part of the reserved field may be used to store the second bit width field, so that there is no need to make major adjustments to the overall structure of the packet header, and the packetization method is simpler and faster.
[0087] In some embodiments of the present application, the first bit width field indicates the 24-bit sampling set by the audio codec (i.e., the first sampling bit width is 24 bits), and the second bit width field indicates the 16-bit sampling used by the sound source data (i.e., the second sampling bit width is 16 bits), but the first bit width field and the second bit width field only occupy 2 bits, indicating 4 situations, for example, binary 00 indicates 8-bit sampling, 01 indicates 16-bit sampling, 10 indicates 24-bit sampling, and binary 11 indicates 32-bit sampling. Thus, the information of the first sampling bit width and the second sampling bit width can be represented by a total of 4 bits. Taking into account the development of technology, the first bit width field and the second bit width field may each occupy 3 bits, thereby respectively indicating 8 situations.
[0088] In some embodiments of the present application, the packet header of the audio coding data packet occupies a total of 64 bits. The first bit width field, the second bit width field, and the judgment field that may be set are all stored using the reserved field in the packet header. In the case where part of the reserved field in the packet header is occupied, the first bit width field and the second bit width field can be stored using the unoccupied reserved field as much as possible, and the part that cannot be stored will be stored in the newly set bit or byte after the 64 bits of the packet header. It should be understood that the 64-bit packet header is only used for illustration, and does not limit the size or structure of the packet header.
[0089] In some embodiments of the present application, the first sampling bit width is not the same as the sampling bit width set by the audio codec, and the second sampling bit width is also different from the original sampling bit width of the sound source data; instead, the first sampling bit width is in a first proportional relationship with the sampling bit width set by the audio codec, and the second sampling bit width is also in a first proportional relationship with the original sampling bit width of the sound source data. Alternatively, the first sampling bit width is in a first difference relationship with the sampling bit width set by the audio codec, and the second sampling bit width is also in a first difference relationship with the original sampling bit width of the sound source data.
[0090] The data portion may be stored in the third data segment of the audio coding data packet. Optionally, the packet header may be located before the third data segment of the audio coding data packet.
[0091] For example, Figure 5A FIG. 1 is a schematic diagram of the structure of an audio coding data packet in an embodiment. Figure 5A As shown, the audio coding data packet may include a packet header and a data portion, and the packet header may include a first packet header information and a second bit width field, and the first packet header information may be stored in the first data segment of the packet header. The first packet header information may include a first bit width field, and the second bit width field may be located between the first packet header information and the data portion, that is, the first bit width field is located before the second bit width field, and further, the second bit width field may be located at the end of the packet header. For example, if the first sampling bit width is 24 bits and the second sampling bit width is 16 bits, then the first bit width field in the packet header is used to indicate 24 bits, and the second bit width field is used to indicate 16 bits, and the data portion may include audio coding data corresponding to the 16-bit parameter.
[0092] After obtaining the audio coding data packet, the audio output device can unpack the audio coding data packet to extract the packet header and the data portion of the audio coding data packet. The audio output device can decode the audio coding data stored in the data portion based on the second sampling bit width indicated by the second bit width field to obtain second decoded data.
[0093] In some embodiments, the packet header of the audio coding data packet may further include a first length field and / or a second length field. Further, the first packet header information in the packet header may further include a first length field and / or a second length field.
[0094] The length parameter stored in the first length field is the data length of the packet header. Optionally, the packet header includes the first packet header information and the second bit width field. The length parameter stored in the first length field may be the sum of the data lengths of the first packet header information and the second bit width field. The data length may refer to the number of bits occupied. The length parameter stored in the first length field may be the number of bits occupied by the first packet header information and the number of bits occupied by the second bit width field. For example, Figure 5AAs shown, the number of bits occupied by the first packet header information in the packet header is M, the number of bits occupied by the second bit width field is 8, and the length parameter stored in the first length field can be M+8.
[0095] As an implementation mode, when the audio output device unpacks the audio coding data packet, it may first extract the packet header from the audio coding data packet to obtain the various fields contained in the packet header, such as the first bit width field, the second bit width field, the first length field, etc. Optionally, the first packet header information in the packet header may be first extracted from the first data segment of the audio packet header, and then the second bit width field may be extracted from the second data segment of the packet header according to the length parameter stored in the first length field in the first packet header information, and the data portion of the audio coding data packet may be extracted from the third data segment of the audio coding data packet. Since the length parameter stored in the first length field is the sum of the first packet header information in the packet header and the data length of the second bit width field, the audio output device may accurately extract the second bit width field from the audio coding data packet using the length parameter stored in the first length field, thereby ensuring that subsequent decoding processing is accurately performed based on the second sampling bit width stored in the second bit width field, thereby improving processing efficiency and processing accuracy.
[0096] The length parameter stored in the second length field is the data length of the data portion. The length parameter stored in the second length field is the number of bits occupied by the data portion. As an implementation, the audio output device can extract the data portion of the audio coding data packet from the third data segment of the audio coding data packet according to the length parameter stored in the second length field in the packet header of the audio coding data packet, thereby ensuring that the audio output device accurately obtains the audio coding data corresponding to the second sampling bit width.
[0097] In an embodiment of the present application, the audio output device can accurately identify the audio coding data packet as an audio coding data packet encoded and processed according to the second sampling bit width based on the first length field and / or the second length field in the packet header of the audio coding data packet, and accurately unpack it, so as to effectively distinguish the audio coding data packet of the embodiment of the present application from the audio coding data packet in the related technology (the entire audio transmission and encoding and decoding process are processed and transmitted according to the sampling bit width set by the audio codec), thereby ensuring the accuracy of subsequent audio processing and playback.
[0098] Optionally, the first header information of the packet header of the above-mentioned audio coding data packet may also include other fields, such as one or more of a supplier identifier of the audio source data, an encoder identifier of the audio source data, a version identifier of the audio source data, a sampling rate, and the number of channels, but not limited thereto. The supplier identifier may be used to identify the supplier of the audio data, and the encoder identifier may be used to identify the encoding format of the audio source data. Audio source data of different encoding formats may correspond to different encoder identifiers.
[0099] In the embodiment of the present application, the audio coding data packet may include a packet header and a data portion, and the packet header may include a first bit width field and a second bit width field, which can ensure that the audio output device decodes the audio coding data according to the second sampling bit width indicated by the second bit width field after unpacking, which can reduce the memory consumption of the audio output device and the processing time, thereby reducing the audio playback delay and device power consumption. Moreover, since the first sampling bit width indicated by the first bit width field remains unchanged, the audio output device will not initialize the audio codec, which can avoid the problem of auditory stuttering caused by re-initializing the audio codec.
[0100] (2) The audio coding data packet includes a packet header and a data portion, and the packet header includes a first bit width field, a judgment field and a second bit width field.
[0101] In addition to the first bit width field, the second bit width field and other fields introduced in the above-mentioned data packet format (1), the packet header of the audio coding data packet may also include a judgment field, which can be used to indicate whether the first bit width field and the second bit width field in the packet header are consistent. Further, the judgment field can be used to indicate whether the sampling bit width set by the audio codec (corresponding to the first sampling bit width) is consistent with the sampling bit width (i.e., the second sampling bit width) used in the encoding process of the electronic device.
[0102] Optionally, the judgment field may use different judgment flags to indicate whether the first bit width field and the second bit width field in the packet header are consistent. If the first judgment flag is stored in the judgment field, it indicates that the first bit width field and the second bit width field in the packet header are consistent. If the second judgment flag is stored in the judgment field, it indicates that the first bit width field and the second bit width field in the packet header are inconsistent. The first judgment flag and the second judgment flag may be set according to actual needs. For example, the first judgment flag may be 0, the second judgment flag may be 1, etc., but is not limited thereto.
[0103] As an implementation, the determination field may be stored in the fourth data segment of the packet header of the audio coding data packet, and the position of the fourth data segment in the packet header may be pre-configured, for example, the fourth data segment may be between the first data segment of the packet header and the second data segment of the packet header, or the fourth data segment may be after the second data segment of the packet header, etc., which is not limited here. Further, the determination field may be stored in a reserved field of the packet header.
[0104] For example, Figure 5B FIG. 1 is a schematic diagram of the structure of an audio coding data packet in another embodiment. Figure 5BAs shown, the audio coding data packet may include a packet header and a data portion, and the packet header may include first packet header information, a judgment field and a second bit width field, and the first packet header information may be stored in the first data segment of the packet header. The first packet header information may include a first bit width field, the judgment field may be located between the first packet header information and the second bit width field, and the second bit width field may be located before the data portion. For example, if the first sampling bit width is 24 bits and the second sampling bit width is 16 bits, then the first bit width field in the packet header is used to indicate 24 bits, the second bit width field is used to indicate 16 bits, and the judgment field may be 1 (indicating that the first bit width field is inconsistent with the second bit width field).
[0105] For example, Figure 5C FIG. 1 is a schematic diagram of the structure of an audio coding data packet in another embodiment. Figure 5C As shown, the audio encoding data packet may include a packet header and a data portion. The packet header may include first packet header information, a judgment field and a second bit width field. The judgment field may be located after the second bit width field, that is, the judgment field may be located at the end of the packet header, and the first packet header information may be located before the second bit width field.
[0106] As an implementation method, the length parameter stored in the first length field in the packet header of the audio coding data packet may be the sum of the first packet header information, the judgment field, and the data length of the actual sampling bit width. As an implementation method, when the audio output device unpacks the audio coding data packet, it may first extract the first packet header information in the packet header from the audio coding data packet, and then extract the second bit width field and the judgment field from the second data segment and the fourth data segment of the packet header according to the length parameter stored in the first length field in the first packet header information. The audio output device may determine whether the first bit width field is consistent with the second bit width field according to the judgment field, thereby improving the accuracy of subsequent audio processing.
[0107] In an embodiment of the present application, the packet header of the audio encoding data packet may also include a judgment field, and the audio output device may determine whether the first bit width field is consistent with the second bit width field based on the judgment field, thereby improving the accuracy of subsequent audio processing.
[0108] It should be noted that the data packet format of the target audio data packet is not limited to the above-mentioned data packet formats. The audio coding data packet may also include other field information, such as a check code, etc. The position of each field in the audio coding data packet is not limited to the several methods described in the above-mentioned embodiments. The data packet format of the audio coding data packet can be adjusted based on actual needs.
[0109] In an embodiment of the present application, after the electronic device performs encoding processing using a second sampling bit width corresponding to the original sampling bit width of the sound source data, it can encapsulate the audio encoding data into an audio encoding data packet according to a preset data packet format, thereby ensuring that the audio output device accurately unpacks and processes the audio encoding data packet, thereby improving the audio processing performance of the audio output device.
[0110] In one embodiment, a chip is provided, configured to execute the steps in the audio processing method applied to an electronic device as described in the above embodiments.
[0111] The chip may include a processor and a communication module. The processor may be configured to: perform the steps of decoding the sound source data based on the first sampling bit width to obtain the first decoded data, and encoding the first decoded data based on the second sampling bit width to obtain the audio encoding data packet. The communication module may be configured to: perform the step of sending the audio encoding data packet to the audio output device via the wireless communication channel. The chip may be set in electronic devices such as mobile phones, wearable devices, vehicle-mounted terminals, tablet computers, etc.
[0112] like Figure 6 As shown, in one embodiment, another audio processing method is provided, which can be applied to the above-mentioned audio output device, and the method may include the following steps:
[0113] Step 610: Obtain an audio coding data packet.
[0114] In one embodiment, step 610 includes: acquiring an audio encoding data packet via a wireless communication channel; the wireless communication channel includes a Bluetooth communication channel, and the Bluetooth communication channel includes a broadcast channel and / or a data channel.
[0115] Step 620: decode the audio coding data packet based on the second sampling bit width to obtain second decoded data. The second sampling bit width corresponds to the original sampling bit width of the sound source data.
[0116] In one embodiment, the second sampling bit width is smaller than the first sampling bit width, and the first sampling bit width corresponds to the sampling bit width set by the audio codec.
[0117] In one embodiment, the original sampling bit width is smaller than the sampling bit width set by the audio codec.
[0118] In one embodiment, the step of decoding the audio coding data packet based on the second sampling bit width includes: unpacking the audio coding data packet to extract the packet header and the data portion in the audio coding data packet; the packet header includes a first bit width field and a second bit width field of the audio codec, the first bit width field is used to indicate the first sampling bit width, and the second bit width field is used to indicate the second sampling bit width; based on the second sampling bit width indicated in the second bit width field, the audio coding data stored in the data portion is decoded.
[0119] In one embodiment, the packet header of the audio coding data packet further includes a judgment field, and the judgment field is used to indicate whether the first bit width field is consistent with the second bit width field.
[0120] Step 630: Convert the second decoded data into analog data.
[0121] It should be noted that the specific description of the audio processing method applied to the audio output device provided in the embodiment of the present application can refer to the description of the audio processing method applied to the electronic device provided in the above embodiments, and will not be repeated here.
[0122] In the embodiment of the present application, the audio output device decodes the audio coding data packet through the second sampling bit width corresponding to the original sampling bit width of the sound source data. The original sampling bit width of the sound source data is smaller than the sampling bit width set by the audio codec, which can reduce the memory consumption and processing time in the decoding process, thereby reducing the audio playback delay and device power consumption. Moreover, in the embodiment of the present application, the audio codec is not initialized, and the sampling bit width set by the audio codec is not changed, which can avoid the problem of hearing jamming caused by re-initializing the audio codec, thereby ensuring the audio playback quality.
[0123] In one embodiment, a chip is provided, configured to execute the steps in the audio processing method applied to an audio output device as described in the above embodiments.
[0124] The chip may include a processor and a communication module, the communication module may be configured to: execute the step of acquiring an audio coding data packet via a wireless communication channel, the processor may be configured to: execute the step of decoding the audio coding data packet based on the second sampling bit width to obtain second decoded data, etc. The chip may be set in an audio output device, such as headphones, speakers, car players, etc.
[0125] like Figure 7 As shown, in one embodiment, an audio processing device 700 is provided, which can be applied to the above-mentioned electronic device. The audio processing device 700 may include a decoding module 710 and an encoding module 720.
[0126] The decoding module 710 is used to decode the sound source data based on the first sampling bit width to obtain first decoded data.
[0127] The encoding module 720 is used to encode the first decoded data based on the second sampling bit width to obtain an audio encoding data packet, wherein the first sampling bit width corresponds to the sampling bit width set by the audio codec, and the second sampling bit width corresponds to the original sampling bit width of the sound source data.
[0128] In one embodiment, the second sampling bit width is smaller than the first sampling bit width.
[0129] In one embodiment, the original sampling bit width of the audio source data is smaller than the sampling bit width set by the audio codec.
[0130] In one embodiment, the encoding module 720 is further configured to clip the first decoded data in binary form from the lower bits to retain a portion of the first decoded data corresponding to the second sampling bit width.
[0131] In one embodiment, the audio processing device 700 further includes a sending module.
[0132] The sending module is used to send the audio coding data packet to the audio output device via the wireless communication channel. The wireless communication channel includes a Bluetooth communication channel, and the Bluetooth communication channel includes a broadcast channel and / or a data channel.
[0133] In the embodiment of the present application, the electronic device encodes the first decoded data through the second sampling bit width corresponding to the original sampling bit width of the sound source data. The original sampling bit width of the sound source data is smaller than the sampling bit width set by the audio codec, which can reduce the memory consumption and processing time in the encoding process, thereby reducing the audio playback delay and device power consumption. Moreover, in the embodiment of the present application, the audio codec is not initialized, and the sampling bit width set by the audio codec is not changed, which can avoid the problem of hearing jamming caused by re-initializing the audio codec, thereby ensuring the audio playback quality.
[0134] In one embodiment, an audio coding data packet includes a packet header and a data portion, the packet header includes a first bit width field and a second bit width field; the first bit width field is used to indicate a first sampling bit width, and the second bit width field is used to indicate a second sampling bit width; the data portion is used to store audio coding data.
[0135] In one embodiment, the first bit width field is stored in the first data segment of the packet header, and the second bit width field is stored in the second data segment of the packet header, and the first data segment is located before the second data segment.
[0136] In one embodiment, the packet header of the audio coding data packet further includes a judgment field, and the judgment field is used to indicate whether the first bit width field is consistent with the second bit width field.
[0137] In an embodiment of the present application, after the electronic device performs encoding processing using a second sampling bit width corresponding to the original sampling bit width of the sound source data, it can encapsulate the audio encoding data into an audio encoding data packet according to a preset data packet format, thereby ensuring that the audio output device accurately unpacks and processes the audio encoding data packet, thereby improving the audio processing performance of the audio output device.
[0138] like Figure 8 As shown, in one embodiment, an audio processing device 800 is provided, which can be applied to the above-mentioned audio output device. The audio processing device 800 may include an acquisition module 810, a decoding module 820 and a conversion module 830.
[0139] The acquisition module 810 is used to acquire an audio coding data packet.
[0140] In one embodiment, the acquisition module 810 is further used to acquire the audio coding data packet via a wireless communication channel; the wireless communication channel includes a Bluetooth communication channel, and the Bluetooth communication channel includes a broadcast channel and / or a data channel.
[0141] The decoding module 820 is used to decode the audio coding data packet based on the second sampling bit width to obtain second decoded data; the second sampling bit width corresponds to the original sampling bit width of the sound source data.
[0142] In one embodiment, the second sampling bit width is smaller than the first sampling bit width, and the first sampling bit width corresponds to the sampling bit width set by the audio codec.
[0143] In one embodiment, the original sampling bit width is smaller than the sampling bit width set by the audio codec.
[0144] In one embodiment, the decoding module 820 includes a depacketizing unit and a decoding unit.
[0145] The unpacking unit is used to unpack the audio coding data packet to extract the packet header and data portion in the audio coding data packet; the packet header includes a first bit width field and a second bit width field, the first bit width field is used to indicate the first sampling bit width, and the second bit width field is used to indicate the second sampling bit width.
[0146] The decoding unit is used to decode the audio encoding data stored in the data part based on the second sampling bit width indicated by the second bit width field.
[0147] In one embodiment, the packet header of the audio coding data packet further includes a judgment field, and the judgment field is used to indicate whether the first bit width field is consistent with the second bit width field.
[0148] The conversion module 830 is used to convert the second decoded data into analog data.
[0149] In the embodiment of the present application, the audio output device decodes the audio coding data packet through the second sampling bit width corresponding to the original sampling bit width of the sound source data. The original sampling bit width of the sound source data is smaller than the sampling bit width set by the audio codec, which can reduce the memory consumption and processing time in the decoding process, thereby reducing the audio playback delay and device power consumption. Moreover, in the embodiment of the present application, the audio codec is not initialized, and the sampling bit width set by the audio codec is not changed, which can avoid the problem of hearing jamming caused by re-initializing the audio codec, thereby ensuring the audio playback quality.
[0150] Fig. 9 FIG. 1 is a structural block diagram of an electronic device in an embodiment. Fig. 9 As shown, the electronic device 900 may include one or more of the following components: a processor 910, and a memory 920 coupled to the processor 910, wherein the memory 920 may store one or more computer programs, and the one or more computer programs may be configured to implement the audio processing method applied to the electronic device as described in the above embodiments when executed by one or more processors 910.
[0151] The processor 910 may include one or more processing cores. The processor 910 uses various interfaces and lines to connect various parts of the entire electronic device 900, and executes various functions and processes data of the electronic device 900 by running or executing instructions, programs, code sets or instruction sets stored in the memory 920, and calling data stored in the memory 920. Optionally, the processor 910 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 910 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 910, but may be implemented separately through a communication chip.
[0152] The memory 920 may include a random access memory (RAM) or a read-only memory (ROM). The memory 920 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 920 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may also store data created by the electronic device 900 during use, etc.
[0153] The electronic device 900 may also include a Bluetooth module, which may be used to provide a Bluetooth communication function, establish a Bluetooth connection with a second electronic device, and perform Bluetooth data transmission. The Bluetooth module may support one or more Bluetooth protocols, such as classic Bluetooth, BLE, BLE Audio, etc., but is not limited thereto and may change with the development of the Bluetooth protocol.
[0154] An embodiment of the present application also provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the audio processing method applied to an audio output device as described in the above embodiments.
[0155] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the audio processing method applied to an electronic device as described in the above embodiments is implemented.
[0156] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the audio processing method applied to an audio output device as described in the above embodiments.
[0157] An embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program can be executed by a processor to implement the audio processing method applied to an electronic device as described in the above embodiments.
[0158] An embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program can be executed by a processor to implement the audio processing method applied to an audio output device as described in the above embodiments.
[0159] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a ROM, etc.
[0160] As used herein, any reference to memory, storage, database, or other medium may include nonvolatile and / or volatile memory. Suitable nonvolatile memory may include ROM, programmable ROM (Programmable ROM, PROM), erasable PROM (Erasable PROM, EPROM), electrically erasable PROM (Electrically Erasable PROM, EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache memory. By way of illustration and not limitation, RAM may be in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), memory bus direct RAM (RDRAM) and direct memory bus dynamic RAM (DRDRAM).
[0161] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application. It should be noted that "multiple" in the present application includes "two or more".
[0162] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily 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 embodiments of the present application.
[0163] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0164] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0165] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0166] The above is a detailed introduction to an audio processing method, device, chip, electronic device and storage medium disclosed in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An audio processing method, characterized in that: Applied to electronic equipment, the method comprises: Decoding the sound source data based on the first sampling bit width to obtain first decoded data; Encoding the first decoded data based on a second sampling bit width to obtain an audio encoding data packet; Among them, the first sampling bit width corresponds to the sampling bit width set by the audio codec, the second sampling bit width corresponds to the original sampling bit width of the sound source data, the second sampling bit width is smaller than the first sampling bit width, and the second sampling bit width is greater than or equal to the original sampling bit width of the sound source data.
2. The method according to claim 1, characterized in that The original sampling bit width is smaller than the sampling bit width set by the audio codec.
3. The method according to claim 1, characterized in that The audio coding data packet includes a packet header and a data portion, wherein the packet header includes a first bit width field and a second bit width field; The first bit width field is used to indicate the first sampling bit width, and the second bit width field is used to indicate the second sampling bit width; the data portion is used to store audio encoding data.
4. The method according to claim 3, characterized in that The packet header further includes a judgment field, and the judgment field is used to indicate whether the first bit width field is consistent with the second bit width field.
5. The method according to claim 3 or 4, characterized in that: The first bit width field is stored in a first data segment of the packet header, and the second bit width field is stored in a second data segment of the packet header, and the first data segment is located before the second data segment.
6. The method according to claim 5, characterized in that The second bit width field is stored in a reserved field of the packet header.
7. The method according to claim 1, characterized in that The encoding process of the first decoded data based on the second sampling bit width includes: The first decoded data in binary form is clipped from the lower bits to retain a portion of the first decoded data corresponding to the second sampling bit width.
8. The method according to any one of claims 1 to 4, 6 to 7, characterized in that: The method further comprises: Sending the audio encoding data packet to an audio output device via a wireless communication channel; The wireless communication channel includes a Bluetooth communication channel, and the Bluetooth communication channel includes a broadcast channel and / or a data channel.
9. A chip, characterized in that: including a processor and a communication unit; The processor is configured to: Decoding the sound source data based on the first sampling bit width to obtain first decoded data; The first decoded data is encoded based on a second sampling bit width to obtain an audio encoding data packet; wherein the first sampling bit width corresponds to a sampling bit width set by an audio codec, the second sampling bit width corresponds to an original sampling bit width of the sound source data, the second sampling bit width is smaller than the first sampling bit width, and the second sampling bit width is greater than or equal to the original sampling bit width of the sound source data; The communication unit is configured to: The audio encoding data packet is sent to an audio output device via a wireless communication channel.
10. An audio processing method, characterized in that: Applied to an audio output device, the method comprises: Get audio encoding data packet; Decoding the audio coding data packet based on a second sampling bit width to obtain second decoded data; the second sampling bit width corresponds to the original sampling bit width of the sound source data; the second sampling bit width is less than the first sampling bit width, and the second sampling bit width is greater than or equal to the original sampling bit width of the sound source data, the first sampling bit width corresponds to the sampling bit width set by the audio codec, and the first sampling bit width is the sampling bit width based on which the sound source data is decoded; The second decoded data is converted into analog data.
11. The method according to claim 10, characterized in that The original sampling bit width is smaller than the sampling bit width set by the audio codec.
12. The method according to claim 10, characterized in that The decoding process of the audio coding data packet based on the second sampling bit width includes: Unpacking the audio coding data packet to extract a packet header and a data portion in the audio coding data packet; the packet header includes a first bit width field and a second bit width field, the first bit width field is used to indicate the first sampling bit width, and the second bit width field is used to indicate the second sampling bit width; Based on the second sampling bit width indicated by the second bit width field, the audio encoding data stored in the data portion is decoded.
13. The method according to any one of claims 11 to 12, characterized in that: The step of obtaining an audio coding data packet comprises: Acquiring an audio encoding data packet via a wireless communication channel; The wireless communication channel includes a Bluetooth communication channel, and the Bluetooth communication channel includes a broadcast channel and / or a data channel.
14. A chip, characterized in that: including a processor and a communication unit; The communication unit is configured to: Acquiring an audio encoding data packet via a wireless communication channel; The processor is configured to: The audio encoding data packet is decoded based on a second sampling bit width to obtain second decoded data; the second sampling bit width corresponds to the original sampling bit width of the sound source data, the second sampling bit width is smaller than the first sampling bit width, and the second sampling bit width is greater than or equal to the original sampling bit width of the sound source data, the first sampling bit width corresponds to the sampling bit width set by the audio codec, and the first sampling bit width is the sampling bit width based on which the sound source data is decoded.
15. An audio processing device, characterized in that: Applied to electronic equipment, the device comprises: A decoding module, used for decoding the sound source data based on the first sampling bit width to obtain first decoded data; An encoding module, configured to encode the first decoded data based on a second sampling bit width to obtain an audio encoding data packet; Among them, the first sampling bit width corresponds to the sampling bit width set by the audio codec, the second sampling bit width corresponds to the original sampling bit width of the sound source data, the second sampling bit width is smaller than the first sampling bit width, and the second sampling bit width is greater than or equal to the original sampling bit width of the sound source data.
16. An audio processing device, characterized in that: Applied to an audio output device, the device comprises: An acquisition module, used for acquiring audio encoding data packets; A decoding module, configured to decode the audio coding data packet based on a second sampling bit width to obtain second decoded data; the second sampling bit width corresponds to an original sampling bit width of the sound source data, the second sampling bit width is smaller than the first sampling bit width, and the second sampling bit width is greater than or equal to the original sampling bit width of the sound source data, the first sampling bit width corresponds to a sampling bit width set by an audio codec, and the first sampling bit width is a sampling bit width based on which the sound source data is decoded; A conversion module is used to convert the second decoded data into analog data.
17. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method according to any one of claims 1 to 8 or 10 to 13.
18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 or 10 to 13 is implemented.
Citation Information
Patent Citations
Bluetooth headset control method, system and device and medium
CN112671967A
Audio data checking method and device, equipment, medium and product
CN113808617A