CN115206352A - Audio processing method, device, chip, electronic equipment and storage medium - Google Patents

Audio processing method, device, chip, electronic equipment and storage medium Download PDF

Info

Publication number
CN115206352A
CN115206352A CN202210773940.9A CN202210773940A CN115206352A CN 115206352 A CN115206352 A CN 115206352A CN 202210773940 A CN202210773940 A CN 202210773940A CN 115206352 A CN115206352 A CN 115206352A
Authority
CN
China
Prior art keywords
bit width
audio
data
sampling bit
sampling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210773940.9A
Other languages
Chinese (zh)
Inventor
颜廷管
余庆华
王泷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zeku Technology Shanghai Corp Ltd
Original Assignee
Zeku Technology Shanghai Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zeku Technology Shanghai Corp Ltd filed Critical Zeku Technology Shanghai Corp Ltd
Priority to CN202210773940.9A priority Critical patent/CN115206352A/en
Publication of CN115206352A publication Critical patent/CN115206352A/en
Priority to PCT/CN2023/087246 priority patent/WO2024001405A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10009Improvement or modification of read or write signals
    • G11B20/10037A/D conversion, D/A conversion, sampling, slicing and digital quantisation or adjusting parameters thereof
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10009Improvement or modification of read or write signals
    • G11B20/10018Improvement or modification of read or write signals analog processing for digital recording or reproduction
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10009Improvement or modification of read or write signals
    • G11B20/10268Improvement or modification of read or write signals bit detection or demodulation methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The embodiment of the application discloses an audio processing method, an audio processing device, a chip, electronic equipment and a storage medium. The method is applied to the electronic equipment and comprises the following steps: decoding the sound source data based on the first sampling bit width to obtain first decoded data; coding the first decoding data based on a second sampling bit width to obtain an audio coding data packet; wherein the first sampling bit width corresponds to a sampling bit width set by an audio codec, and the second sampling bit width corresponds to an original sampling bit width of the audio source data. The audio processing method, the device, the chip, the electronic equipment and the storage medium can reduce equipment power consumption and audio playing delay.

Description

Audio processing method, device, chip, electronic equipment and storage medium
Technical Field
The present application relates to the field of audio and video technologies, and in particular, to an audio processing method, apparatus, chip, electronic device, and storage medium.
Background
With the rapid development of electronic technology, users have higher and higher requirements for the playing effect of audio, especially for the experience requirement of high-quality music of a high-fidelity sound source. The existing audio playing has the problems of high power consumption and high delay, and how to reduce the power consumption of equipment and reduce the delay of audio playing becomes a technical problem which needs to be solved urgently.
Disclosure of Invention
The embodiment of the application discloses an audio processing method, an audio processing device, a chip, electronic equipment and a storage medium, which can reduce equipment power consumption and audio playing delay.
The embodiment of the application discloses an audio processing method, which is applied to electronic equipment and comprises the following steps:
decoding the sound source data based on the first sampling bit width to obtain first decoded data;
coding the first decoding data based on a second sampling bit width to obtain an audio coding data packet;
wherein the first sampling bit width corresponds to a sampling bit width set by an audio codec, and the second sampling bit width corresponds to an original sampling bit width of the audio source data.
The embodiment of the application discloses a chip, which comprises 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;
coding the first decoding data based on a second sampling bit width to obtain an audio coding data packet; wherein the first sampling bit width corresponds to a sampling bit width set by an audio codec, and the second sampling bit width corresponds to an original sampling bit width of the audio source data;
the communication unit is configured to:
transmitting the audio encoded data packets to an audio output device via a wireless communication channel.
The embodiment of the application discloses an audio processing method, which is applied to audio output equipment and comprises the following steps:
acquiring an audio coding data packet;
decoding the audio coded data packet based on a second sampling bit width to obtain second decoding data; the second sampling bit width corresponds to an original sampling bit width of the audio source data;
converting the second decoded data into analog data.
The embodiment of the application discloses a chip, which comprises a processor and a communication unit;
the communication unit configured to:
obtaining an audio encoded data packet via a wireless communication channel;
the processor is configured to:
decoding the audio coded data packet based on a second sampling bit width to obtain second decoding data; the second sampling bit width corresponds to an original sampling bit width of the audio source data.
The embodiment of the application discloses audio processing device is applied to electronic equipment, the device includes:
the decoding module is used for decoding the sound source data based on the first sampling bit width to obtain first decoding data;
the encoding module is used for encoding the first decoding data 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, and the second sampling bit width corresponds to an original sampling bit width of the audio source data.
The embodiment of the application discloses audio processing device is applied to audio output equipment, the device includes:
the acquisition module is used for acquiring the audio coding data packet;
the decoding module is used for decoding the audio coding data packet based on a second sampling bit width to obtain second decoding data; the second sampling bit width corresponds to an original sampling bit width of the audio source data;
and the conversion module is used for converting the second decoding data into analog data.
An embodiment of the present application discloses an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor is enabled to implement the method as described in any one of the above.
An embodiment of the present application discloses a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method as described above.
According to the audio processing method, the device, the chip, the electronic device and the storage medium, 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 encoded data packet, and encodes the audio encoded data packet through the second sampling bit width corresponding to the original sampling bit width of the sound source data, so that the memory consumption of the electronic device can be reduced, the processing time can be shortened, and the audio playing delay and the device power consumption are reduced.
The audio output equipment acquires the audio coding data packet, and decodes the audio coding data packet by using the second sampling bit width corresponding to the original sampling bit width of the audio source data to realize audio playing, so that the memory consumption of the audio output equipment can be reduced, the processing time can be shortened, and the audio playing delay and the equipment power consumption are reduced.
In addition, in the embodiment of the application, the audio codec is not initialized, the sampling bit width set by the audio codec is not changed, the problem of audible jamming caused by reinitializing the audio codec can be avoided, and the playing quality of the audio is ensured.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1A is a diagram illustrating audio data processing in the related art;
FIG. 1B is a diagram illustrating an exemplary embodiment of an audio processing method;
FIG. 2 is a flow diagram of a method of audio processing in one embodiment;
FIG. 3A is a diagram illustrating up-sampling of audio source data according to an embodiment;
FIG. 3B is a diagram illustrating downsampling of first decoded data in one embodiment;
FIG. 4 is a flow diagram of an audio processing method in one embodiment;
FIG. 5A is a diagram illustrating an exemplary structure of an audio encoded data packet;
FIG. 5B is a diagram of an alternative embodiment of an audio encoded data packet;
FIG. 5C is a diagram of the structure of an audio encoded data packet according to another embodiment;
FIG. 6 is a flow chart of an audio processing method in another embodiment;
FIG. 7 is a block diagram of an audio processing device in one embodiment;
FIG. 8 is a block diagram of an audio processing device in another embodiment;
fig. 9 is a block diagram of an electronic device in one embodiment.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It is to be noted that the terms "comprises" and "comprising" and any variations thereof in the examples and figures of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first sampling bit width may be referred to as a second sampling bit width, and similarly, a second sampling bit width may be referred to as a first sampling bit width, without departing from the scope of the present application. The first sampling bit width and the second sampling bit width are both sampling bit widths, but are not the same sampling bit width. The term "plurality," as used herein, refers to two or more. As used herein, the term "and/or" refers to one aspect, or any combination of aspects.
In the related art, when the electronic device transmits audio data to the audio output device to perform audio playing through the receiving end device, the electronic device performs a series of encoding and decoding processes on the audio source data according to a sampling bit width set by an audio Codec (Codec). Illustratively, fig. 1A is a schematic diagram of audio data processing in the related art. As shown in fig. 1A, for example, the electronic device transmits audio data to the audio output device through bluetooth wireless communication for playing, the sampling bit width set by the audio codec is 24 bits. The electronic equipment acquires sound source data, performs PCM (Pulse Code Modulation) decoding on the sound source data based on 24 bits to obtain 24-bit PCM data, and performs Bluetooth Audio Coding processing such as SBC (Sub Band Coding ), AAC (Advanced Audio Coding, advanced Audio Coding) and the like on the 24-bit PCM data to obtain Bluetooth Audio Coding data corresponding to the 24-bit parameters. The electronic equipment can transmit the Bluetooth audio coding data corresponding to the 24-bit parameter to the audio output equipment through Bluetooth wireless communication, the audio output equipment performs PCM decoding on the Bluetooth audio coding data corresponding to the 24-bit parameter to obtain 24-bit PCM data, and then performs Digital-to-Analog conversion and Power amplification by using a DAC (Digital-to-Analog converter) and an AMP (Amplifier for Power Amplifier) to obtain Analog data, so that the Analog data is played.
In order to ensure that most sound source data are compatible, the sampling bit width set by the audio codec is usually the highest sampling bit width, when the original sampling bit width of the audio data is a smaller sampling bit width, the whole audio transmission and coding and decoding process still performs processing and transmission 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, the original sampling bit width of the audio data is 16 bits, the whole audio transmission and coding and decoding process still performs coding and decoding processing and transmission according to 24 bits, so that resource waste is caused, occupied memory is increased, audio playing delay is increased, equipment power consumption is increased, and bandwidth occupied by transmission is also increased.
The embodiment of the application discloses an audio processing method, an audio processing device, a chip, electronic equipment and a storage medium, which can reduce the power consumption of the equipment and the audio playing delay, reduce the memory consumption in the audio processing process, do not initialize an audio codec, do not change the sampling bit width set by the audio codec, avoid the problem of audible jamming caused by initializing the audio codec again, and ensure the playing quality of audio.
FIG. 1B is a diagram illustrating an exemplary audio processing method. As shown in fig. 1B, the electronic device 110 and the audio output device 120 may establish a communication connection. 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), and the like. The audio output device 120 may include, but is not limited to, a headphone, a speaker device, a vehicle terminal, and the like, and further, the audio output device 120 may be a TWS (True Wireless Stereo) headphone.
Wireless communication connection such as bluetooth and WiFi may be established between the electronic device 110 and the audio output device 120, and wired communication connection may also be established through a USB (Universal Serial Bus) interface, and the communication connection manner between the electronic device 110 and the audio output device 120 is not specifically limited in this embodiment of the application.
In the process that the electronic device 110 transmits audio data to the audio output device 120 to perform audio playing through the audio output device 120, the electronic device 110 may perform decoding processing on the sound source data based on the first sampling bit width to obtain first decoded data, and then perform encoding processing on the first decoded data based on the second sampling bit width to obtain an audio encoded data packet. Wherein the first sampling bit width corresponds to a sampling bit width set by the audio codec, and the second sampling bit width corresponds to an original sampling bit width of the audio source data. The electronic device 110 may send the audio encoded data packet to the audio output device 120, and after the audio output device 120 acquires the audio encoded data packet, the audio encoded data packet may be decoded based on the second sampling bit width to obtain second decoded data, and then the second decoded data is converted into analog data to output the analog data.
As shown in fig. 2, in one embodiment, an audio processing method is provided, which can be applied to the electronic device described above, and the method can include the following steps:
and step 210, decoding the sound source data based on the first sampling bit width to obtain first decoded data.
The sampling bit width can also be called as sampling depth, which refers to the binary bit number of the sound card digital signal and can be used for reflecting the resolution of sound card processing, and the larger the sampling bit width is, the higher the resolution is. After the sound signal is digitally pulse-sampled by a continuous analog signal at a certain sampling frequency, each discrete pulse signal is quantized into a string of binary coded streams at a certain quantization precision, and the bit number of the string of binary coded streams is the sampling bit width.
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 of music, video sound, background sound of an application program run by the electronic device, call voice, alert sound, and the like, but is not limited thereto. The electronic equipment can transmit the sound source data to the audio output equipment so as to play the sound source data through the audio output equipment.
Before the electronic device transmits the sound source data to the audio output device, the sound source data may be encoded and decoded. The electronic device may decode the audio source data based on a first sampling bit width to obtain first decoded data, where the first sampling bit width corresponds to a sampling bit width set by the audio codec, and optionally, the sampling bit width set by the audio codec may be an upper sampling bit width, which is capable of being compatible with most of the audio data, for example, the sampling bit width set by the audio codec may be 24 bits, 32 bits, and the like, but is not limited thereto.
In some embodiments, the data format of the Audio source data may include, but is not limited to, FLAC (Free Lossless Audio Codec), APE (obtained by Monkey's Audio compression), ALAC (Lossless Audio format developed by Apple inc.) format, MP3 (Moving Picture Experts Group Audio Layer III), realAudio format, and the like, but is not limited thereto.
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 bit number of each string of binary coded streams in the sound source data is the original sampling bit width. The electronic device may perform decoding processing on the audio source data based on the first sampling bit width to obtain first decoded data corresponding to the first sampling bit width, and decode the audio 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 can be decoded into first decoded data in the form of 24 bits.
The electronic device may perform up-sampling on the sound source data corresponding to the original sampling bit width according to a preset up-sampling manner, and perform decoding processing on the up-sampled sound source data to obtain first decoded data corresponding to the first sampling bit width. As a specific embodiment, the preset up-sampling manner may be to add a preset bit value to a lower bit of the sound source data in a binary form to obtain the sound source data corresponding to the first sampling bit width, and add an N-bit preset bit value at an end of the sound source data corresponding to the original sampling bit width, where N may be a difference between the first sampling bit width and the second sampling bit width. The preset bit value can be set according to actual requirements, and for example, can be 0 or 1, but is not limited thereto.
Fig. 3A is a schematic diagram illustrating up-sampling of audio source data according to an embodiment. As shown in fig. 3A, if the original sampling bit width corresponding to the sound source data is 16 bits, and the first sampling bit width is 24 bits, 8 bits of 0 may be added to the lower bits of the 16-bit sound source data to obtain 24-bit sound source data, and the electronic device may perform decoding processing on the 24-bit sound source data to obtain 24-bit first decoded data. It should be noted that, the audio source data corresponding to the original sampling bit width may also be decoded first, and then the data obtained through decoding is up-sampled to obtain the first decoded data.
In some embodiments, the electronic device may perform PCM decoding processing on the audio source data based on the first sample bit width to obtain first decoded data in a PCM format. Regardless of the original sampling bit width of the sound source data, the sound source data is decoded by using the first sampling bit width corresponding to the sampling bit width set by the audio codec without initializing the audio codec or changing the sampling bit width set by the audio codec, so that the problem of audible jamming caused by reinitialization of the audio codec can be avoided, and the playing quality of the audio is ensured.
And step 220, performing encoding processing on the first decoding data based on the second sampling bit width to obtain an audio encoding data packet.
The second sampling bit width may be smaller than the first sampling bit width, and optionally, the second sampling bit width may be greater than or equal to the original sampling bit width of the audio source data, so as to ensure the music quality when the audio source data is played, for example, the original sampling bit width of the audio source data is 8 bits, and the second sampling bit width may be 16 bits, 8 bits, and the like. The electronic device may encode the first decoded data based on the second sampling bit width to obtain audio encoded data corresponding to the second sampling bit width, encode the first decoded data in the first sampling bit width format according to the second sampling bit width to obtain audio encoded data corresponding to the second sampling bit width, and encapsulate the audio encoded data to obtain an audio encoded data packet.
The electronic device may perform downsampling on the first decoded data in the first sampling bit width format according to a preset downsampling mode, and perform encoding processing on the downsampled first decoded data to obtain audio encoded data corresponding to the second sampling bit width. The preset down-sampling mode and the preset up-sampling mode can be matched with each other correspondingly. As a specific embodiment, the preset up-sampling method may be to add a preset bit value to lower bits of the sound source data in a binary form to obtain the sound source data corresponding to the first sampling bit width, and the preset down-sampling method may be to clip a bit value arranged in the last N bits of the first decoded data corresponding to the first sampling bit width. The electronic equipment can cut the first decoding data in a binary form from low order to reserve a part of the first decoding data corresponding to the second sampling bit width, can cut the bit value of the last N bits in the first decoding data corresponding to the first sampling bit width, and encode the cut first decoding data 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. The N is a difference between the first sampling bit width and the second sampling bit width.
Illustratively, fig. 3B is a schematic diagram of downsampling first decoded data in one embodiment. As shown in fig. 3B, if the first sampling bit width corresponding to the first decoded data is 24 bits, and the second sampling bit width is 16 bits, the bit value arranged at the lower 8 bits in the first decoded data in the 24-bit format can be cut, the upper 16 bits in the first decoded data are reserved, so as to obtain 16-bit first decoded data, and the electronic device can perform encoding processing on the 16-bit first decoded data, so as to obtain audio encoded data corresponding to the 16-bit parameter. In other embodiments, other predetermined up-sampling methods and predetermined down-sampling methods may also be adopted, and the embodiments of the present application are not limited.
As a specific embodiment, the second sampling bit width corresponds to the original sampling bit width of the sound source data, so that under the condition of ensuring the music quality when the sound source data is played, the memory consumption and the processing time length in the audio encoding process can be reduced as much as possible, thereby reducing the audio playing delay and the equipment 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 coding process can be reduced by 1/3, and the coding processing time length and the corresponding power consumption can also be reduced by 1/3; and for example, the first sampling bit width is 24 bits, the original sampling bit width of the sound source data is 8 bits, and the second sampling bit width is 8 bits, the memory occupied in the audio coding process can be reduced by 2/3, and the coding processing time length and the corresponding power consumption can also be reduced by 2/3.
Alternatively, the encoding process performed on the first decoded data may include, but is not limited to, encoding processes such as SBC, AAC, and the like performed on the first decoded data.
In some embodiments, the electronic device, upon obtaining the audio encoded data packets, may transmit the audio encoded data packets to an audio output device via a wireless communication channel. In some embodiments, the wireless communication channel may comprise a bluetooth communication channel comprising a broadcast channel and/or a data channel.
The electronic device and the audio output device can establish a Bluetooth connection, and the Bluetooth connection may include a classic Bluetooth connection, a BLE (Bluetooth Low Energy) connection, and the like, where the classic Bluetooth connection is a Bluetooth communication connection established based on a classic Bluetooth protocol, the BLE connection is a Bluetooth communication connection established based on a BLE protocol, the classic Bluetooth protocol generally refers to a Bluetooth protocol below the Bluetooth protocol version 4.0, and the BLE protocol generally refers to a Bluetooth protocol above the Bluetooth protocol version 4.0. Further, the bluetooth connection may be an LE Audio bluetooth connection established based on a BLE connection, capable of supporting transmission of Audio data.
The electronic device can send the target audio data packet to the audio output device through the audio service transmission channel connected with the Bluetooth. If the bluetooth connection is a classic bluetooth connection, the Audio service transmission channel may be a transmission channel established based on an A2DP (Advanced Audio Distribution Profile, bluetooth Audio transmission model protocol) protocol or an HFP (handles-free Profile) protocol, and if the bluetooth connection is an LE Audio bluetooth connection, the Audio service transmission channel may be a transmission channel based on a connection synchronization data stream (CIS), but is not limited thereto. It should be noted that, in the embodiments of the present application, specific bluetooth connection modes and communication channels between the electronic device and the audio output device are not limited, and may be changed according to the development of the bluetooth standard protocol. The electronic equipment transmits the audio coding data packet with smaller sampling bit width to the audio output equipment, so that the transmission bandwidth occupied by the audio coding data packet can be reduced, and the waste of communication transmission resources is reduced.
After the audio output device acquires the audio coded data packet, the audio coded data packet can be decoded based on the second sampling bit width to obtain second decoded data, and the second decoded data is converted into analog data to output the analog data, so that audio playing is realized. In some embodiments, the audio output device may unpack the obtained audio encoding data packet to extract the audio encoding data corresponding to the second sampling bit width included in the audio encoding data packet. The audio output device may perform PCM decoding on the audio encoded data based on the second sample bit width to obtain second decoded data in the form of the second sample bit width, convert the second decoded data from a digital signal to an analog signal through the digital-to-analog converter to obtain first analog data, and perform power amplification on the first analog data through the power amplifier to obtain second analog data. The power amplifier can transmit the second analog data to the playing unit, and the audio output device outputs the second analog data through the playing unit so as to achieve the effect of playing audio.
Illustratively, fig. 4 is a flow chart illustrating an audio processing method according to an embodiment. As shown in fig. 4, the electronic device may perform PCM decoding on the sound source data based on a first sampling bit width (e.g., 24 bit) to obtain first decoded data, perform bluetooth audio coding on the first decoded data based on a second sampling bit width (e.g., 16 bit) to obtain audio coded data corresponding to the second sampling bit width (e.g., 16 bit), and encapsulate the audio coded data corresponding to the second sampling bit width (e.g., 16 bit) into an audio coded data packet. The electronic device may transmit the audio encoded data packets to an audio output device via a bluetooth wireless channel. After receiving the audio encoded data packet via the bluetooth wireless channel, the audio output device may unpack the audio encoded data packet to extract audio encoded data corresponding to the second sampling bit width (e.g., 16 bit), and perform PCM decoding on the audio encoded data based on the second sampling bit width (e.g., 16 bit) to obtain second decoded data. The audio output device can respectively perform digital-to-analog conversion and power amplification processing on the second decoded data through the DAC and the AMP to obtain analog data, and finally the analog data is output through the playing unit. Compared with the audio processing method shown in fig. 1A, the method can save memory consumption and processing time of the electronic device and the audio output device in the encoding and decoding processes, effectively reduce audio delay and power consumption, and reduce the bandwidth occupied by audio encoded data packet transmission.
In the embodiment of the application, the electronic device performs encoding processing on the first decoded data through the second sampling bit width corresponding to the original sampling bit width of the sound source data, where the original sampling bit width is smaller than the sampling bit width set by the audio codec, so that memory consumption and processing time in an encoding process can be reduced, and audio playing delay and device power consumption are reduced. The audio output equipment decodes the audio coding data packet through the second sampling bit width corresponding to the original sampling bit width of the audio source data, and can reduce the memory consumption and processing time length in the decoding process, thereby reducing the audio playing delay and the equipment power consumption. In addition, in the embodiment of the application, the audio codec is not initialized, the sampling bit width set by the audio codec is not changed, the problem of audible jamming caused by reinitializing the audio codec can be avoided, and the playing quality of the audio is ensured.
In some embodiments, the electronic device performs encoding processing on the first decoded data based on the second sampling bit width to obtain audio encoded data corresponding to the second sampling bit width, and may encapsulate the audio encoded data according to a preset data packet format to obtain an audio encoded data packet. Several packet formats for audio encoded packets are described below:
(1) The audio coding data packet comprises a packet header part and a data part, wherein the packet header part comprises a first bit width field and a second bit width field.
The first bit width field characterizes a sampling bit width set by the audio codec, and may be used to indicate the first sampling bit width described above.
The second bit width field represents the sampling bit width actually adopted by the audio coding data packet in the coding process, and the second bit width field is used for indicating the second sampling bit width.
The data section is used for storing audio coding data corresponding to the second sampling bit width.
As an embodiment, the first bit width field may be stored in a first data segment of a packet header of the audio encoded data packet, the second bit width field may be stored in a second data segment of the packet header of the audio encoded data packet, and optionally, the first data segment may precede the second data segment. In some embodiments, the second bit-width field may be stored in a reserved field of the packet header, where the reserved field is defined for a specific purpose in the packet header, and a part of the reserved field may be used to store the second bit-width field, so that a large adjustment to the overall structure of the packet header is not required, and the packing manner is simpler and faster.
In some embodiments of the present application, the first bit width field indicates 24-bit samples set by the audio codec (i.e., the first sampling bit width is 24 bits), the second bit width field indicates 16-bit samples used by the audio source data (i.e., the second sampling bit width is 16 bits), but both the first bit width field and the second bit width field occupy only 2 bits, which identifies 4 cases, for example, binary 00 identifies 8-bit samples, 01 identifies 16-bit samples, 10 identifies 24-bit samples, and binary 11 identifies 32-bit samples. Thus, the information of the first sampling bit width and the second sampling bit width can be represented by 4 bits in total. In view of the technical development, the first-bit-width field and the second-bit-width field may each occupy 3 bits, thereby identifying 8 cases, respectively.
In some embodiments of the present application, the header of an audio encoded data packet occupies 64 bits in total. The first bit width field, the second bit width field and the possibly set judgment field are stored by using a reserved field in the packet header. Under the condition that part of reserved fields of the packet header are occupied, the first bit width field and the second bit width field can be stored by using the unoccupied reserved fields as much as possible, and the parts which cannot be stored are stored into newly-set bits or bytes after 64 bits of the packet header. It should be understood that the 64-bit packet header is for illustration only, and does not limit the size or structure of the packet header.
In some embodiments of the present application, the first sampling bit width is different from a sampling bit width set by an audio codec, and the second sampling bit width is different from an original sampling bit width of the audio source data; instead, the first sampling bit width and the sampling bit width set by the audio codec form a first proportional relationship, and the second sampling bit width and the original sampling bit width of the sound source data form the same first proportional relationship. Or, the first sampling bit width and the sampling bit width set by the audio codec are in a first difference relationship, and the second sampling bit width and the original sampling bit width of the audio source data are also in a first difference relationship.
The data portion may be stored in a third data segment of the audio encoded data packet. Alternatively, the packet header may precede the third data segment of the audio encoded data packet.
Illustratively, fig. 5A is a schematic structural diagram of an audio encoding data packet in an embodiment. As shown in fig. 5A, an audio encoded data packet may include a packet header and a data portion, the packet header may include first packet header information and a second bit-wide field, and the first packet header information may be stored in a first data segment of the packet header. The first header information may include a first bit width field, and the second bit width field may be located between the first 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 an end portion of the header portion. For example, if the first sampling bit width is 24 bits and the second sampling bit width is 16 bits, the first bit width field in the header is used to indicate 24 bits, the second bit width field is used to indicate 16 bits, and the data portion may include audio encoded data corresponding to a 16-bit parameter.
After the audio output device acquires the audio coded data packet, the audio output device may unpack the audio coded data packet to extract a packet header portion and a data portion in the audio coded data packet, and the audio output device may decode the audio coded data stored in the data portion based on a second sampling bit width indicated by the second bit width field to obtain second decoded data.
In some embodiments, the packet header of the audio encoding 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.
The length parameter stored in the first length field is a data length of the packet header, optionally, the packet header includes first packet header information and a second bit width field, and the length parameter stored in the first length field may be a 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 by the first length field, and the length parameter stored in the first length field may be the number of bits occupied by the first header information and the number of bits occupied by the second bit width field, for example, as shown in fig. 5A, if the number of bits occupied by the first header information in the packet header is M, and the number of bits occupied by the second bit width field is 8, the length parameter stored in the first length field may be M +8.
As an embodiment, when the audio output device unpacks the audio coded data packet, the audio output device may first extract a packet header from the audio coded data packet to obtain each field included in the packet header, such as the first bit-wide field, the second bit-wide field, the first length field, and the like. Alternatively, the first header information in the header portion of the audio packet may be extracted from the first data segment in the header portion of the audio packet, and then the second bit width field may be extracted from the second data segment in the header portion of the audio packet and the data portion in the audio encoded data packet may be extracted from the third data segment in the audio encoded data packet according to the length parameter stored in the first length field in the first header information. Because the length parameter stored in the first length field is the sum of the data lengths of the first packet header information and the second bit width field in the packet header, the audio output device can accurately extract the second bit width field from the audio coded data packet by using the length parameter stored in the first length field, so that the subsequent decoding processing can be accurately performed based on the second sampling bit width stored in the second bit width field, and the processing efficiency and the processing accuracy are improved.
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 bit number occupied by the data part. As an implementation manner, the audio output device may extract the data portion in the audio encoded data packet from the third data segment of the audio encoded data packet according to the length parameter stored in the second length field in the packet header of the audio encoded data packet, and may ensure that the audio output device accurately acquires the audio encoded data corresponding to the second sampling bit width.
In the embodiment of the present application, the audio output device can accurately identify, according to the first length field and/or the second length field in the header portion of the audio encoded data packet, that the audio encoded data packet is an audio encoded data packet obtained by encoding according to the second sampling bit width, and accurately perform unpacking, so that the audio encoded data packet in the embodiment of the present application can be effectively distinguished from the audio encoded data packet in the related art (the whole audio transmission and encoding/decoding process is processed and transmitted according to the sampling bit width set by the audio codec), thereby ensuring accurate performance of subsequent audio processing and playing.
Optionally, the first header information of the header of the audio encoding data packet may further include other fields, such as one or more of a provider identifier of the sound source data, an encoder identifier of the sound source data, a version identifier of the sound source data, a sampling rate, a channel number, and the like, but is not limited thereto. The provider identifier may be used to identify a provider of the audio data, the encoder identifier may be used to identify an encoding format of the sound source data, and the sound source data in different encoding formats may correspond to different encoder identifiers, respectively.
In this embodiment of the application, the audio encoding data packet may include a header portion and a data portion, the header portion may include a first bit width field and a second bit width field, and it may be ensured that, after the audio output device is unpacked, the audio encoding data is decoded according to a second sampling bit width indicated by the second bit width field, memory consumption of the audio output device may be reduced, and processing duration may be reduced, thereby reducing audio playback delay and device power consumption, and because the first sampling bit width indicated by the first bit width field is unchanged, the audio output device may not initialize the audio codec, and may avoid a problem of audible jamming caused by reinitialization of the audio codec.
(2) The audio coding data packet comprises a packet header part and a data part, wherein the packet header part comprises a first bit width field, a judgment field and a second bit width field.
The header portion of the audio encoded data packet may further include a judgment field, in addition to the fields such as the first bit width field and the second bit width field introduced in the data packet format (1), where the judgment field may be used to characterize whether the first bit width field and the second bit width field in the header portion are consistent, and further, the judgment field may be used to characterize a sampling bit width (corresponding to the first sampling bit width) set by the audio codec, and is consistent with a sampling bit width (i.e., the second sampling bit width) adopted in an encoding process performed by the electronic device.
Optionally, the determination field may represent whether the first bit width field and the second bit width field in the packet header are consistent with each other by using different determination identifiers. If the first judgment identification is stored in the judgment field, the first bit width field in the representation packet head is consistent with the second bit width field, and if the second judgment identification is stored in the judgment field, the first bit width field in the representation packet head is inconsistent with the second bit width field. The first determination flag and the second determination flag may be set according to actual requirements, for example, the first determination flag may be 0, the second determination flag may be 1, and the like, but is not limited thereto.
As an embodiment, the determination field may be stored in a 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 configured in advance, 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, and the like, which is not limited herein. Further, the decision field may be stored in a reserved field of the packet header.
Illustratively, fig. 5B is a schematic structural diagram of an audio encoding data packet in another embodiment. As shown in fig. 5B, the audio coding data packet may include a packet header portion and a data portion, the packet header portion 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 a first data segment of the packet header portion. The first header information may include a first bit width field, the determining field may be located between the first 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, 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 determination field may be 1 (indicating that the first bit width field and the second bit width field are inconsistent).
Fig. 5C is a schematic structural diagram of an audio encoded data packet in another embodiment. As shown in fig. 5C, 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.
In one embodiment, the length parameter stored in the first length field in the header of the audio coded data packet may be a sum of the first header information, the judgment field, and a data length of the actual sampling bit width. As an embodiment, when the audio output device unpacks the audio coded data packet, the audio output device may first extract first header information of a header portion from the audio coded data packet, and then extract a second bit width field and a determination field from a second data segment and a fourth data segment of the header portion respectively according to a length parameter stored in a first length field of the first header information. The audio output device can determine whether the first bit width field is consistent with the second bit width field according to the judgment field, so that the accuracy of subsequent audio processing is improved.
In this embodiment of the present application, the header portion of the audio encoding data packet may further include a judgment field, and the audio output device may determine whether the first bit width field and the second bit width field are consistent according to the judgment field, so as to improve the accuracy of subsequent audio processing.
It should be noted that the packet format of the target audio data packet is not limited to the above several packet formats, the audio coded data packet may also include other field information, for example, a check code, etc., the position of each field in the audio coded data packet is also not limited to the several manners described in the above embodiments, and the packet format of the audio coded data packet may be adjusted based on actual requirements.
In the embodiment of the application, after the electronic device performs encoding processing through the second sampling bit width corresponding to the original sampling bit width of the sound source data, the electronic device can package the audio encoding data into the audio encoding data packet according to the preset data packet format, so that the audio output device can be ensured to accurately perform unpacking and audio processing on the audio encoding data packet, and the audio processing performance of the audio output device is improved.
In one embodiment, a chip configured to perform the steps of the audio processing method applied to the electronic device as described in the above embodiments is provided.
The chip may include a processor and a communication module, the processor may be configured to: the method comprises the steps of performing decoding processing on sound source data based on a first sampling bit width to obtain first decoded data, and performing encoding processing on the first decoded data based on a second sampling bit width to obtain an audio encoded data packet, wherein the communication module is configured to: a step of transmitting the audio encoded data packets to an audio output device via a wireless communication channel is performed. The chip can be arranged in electronic equipment, such as a mobile phone, wearable equipment, a vehicle-mounted terminal, a tablet computer and the like.
As shown in fig. 6, in one embodiment, another audio processing method is provided, which can be applied to the audio output device described above, and the method can include the following steps:
at step 610, audio encoded data packets are obtained.
In one embodiment, step 610 includes: acquiring an audio encoded data packet via a wireless communication channel; the wireless communication channel comprises a bluetooth communication channel, which comprises a broadcast channel and/or a data channel.
And step 620, decoding the audio coded data packet based on the second sampling bit width to obtain second decoded data. The second sampling bit width corresponds to an original sampling bit width of the audio source data.
In one embodiment, the second sampling bit width is less than a first sampling bit width, the first sampling bit width corresponding to a sampling bit width set by the audio codec.
In one embodiment, the original sampling bit width is less than the sampling bit width set by the audio codec.
In one embodiment, the step of decoding the audio coded data packet based on the second sample bit width includes: unpacking the audio coding data packet to extract a packet header part and a data part in the audio coding data packet; the packet header part comprises a first bit width field and a second bit width field of the audio codec, wherein the first bit width field is used for indicating a first sampling bit width, and the second bit width field is used for indicating a second sampling bit width; and decoding the audio coded data stored in the data part based on the second sampling bit width indicated in the second bit width field.
In one embodiment, the packet header of the audio coding data packet further includes a determination field for indicating whether the first bit width field and the second bit width field are consistent.
Step 630, convert the second decoded data into analog data.
It should be noted that, for specific descriptions of the audio processing method applied to the audio output device provided in the embodiments of the present application, reference may be made to the descriptions of the audio processing method applied to the electronic device provided in the foregoing embodiments, and repeated descriptions are not repeated here.
In the embodiment of the application, the audio output device decodes the audio coded data packet through the second sampling bit width corresponding to the original sampling bit width of the audio source data, and the original sampling bit width of the audio source data is smaller than the sampling bit width set by the audio codec, so that the memory consumption and the processing time length in the decoding process can be reduced, and the audio playing delay and the device power consumption are reduced. In addition, the audio codec is not initialized in the embodiment of the application, the sampling bit width set by the audio codec is not changed, the problem of audible jamming caused by reinitializing the audio codec can be avoided, and the playing quality of the audio is ensured.
In one embodiment, a chip is provided that is configured to perform the steps of the audio processing method applied to an audio output device as described in the above embodiments.
The chip may include a processor and a communication module, the communication module may be configured to: performing the step of obtaining audio encoded data packets via a wireless communication channel, the processor may be configured to: and decoding the audio coded data packet based on the second sampling bit width to obtain second decoded data and the like. The chip can be arranged in audio output equipment, such as earphones, sound boxes, vehicle-mounted players and the like.
As shown in fig. 7, in an embodiment, an audio processing apparatus 700 is provided, which can be applied to the electronic device described above, and the audio processing apparatus 700 can include a decoding module 710 and an encoding module 720.
The decoding module 710 is configured to perform decoding processing on the sound source data based on the first sampling bit width to obtain first decoded data.
And the encoding module 720 is configured to perform encoding processing on the first decoded data based on the second sampling bit width to obtain an audio encoded data packet. The first sampling bit width corresponds to a sampling bit width set by the audio codec, and the second sampling bit width corresponds to an original sampling bit width of the audio source data.
In one embodiment, the second sampling bit width is less than the first sampling bit width.
In one embodiment, the original sampling bit width of the audio source data is less than the sampling bit width set by the audio codec.
In one embodiment, the encoding module 720 is further configured to crop the first decoded data in binary form from lower bits to reserve a portion of the first decoded data corresponding to the second sampling bit width.
In one embodiment, the audio processing device 700 further comprises a transmitting module.
And the sending module is used for sending the audio coding data packet to the audio output equipment through a wireless communication channel. The wireless communication channel comprises a bluetooth communication channel, including a broadcast channel and/or a data channel.
In the embodiment of the application, the electronic device performs encoding processing on 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, so that memory consumption and processing time in the encoding process can be reduced, and audio playing delay and device power consumption are reduced. In addition, the audio codec is not initialized in the embodiment of the application, the sampling bit width set by the audio codec is not changed, the problem of audible jamming caused by reinitializing the audio codec can be avoided, and the playing quality of the audio is ensured.
In one embodiment, an audio encoding data packet comprises a packet header and a data portion, wherein the packet header comprises a first bit width field and a second bit width field; the first bit width field is used for indicating a first sampling bit width, and the second bit width field is used for indicating a second sampling bit width; the data section is used for storing audio coded data.
In one embodiment, 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, the first data segment preceding the second data segment.
In one embodiment, the header of the audio encoded data packet further comprises a determination field for indicating whether the first bit width field and the second bit width field are consistent.
In the embodiment of the application, after the electronic device performs encoding processing through the second sampling bit width corresponding to the original sampling bit width of the sound source data, the electronic device can package the audio encoding data into the audio encoding data packet according to the preset data packet format, so that the audio output device can be ensured to accurately perform unpacking and audio processing on the audio encoding data packet, and the audio processing performance of the audio output device is improved.
As shown in fig. 8, in an embodiment, an audio processing apparatus 800 is provided, which can be applied to the audio output device, and the audio processing apparatus 800 can include an obtaining module 810, a decoding module 820, and a converting module 830.
An obtaining module 810 is configured to obtain the audio coded data packet.
In one embodiment, the obtaining module 810 is further configured to obtain the audio encoded data packet via a wireless communication channel; the wireless communication channel comprises a bluetooth communication channel, including a broadcast channel and/or a data channel.
The decoding module 820 is configured to decode the audio coded data packet based on the second sampling bit width to obtain second decoded data; the second sample bit width corresponds to the original sample bit width of the audio source data.
In one embodiment, the second sampling bit width is less than a first sampling bit width, the first sampling bit width corresponding to a sampling bit width set by the audio codec.
In one embodiment, the original sampling bit width is less than the sampling bit width set by the audio codec.
In one embodiment, the decoding module 820 includes an unpacking unit and a decoding unit.
The unpacking unit is used for unpacking the audio coding data packet so as to extract a packet header part and a data part in the audio coding data packet; the packet header portion comprises a first bit width field and a second bit width field, wherein the first bit width field is used for indicating a first sampling bit width, and the second bit width field is used for indicating a second sampling bit width.
And the decoding unit is used for decoding the audio coded data stored in the data part based on the second sampling bit width indicated by the second bit width field.
In one embodiment, the header of the audio encoded data packet further comprises a determination field for indicating whether the first bit width field and the second bit width field are consistent.
A converting module 830, configured to convert the second decoded data into analog data.
In the embodiment of the application, the audio output device decodes the audio coded data packet through the second sampling bit width corresponding to the original sampling bit width of the audio source data, and the original sampling bit width of the audio source data is smaller than the sampling bit width set by the audio codec, so that the memory consumption and the processing time length in the decoding process can be reduced, and the audio playing delay and the device power consumption are reduced. In addition, in the embodiment of the application, the audio codec is not initialized, the sampling bit width set by the audio codec is not changed, the problem of audible jamming caused by reinitializing the audio codec can be avoided, and the playing quality of the audio is ensured.
Fig. 9 is a block diagram of an electronic device in one embodiment. As shown in fig. 9, electronic device 900 may include one or more of the following components: a processor 910, a memory 920 coupled with 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 embodiments above when executed by the one or more processors 910.
Processor 910 may include one or more processing cores. The processor 910 interfaces with various components throughout the electronic device 900 using various interfaces and lines to perform various functions of the electronic device 900 and process data by executing or performing instructions, programs, code sets, or instruction sets stored in the memory 920 and invoking data stored in the memory 920. Alternatively, the processor 910 may be implemented in hardware using at least one of Digital Signal Processing (DSP), field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 910 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 910, but may be implemented by a communication chip.
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, code sets, or instruction sets. The memory 920 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like. The stored data area may also store data created during use of the electronic device 900, and the like.
The electronic device 900 may further include a bluetooth module, which may be configured 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 Audio, etc.), but is not limited thereto and may vary with the development of the bluetooth protocol.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program, and when the computer program is executed by the processor, the processor is enabled to implement the audio processing method applied to the audio output device as described in the foregoing embodiments.
The embodiment of the application discloses a computer readable storage medium, which stores a computer program, wherein the computer program realizes the audio processing method applied to the electronic equipment as described in the above embodiments when being executed by a processor.
The embodiment of the application discloses a computer readable storage medium which stores a computer program, wherein the computer program realizes the audio processing method applied to the audio output device as described in the above embodiments when being executed by a processor.
Embodiments of the present application disclose a computer program product comprising a non-transitory computer-readable storage medium storing a computer program, and the computer program is executable by a processor to implement an audio processing method applied to an electronic device as described in the above embodiments.
Embodiments of the present application disclose a computer program product comprising a non-transitory computer readable storage medium storing a computer program, and the computer program is executable by a processor to implement an audio processing method applied to an audio output device as described in the above embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. The storage medium may be a magnetic disk, an optical disk, a ROM, etc.
Any reference to memory, storage, database, or other medium as used herein may include non-volatile and/or volatile memory. Suitable non-volatile memory can include ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM can take many forms, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), rambus Direct RAM (RDRAM), and Direct Rambus DRAM (DRDRAM).
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also appreciate that the embodiments described in this specification are all alternative embodiments and that the acts and modules involved are not necessarily required for this application. In this application, the term "plurality" includes "two or more".
In various embodiments of the present application, it should be understood that the size of the serial number of each process described above does not mean that the execution sequence is necessarily sequential, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The foregoing describes in detail an audio processing method, apparatus, chip, electronic device, and storage medium disclosed in the embodiments of the present application, and specific examples are applied herein to explain the principles and implementations of the present application, and the descriptions of the foregoing embodiments are only used to help understand the method and core ideas of the present application. Meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (20)

1. An audio processing method applied to an electronic device, the method comprising:
decoding the sound source data based on the first sampling bit width to obtain first decoded data;
coding the first decoding data based on a second sampling bit width to obtain an audio coding data packet;
wherein the first sampling bit width corresponds to a sampling bit width set by an audio codec, and the second sampling bit width corresponds to an original sampling bit width of the audio source data.
2. The method of claim 1, wherein the second sampling bit width is less than the first sampling bit width.
3. The method of claim 1, wherein the original sample bit width is less than a sample bit width set by the audio codec.
4. The method of claim 1, wherein the audio encoded data packet comprises a packet header portion and a data portion, wherein the packet header portion comprises a first bit wide field and a second bit wide field;
the first bit width field is used for indicating the first sampling bit width, and the second bit width field is used for indicating the second sampling bit width; the data section is used for storing audio coding data.
5. The method of claim 4, wherein the packet header further comprises a determination field, and wherein the determination field is used to characterize whether the first bit-width field and the second bit-width field are consistent.
6. The method of claim 4 or 5, wherein the first bit width field is stored in a first data segment of the packet header, wherein the second bit width field is stored in a second data segment of the packet header, and wherein the first data segment precedes the second data segment.
7. The method of claim 6, wherein the second bit width field is stored in a reserved field of the packet header.
8. The method according to claim 1, wherein said encoding said first decoded data based on a second sampling bit width comprises:
clipping the first decoded data in binary form from lower bits to preserve portions of the first decoded data corresponding to the second sampling bit width.
9. The method of any one of claims 1 to 5 and 7 to 8, further comprising:
transmitting the audio encoded data packets to an audio output device via a wireless communication channel;
the wireless communication channel comprises a bluetooth communication channel, which comprises a broadcast channel and/or a data channel.
10. A chip comprising 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;
coding the first decoding data based on a second sampling bit width to obtain an audio coding data packet; wherein the first sampling bit width corresponds to a sampling bit width set by an audio codec, and the second sampling bit width corresponds to an original sampling bit width of the audio source data;
the communication unit is configured to:
transmitting the audio encoded data packets to an audio output device via a wireless communication channel.
11. An audio processing method applied to an audio output device, the method comprising:
acquiring an audio coding data packet;
decoding the audio coded data packet based on a second sampling bit width to obtain second decoding data; the second sampling bit width corresponds to an original sampling bit width of the audio source data;
converting the second decoded data into analog data.
12. The method of claim 11, wherein the second sampling bit width is less than a first sampling bit width, and wherein the first sampling bit width corresponds to a sampling bit width set by an audio codec.
13. The method of claim 11, wherein the original sample bit width is less than a sample bit width set by an audio codec.
14. The method of claim 11, wherein the decoding the audio coded data packet based on the second sample bit width comprises:
unpacking the audio coding data packet to extract a packet header part and a data part in the audio coding data packet; the header portion comprises a first bit width field and a second bit width field, the first bit width field is used for indicating the first sampling bit width, and the second bit width field is used for indicating the second sampling bit width;
and decoding the audio coded data stored in the data part based on the second sampling bit width indicated by the second bit width field.
15. The method according to any one of claims 11 to 14, wherein said obtaining an audio encoded packet comprises:
obtaining an audio encoded data packet via a wireless communication channel;
the wireless communication channel comprises a bluetooth communication channel, which comprises a broadcast channel and/or a data channel.
16. A chip is characterized by comprising a processor and a communication unit;
the communication unit configured to:
obtaining an audio encoded data packet via a wireless communication channel;
the processor is configured to:
decoding the audio coded 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 audio source data.
17. An audio processing apparatus, applied to an electronic device, the apparatus comprising:
the decoding module is used for decoding the sound source data based on the first sampling bit width to obtain first decoding data;
the encoding module is used for encoding the first decoding data 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, and the second sampling bit width corresponds to an original sampling bit width of the audio source data.
18. An audio processing apparatus, applied to an audio output device, the apparatus comprising:
the acquisition module is used for acquiring the audio coding data packet;
the decoding module is used for decoding the audio coded data packet based on a second sampling bit width to obtain second decoding data; the second sampling bit width corresponds to an original sampling bit width of the audio source data;
and the conversion module is used for converting the second decoding data into analog data.
19. An electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, and wherein the computer program, when executed by the processor, causes the processor to carry out the method according to any one of claims 1 to 9 or 11 to 15.
20. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 9 or 11 to 15.
CN202210773940.9A 2022-07-01 2022-07-01 Audio processing method, device, chip, electronic equipment and storage medium Pending CN115206352A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210773940.9A CN115206352A (en) 2022-07-01 2022-07-01 Audio processing method, device, chip, electronic equipment and storage medium
PCT/CN2023/087246 WO2024001405A1 (en) 2022-07-01 2023-04-10 Audio processing method and apparatus, and chip, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210773940.9A CN115206352A (en) 2022-07-01 2022-07-01 Audio processing method, device, chip, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115206352A true CN115206352A (en) 2022-10-18

Family

ID=83578457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210773940.9A Pending CN115206352A (en) 2022-07-01 2022-07-01 Audio processing method, device, chip, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN115206352A (en)
WO (1) WO2024001405A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024001405A1 (en) * 2022-07-01 2024-01-04 哲库科技(上海)有限公司 Audio processing method and apparatus, and chip, electronic device and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6208276B1 (en) * 1998-12-30 2001-03-27 At&T Corporation Method and apparatus for sample rate pre- and post-processing to achieve maximal coding gain for transform-based audio encoding and decoding
CN201707924U (en) * 2010-04-12 2011-01-12 佛山市智邦电子科技有限公司 Lossless audio frequency player
CN110335615B (en) * 2019-05-05 2021-11-16 北京字节跳动网络技术有限公司 Audio data processing method and device, electronic equipment and storage medium
CN111402908A (en) * 2020-03-30 2020-07-10 Oppo广东移动通信有限公司 Voice processing method, device, electronic equipment and storage medium
CN115206352A (en) * 2022-07-01 2022-10-18 哲库科技(上海)有限公司 Audio processing method, device, chip, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024001405A1 (en) * 2022-07-01 2024-01-04 哲库科技(上海)有限公司 Audio processing method and apparatus, and chip, electronic device and storage medium

Also Published As

Publication number Publication date
WO2024001405A1 (en) 2024-01-04

Similar Documents

Publication Publication Date Title
US11109138B2 (en) Data transmission method and system, and bluetooth headphone
JP4724452B2 (en) Digital media general-purpose basic stream
CN108847248B (en) Bluetooth device audio processing method, system, readable storage medium and Bluetooth device
CN113689864B (en) Audio data processing method and device and storage medium
CN115273869A (en) Audio data transmission method, device, chip, electronic equipment and storage medium
BR112020016948A2 (en) METHODS AND DEVICES FOR GENERATING OR DECODING A BIT FLOW UNDERSTANDING IMMERSIVE AUDIO SIGNS
JP2012135008A (en) Embedded data signaling
CN115206352A (en) Audio processing method, device, chip, electronic equipment and storage medium
CN111681663A (en) Method, system, storage medium and device for reducing audio coding computation amount
CN111681664A (en) Method, system, storage medium and equipment for reducing audio coding rate
CN109102816B (en) Encoding control method and device and electronic equipment
WO2024001398A1 (en) Audio data transmission method and apparatus, and chip, electronic device and storage medium
CN100407834C (en) Apparatus for digital data transmission in state of using mobile telecommunication device and the method thereof
CN115223577A (en) Audio processing method, chip, device, equipment and computer readable storage medium
CN1625185A (en) Apparatus and method for reproducing three dimensional stereo sound for communication terminal
CN109461451B (en) Voice transmission method, device and system based on OPUS
CN109286922B (en) Bluetooth prompt tone processing method, system, readable storage medium and Bluetooth device
US12027174B2 (en) Apparatus, methods, and computer programs for encoding spatial metadata
CN109150400B (en) Data transmission method and device, electronic equipment and computer readable medium
CN113838470B (en) Audio processing method, device, electronic equipment, computer readable medium and product
CN111385780A (en) Bluetooth audio signal transmission method and device
CN116110411A (en) Audio transmission method, chip, user terminal and audio playing device
JP2001211251A (en) Wireless digital phone including voice recorder
CN118351861A (en) Communication method and system, audio equipment and chip
CN118351860A (en) Communication method and system, audio equipment and chip

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination