Audio code conversion method, system and device and storage medium
By uniformly decoding and format conversion of audio data packets, the problem of inconsistent encoding methods in segmented transmission is solved, and the integrity and compatibility of audio data is improved.
Patent Information
- Application Number
- CN202411950500.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-05-13
AI Technical Summary
In the segmented transmission of audio files, the lack of a unified methodology leads to different encoding methods for different segments, which makes it difficult to process uniformly during the transcoding process, resulting in incomplete audio data or inconsistent format, unable to adapt to multiple online playback platforms, and low compatibility.
By obtaining the audio data packet to be decoded, decoded in the same encoding method, fill it into an unsigned integer array, and convert it into a 32-bit floating point format through a preset format conversion strategy, unify the output format, and generate an audio stream.
The conversion of audio from original code to playable code is realized, avoiding the problem of inconsistent encoding methods of different segments, and improving the audio completeness and compatibility after transcoding.
Smart Images

Figure CN119993173A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio processing technology, and in particular to a method, system, device and storage medium for audio code conversion. Background Art
[0002] At present, segmented transmission is often used for the transmission of audio files with large amounts of data. In segmented transmission, due to the lack of a unified methodology to guide the encoding of segmented audio, different encoding methods are used for different segments. In the subsequent transcoding process, due to the inconsistency of the original encoding of each segment, the transcoding algorithm is difficult to process uniformly, resulting in incomplete or non-uniform formats of the transcoded audio data, which cannot be adapted to the playback of multiple online playback platforms and has low compatibility after transcoding.
[0003] Especially in the Web environment, the native API of the Web browser usually has certain requirements for the format, sampling rate, bit rate and other parameters of the audio file. When the transcoded audio data does not meet these requirements, the browser cannot correctly parse and play the audio, resulting in playback failure, freezes, reduced sound quality and other problems. In particular, large audio files often contain more encoding information and complex audio structures, which are more likely to cause problems during the transcoding process. Therefore, in order to ensure that audio files can be parsed and played smoothly in the Web environment, the compatibility requirements for the format of transcoded audio data are becoming more stringent and important. Summary of the invention
[0004] In order to solve the above technical problems, the present application provides a method, system, device and storage medium for audio code conversion, which are used to unify the output format of audio after transcoding and improve the compatibility of audio after transcoding.
[0005] The technical solution provided in this application is described below:
[0006] The first aspect of the present application provides a method for audio code conversion, comprising:
[0007] Acquire an audio data packet to be decoded, wherein the audio data packet is obtained by encoding the original audio data in the same encoding manner;
[0008] Decoding the audio data packet according to a decoding rule corresponding to the encoding method to obtain decoded data;
[0009] Fill the decoded data into a first array in the format of unsigned integers;
[0010] The data format of the first array filled with the decoded data is converted into a 32-bit floating point format through a preset format conversion strategy to obtain a target array, and the target array is used to generate an audio stream.
[0011] Optionally, the unsigned integer is an 8-bit unsigned integer, and the converting the data format of the first array filled with the decoded data into a 32-bit floating point format by using a preset format conversion strategy includes:
[0012] Convert the data format of the first array filled with the decoded data into a 16-bit signed integer format to obtain a second array;
[0013] The data format of the second array is converted into a 32-bit floating point format.
[0014] Optionally, converting the data format of the first array filled with the decoded data into a 16-bit signed integer format to obtain a second array includes:
[0015] Construct a DataView instance based on the buffer of the first array, and fill the decoded data into the DataView instance;
[0016] The buffer attributes in the DataView instance are converted into a data format of a 16-bit signed integer to obtain the second array.
[0017] Optionally, converting the data format of the second array into a 32-bit floating point format includes:
[0018] A 32-bit floating-point array is created, and each decoded data in the second array is converted into a floating-point number and stored in the 32-bit floating-point array.
[0019] Optionally, the method further includes:
[0020] Creating a target audio data array according to an audio sampling rate, and filling the decoded data in the 32-bit floating point array into the target audio data array, wherein the audio sampling rate is determined by the audio data packet;
[0021] Initialize the audio object of the browser and set the audio parameters of the audio object;
[0022] The audio data in the target audio data array is written into the buffer of the audio object, so that the browser plays the audio according to the buffer of the audio object.
[0023] Optionally, after obtaining the target array, the method further includes:
[0024] The data in the target array is subjected to noise elimination and equalization processing.
[0025] Optionally, obtaining the audio data packet to be decoded includes:
[0026] A plurality of audio data segments transmitted in segments are received, and the plurality of audio data segments are combined in sequence to form the audio data packet.
[0027] A second aspect of the present application provides a system for audio code conversion, including:
[0028] An acquisition unit, used for acquiring an audio data packet to be decoded, wherein the audio data packet is obtained by encoding the original audio data in the same encoding manner;
[0029] A decoding unit, used for decoding the audio data packet according to a decoding rule corresponding to the encoding method to obtain decoded data;
[0030] A filling unit, used for filling the decoded data into a first array in the format of unsigned integers;
[0031] The conversion unit is used to convert the data format of the first array filled with decoded data into a 32-bit floating point format through a preset format conversion strategy to obtain a target array, wherein the target array is used to generate an audio stream.
[0032] Optionally, the conversion unit includes:
[0033] A first conversion module, used for converting the data format of the first array filled with decoded data into a 16-bit signed integer format to obtain a second array;
[0034] The second conversion module is used to convert the data format of the second array into a 32-bit floating point format.
[0035] Optionally, the first conversion module includes:
[0036] A filling submodule, used for constructing a DataView instance based on the buffer of the first array, and filling the decoded data into the DataView instance;
[0037] The conversion submodule is used to convert the buffer attributes in the DataView instance into a data format of a 16-bit signed integer to obtain the second array.
[0038] Optionally, the second conversion module includes:
[0039] The storage submodule is used to create a 32-bit floating-point array, convert each decoded data in the second array into a floating-point number and store it in the 32-bit floating-point array.
[0040] Optionally, the system further includes:
[0041] A creating unit, configured to create a target audio data array according to an audio sampling rate, and fill the decoded data in the 32-bit floating point array into the target audio data array, wherein the audio sampling rate is determined by the audio data packet;
[0042] A setting unit, used to initialize the audio object of the browser and set the audio parameters of the audio object;
[0043] A writing unit is used to write the audio data in the target audio data array into the buffer of the audio object, so that the browser plays the audio according to the buffer of the audio object.
[0044] Optionally, the system further includes:
[0045] The processing unit is used to perform noise elimination and equalization processing on the data in the target array.
[0046] Optionally, the acquiring unit includes:
[0047] The combining module is used to receive a plurality of audio data segments transmitted in segments, and combine the plurality of audio data segments in sequence to form the audio data packet.
[0048] A third aspect of the present application provides an audio code conversion device, including:
[0049] Processor, memory, input-output unit, and bus;
[0050] The processor is connected to the memory, the input and output unit, and the bus;
[0051] The memory stores a program, and the processor calls the program to execute the first aspect and any optional method in the first aspect.
[0052] A fourth aspect of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the program executes the first aspect and any optional method in the first aspect.
[0053] It can be seen from the above technical solutions that this application has the following advantages:
[0054] The present application obtains an audio data packet to be decoded, which is obtained by encoding the original audio data in the same encoding method, and then decodes the audio data packet using a decoding rule corresponding to the encoding method to obtain decoded data, and then fills the decoded data into a first array of unsigned integers. Finally, through a preset format conversion strategy, the data format of the first array filled with the decoded data is converted into a 32-bit floating point format to obtain a target array, which is used to generate an audio stream, thereby realizing the conversion of audio from original code to playable code, avoiding the situation where different segments use different encoding methods, and improving the integrity of the transcoded audio; unifying the output format of the audio after transcoding, and improving the compatibility of the audio after transcoding. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solution in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0056] Figure 1 A flowchart of a method for audio code conversion in the present application;
[0057] Figure 2 Another flowchart of a method for audio code conversion according to the present application;
[0058] Figure 3 Another flowchart of a method for audio code conversion according to the present application;
[0059] Figure 4 Another flowchart of a method for audio code conversion according to the present application;
[0060] Figure 5 A schematic diagram of a system for audio code conversion according to the present application;
[0061] Figure 6 Another schematic diagram of a system for audio code conversion according to the present application;
[0062] Figure 7 A schematic diagram of an audio code conversion device according to the present application. DETAILED DESCRIPTION
[0063] It should be noted that the audio code conversion method provided in the present application can be applied to a terminal, a system, or a server. For the convenience of explanation, the present application uses the system as an example for explanation.
[0064] See also Figure 1The present application provides an embodiment of a method for audio code conversion, which includes:
[0065] 101. Obtain an audio data packet to be decoded, where the audio data packet is obtained by encoding the original audio data in the same encoding manner.
[0066] The sources of audio data packets include but are not limited to files, network streams, memory buffers, etc. When acquiring, the system sends an acquisition request to the audio source. The audio source prepares the original audio data according to this request and encodes it. When dealing with audio data with a large amount of data, the original audio data can also be divided into several audio segments, and then the several audio segments are encoded separately (using the same encoding method to encode each audio segment), and then the encoded audio data is sent to the system.
[0067] The encoding method of the original audio data at the audio source includes but is not limited to MP3 encoding, AAC encoding, FLAC encoding, Base encoding, etc.
[0068] After obtaining the audio data packet, the system can also check the integrity of the audio data packet, specifically checking the header information of the audio data packet, such as length, encoding type, etc. The system can temporarily store the obtained audio data in the local memory for subsequent decoding process.
[0069] In addition, when processing large audio files or real-time audio streams, due to network bandwidth, latency or file size limitations, audio data is often not transmitted in one go, but is divided into several smaller data segments for segmented transmission. Therefore, when obtaining an audio data packet, several audio data segments transmitted in segments are received, and several audio data segments are combined in sequence to form an audio data packet, as follows:
[0070] Each received audio data segment contains metadata such as a timestamp, a sequence number, etc. When combining, the audio data segments are reassembled according to the timestamp or the sequence number to form an audio data packet.
[0071] 102. Decode the audio data packet according to a decoding rule corresponding to the encoding method to obtain decoded data.
[0072] The decoding rules selected in the decoding process correspond to the encoding method of the audio source. The decoding rules correspond to the decoder. The encoder corresponding to the encoding method is selected to decode the audio data packet. For example, when the Base encoding method is used for encoding, the Base decoder is selected for decoding.
[0073] Specifically, the system determines the encoding method according to the audio data packet, then determines the decoder type according to the encoding method, and finally decodes the audio data packet through the determined decoder.
[0074] The decoded data is output in PCM (Pulse Code Modulation) format, which is an uncompressed audio data format. Depending on the content of the audio data packet, the decoded data also contains audio parameter information such as sampling rate and number of channels.
[0075] 103. Fill the decoded data into the first array in the format of unsigned integers.
[0076] The decoded PCM data (decoded data) is usually represented in different bit depths (such as 8 bits, 16 bits, 24 bits, etc.) and formats (such as signed, unsigned, floating point, etc.). In this step, the decoded data is converted into a unified unsigned integer format and stored in an array (the first array). Converting data of different formats into an unsigned integer format can eliminate the complexity caused by format differences and make subsequent processing steps more unified and simple.
[0077] During the conversion process, the system first creates an empty first array whose format is an unsigned integer format, and then determines the format type of the decoded data. If the format type of the decoded data is an unsigned integer format, the decoded data is directly filled into the first array; if the format type of the decoded data is not an unsigned integer format, the data format of the decoded data is converted into an unsigned integer format, and after the conversion, it is filled into the first array in sequence. Each element in the first array corresponds to an audio sample.
[0078] 104. Convert the data format of the first array filled with decoded data into a 32-bit floating point format through a preset format conversion strategy to obtain a target array, where the target array is used to generate an audio stream.
[0079] By presetting the format conversion strategy, the first array in unsigned integer format can be directly or indirectly converted into a target array in 32-bit floating point format. Compared with unsigned integers, 32-bit floating point numbers can provide higher data accuracy. Converting audio data into 32-bit floating point format can ensure compatibility with many audio processing algorithms and APIs (such as audio playback, filtering, analysis, etc.) and obtain better processing effects.
[0080] For example, in the process of converting from an 8-bit unsigned integer format to a 32-bit floating point format, in the direct conversion process, the conversion formula float_value = (int_value / 255.0) can be used for conversion, where int_value represents the original 8-bit unsigned integer, whose value range is 0 to 255, and float_value represents the converted 32-bit floating point number, whose value range is 0.0 to 1.0. For example, when int_value is 0, float_value is 0 / 255.0 = 0.0.
[0081] When int_value is 255, float_value is 255 / 255.0=1.0.
[0082] For other values of int_value between 0 and 255, float_value is linearly mapped between 0.0 and 1.0.
[0083] The target array now contains data in 32-bit floating point format that can be used to generate audio streams, which can be directly used for audio playback. Browsers, online playback platforms, etc. can generate audio streams for playback based on this target array and parameters such as the audio sampling rate and number of channels.
[0084] In this embodiment, an audio data packet to be decoded is obtained, which is obtained by encoding the original audio data in the same encoding method, and then the audio data packet is decoded using a decoding rule corresponding to the encoding method to obtain decoded data, and then the decoded data is filled into a first array of unsigned integers, and finally, through a preset format conversion strategy, the data format of the first array filled with the decoded data is converted into a 32-bit floating point format to obtain a target array, which is used to generate an audio stream, thereby realizing the conversion of audio from original code to playable code, avoiding the situation where different segments use different encoding methods, and improving the integrity of the transcoded audio; unifying the output format of the audio after transcoding, and improving the compatibility of the audio after transcoding.
[0085] When the unsigned integer format corresponding to the first array is specifically an 8-bit unsigned integer format, indirect conversion can be used during the conversion of the first array to the target array. Figure 2 The present application provides another embodiment of a method for audio code conversion, the embodiment comprising:
[0086] 201. Convert the data format of the first array filled with decoded data into a 16-bit signed integer format to obtain a second array.
[0087] 202. Convert the data format of the second array into a 32-bit floating point format.
[0088] The data format of the second array is a 16-bit signed integer format. In the process of converting the first array into the target data, the first array is first converted into the second array, and then the second array is converted into the target array. Its format is also converted from the initial 8-bit unsigned integer format to the 16-bit signed integer format, and then converted to the 32-bit floating point format.
[0089] In the process of converting the first array into the second array, each audio sample of the first array is first traversed, and each audio sample is converted into a 16-bit signed integer. The converted 16-bit signed integers are sequentially stored in the second array to form a new data set (second array).
[0090] In the process of converting the first array to the second array, see Figure 3 The present application provides another embodiment of a method for audio code conversion, the embodiment comprising:
[0091] 301. Build a DataView instance based on the buffer of the first array, and fill the decoded data into the DataView instance.
[0092] 302. Convert the buffer attribute in the DataView instance into a data format of a 16-bit signed integer to obtain a second array.
[0093] In this embodiment, the .buffer property of the first array is used to obtain its underlying ArrayBuffer, and the new DataView() method is used to pass the ArrayBuffer to create a DataView instance. The DataView instance provides a view that allows access and manipulation of decoded data in the ArrayBuffer in different data types and formats.
[0094] Create an empty array in the format of 16-bit signed integers, convert the format of the decoded data in the first array into 16-bit signed integers, and fill them into the empty array in sequence. After the filling is completed, the second array is formed.
[0095] See also Figure 4 The present application provides another embodiment of a method for audio code conversion, the embodiment comprising:
[0096] 401. Create a 32-bit floating point array, convert each decoded data in the second array into a floating point number and store it in the 32-bit floating point array.
[0097] The length of the created 32-bit floating-point array is the same as that of the second array; each audio sample in the second array is traversed, each audio sample is converted into a corresponding floating-point value, and the converted floating-point number is stored in the corresponding position of the 32-bit floating-point array.
[0098] 402. Create a target audio data array according to the audio sampling rate, fill the decoded data in the 32-bit floating point array into the target audio data array, and the audio sampling rate is determined by the audio data packet.
[0099] The sampling rate refers to the number of samples extracted from a continuous signal per second, usually in Hertz (Hz); the sampling rate information is read from the audio data packet, and the total length of the target audio data array is calculated based on the sampling rate, the number of audio channels, and the duration, where the number of channels can be mono (1 channel), stereo (2 channels), or multi-channel; the duration refers to the length of time the audio data is played, usually in seconds.
[0100] The calculation formula for the total length is total length = sampling rate * number of channels * duration.
[0101] After determining the total length, use the Float32Array constructor to create a new array that is used to store the converted 32-bit floating-point audio data.
[0102] 403. Initialize the audio object of the browser and set the audio parameters of the audio object.
[0103] The audio parameters include but are not limited to sampling rate (the sampling rate matches the sampling rate of the audio data before encoding to avoid audio distortion or quality degradation), audio node, volume, frequency, etc.
[0104] In the context of the Web Audio API, audio objects include various objects and interfaces related to audio processing, such as audio context, audio nodes, and audio buffers. The audio context is the core object of the Web Audio API. Through the audio context, you can create various audio nodes and connect them together to form an audio processing pipeline. The audio context is also responsible for managing and synchronizing audio events to ensure smooth playback of audio data.
[0105] In this step, first create an audio context object and set its parameters such as sampling rate and number of channels as needed. Then create various audio nodes and connect them together to form an audio processing pipeline.
[0106] 404. Write the audio data in the target audio data array into the buffer of the audio object, so that the browser plays the audio according to the buffer of the audio object.
[0107] An audio buffer is a container for storing audio data. It contains one or more channels (such as two channels for stereo), and each channel contains a certain number of audio samples. When creating it, you need to determine the number of channels, the number of samples, and the sampling rate to meet the browser requirements.
[0108] After filling the buffer, set the buffer property of the audio buffer source node to that buffer (pointing to a buffer already filled with audio data) and connect it to the audio context's destination (usually a speaker) to play the audio data.
[0109] See also Figure 5 The present application provides an embodiment of a system for audio code conversion, the embodiment comprising:
[0110] The acquisition unit 501 is used to acquire an audio data packet to be decoded, where the audio data packet is obtained by encoding the original audio data in the same encoding method;
[0111] The decoding unit 502 is used to decode the audio data packet according to the decoding rule corresponding to the encoding method to obtain decoded data;
[0112] A filling unit 503, used to fill the decoded data into a first array in the format of unsigned integers;
[0113] The conversion unit 504 is used to convert the data format of the first array filled with decoded data into a 32-bit floating point format through a preset format conversion strategy to obtain a target array, and the target array is used to generate an audio stream.
[0114] In this embodiment, firstly, an audio data packet to be decoded is acquired by the acquisition unit 501, and the audio data packet is obtained by encoding the original audio data in the same encoding method. Then, the audio data packet is decoded by the decoding unit 502 according to the decoding rule corresponding to the encoding method to obtain decoded data, and then the decoded data is filled into the first array in the unsigned format by the filling unit 503. Finally, according to the pre-format conversion rule, the data format of the first array filled with the decoded data is converted into a 32-bit floating point format by the conversion unit 504, so as to obtain a target array. The target array is used to generate an audio stream, thereby realizing the conversion of audio from original code to playable code, unifying the encoding and decoding methods, avoiding the situation where different segments use different encoding methods, and improving the integrity of the transcoded audio; unifying the output format of the audio after transcoding, and improving the compatibility of the audio after transcoding.
[0115] See also Figure 6 The present application provides another embodiment of a system for audio code conversion, the embodiment comprising:
[0116] The acquisition unit 601 is used to acquire an audio data packet to be decoded, where the audio data packet is obtained by encoding the original audio data in the same encoding method;
[0117] The acquisition unit 601 includes:
[0118] A combining module 6011 is used to receive a plurality of audio data segments transmitted in segments, and combine the plurality of audio data segments in sequence to form an audio data packet;
[0119] The decoding unit 602 is used to decode the audio data packet according to the decoding rule corresponding to the encoding method to obtain decoded data;
[0120] A filling unit 603, used to fill the decoded data into a first array in the format of unsigned integers;
[0121] A conversion unit 604 is used to convert the data format of the first array filled with decoded data into a 32-bit floating point format through a preset format conversion strategy to obtain a target array, where the target array is used to generate an audio stream;
[0122] The conversion unit 604 includes:
[0123] A first conversion module 6041 is used to convert the data format of the first array filled with decoded data into a 16-bit signed integer format to obtain a second array;
[0124] The first conversion module 6041 includes:
[0125] The filling submodule 60411 is used to construct a DataView instance based on the buffer of the first array, and fill the decoded data into the DataView instance;
[0126] The conversion submodule 60412 is used to convert the buffer attributes in the DataView instance into a data format of a 16-bit signed integer to obtain a second array;
[0127] The second conversion module 6042 is used to convert the data format of the second array into a 32-bit floating point format;
[0128] The second conversion module 6042 includes:
[0129] The storage submodule 60421 is used to create a 32-bit floating point array, convert each decoded data in the second array into a floating point number and store it in the 32-bit floating point array;
[0130] A creation unit 605 is used to create a target audio data array according to an audio sampling rate, and fill the decoded data in the 32-bit floating point array into the target audio data array, wherein the audio sampling rate is determined by an audio data packet;
[0131] The setting unit 606 is used to initialize the audio object of the browser and set the audio parameters of the audio object;
[0132] A writing unit 607, used to write the audio data in the target audio data array into the buffer of the audio object, so that the browser plays the audio according to the buffer of the audio object;
[0133] The processing unit 608 is used to perform noise elimination and equalization processing on the data in the target array.
[0134] See also Figure 7 The present application also provides an audio code conversion device, comprising:
[0135] Processor 701, memory 702, input and output unit 703, bus 704;
[0136] The processor 701 is connected to the memory 702, the input and output unit 703 and the bus 704;
[0137] The memory 702 stores a program, and the processor 701 calls the program to execute the above Figures 1 to 4 Any method in the embodiments.
[0138] The present application also relates to a computer-readable storage medium, on which a program is stored, and when the program is run on a computer, the computer executes the above Figures 1 to 4 Any method in the embodiments.
[0139] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0140] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0141] The units described 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.
[0142] 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.
[0143] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.
Claims
1. A method for audio code conversion, characterized in that: The method comprises: Acquire an audio data packet to be decoded, wherein the audio data packet is obtained by encoding the original audio data in the same encoding manner; Decoding the audio data packet according to a decoding rule corresponding to the encoding method to obtain decoded data; Fill the decoded data into a first array in the format of unsigned integers; The data format of the first array filled with the decoded data is converted into a 32-bit floating point format through a preset format conversion strategy to obtain a target array, and the target array is used to generate an audio stream.
2. The method according to claim 1, characterized in that The unsigned integer is an 8-bit unsigned integer, and the data format of the first array filled with the decoded data is converted into a 32-bit floating point format by using a preset format conversion strategy, including: Convert the data format of the first array filled with the decoded data into a 16-bit signed integer format to obtain a second array; The data format of the second array is converted into a 32-bit floating point format.
3. The method according to claim 2, characterized in that The step of converting the data format of the first array filled with the decoded data into a 16-bit signed integer format to obtain a second array includes: Construct a DataView instance based on the buffer of the first array, and fill the decoded data into the DataView instance; The buffer attributes in the DataView instance are converted into a data format of a 16-bit signed integer to obtain the second array.
4. The method according to claim 2, characterized in that: The step of converting the data format of the second array into a 32-bit floating point format comprises: A 32-bit floating-point array is created, and each decoded data in the second array is converted into a floating-point number and stored in the 32-bit floating-point array.
5. The method according to claim 4, characterized in that The method further comprises: Creating a target audio data array according to an audio sampling rate, and filling the decoded data in the 32-bit floating point array into the target audio data array, wherein the audio sampling rate is determined by the audio data packet; Initialize the audio object of the browser and set the audio parameters of the audio object; The audio data in the target audio data array is written into the buffer of the audio object, so that the browser plays the audio according to the buffer of the audio object.
6. The method according to any one of claims 1 to 5, characterized in that After obtaining the target array, the method further includes: The data in the target array is subjected to noise elimination and equalization processing.
7. The method according to any one of claims 1 to 5, characterized in that The step of obtaining the audio data packet to be decoded comprises: A plurality of audio data segments transmitted in segments are received, and the plurality of audio data segments are combined in sequence to form the audio data packet.
8. A system for audio code conversion, characterized in that: The system comprises An acquisition unit, used for acquiring an audio data packet to be decoded, wherein the audio data packet is obtained by encoding the original audio data in the same encoding manner; A decoding unit, used for decoding the audio data packet according to a decoding rule corresponding to the encoding method to obtain decoded data; A filling unit, used to fill the decoded data into the first array in the format of unsigned integers; The conversion unit is used to convert the data format of the first array filled with decoded data into a 32-bit floating point format through a preset format conversion strategy to obtain a target array, wherein the target array is used to generate an audio stream.
9. An audio code conversion device, characterized in that: The device comprises: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a program stored thereon, wherein the program, when executed on a computer, performs the method according to any one of claims 1 to 7.