A method and device for processing audio data

By calculating the standard lines of audio data and converting unreasonable data frames, the problem of speakers producing burst sounds during audio data switching is solved, and the quality of audio playback is improved.

CN114727195BActive Publication Date: 2025-03-14THUNDERSOFT
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210255147.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-15
Publication Date
2025-03-14
Estimated Expiration
2042-03-15

AI Technical Summary

Technical Problem

When processing audio data, the prior art cannot effectively avoid the burst sound generated by the speaker during audio data switching, and the traditional audio fading method cannot ensure that the audio waveform amplitude attenuation is small enough, resulting in a degradation of the audio playback quality.

Method used

By obtaining the target data frames in the audio data, calculate the standard line, identify and obtain unreasonable data frames located outside the standard line, and convert these unreasonable data frames until they are converted into reasonable data frames located within the standard line.

Benefits of technology

It effectively avoids the burst sound of the speaker during audio data switching, reduces unnecessary attenuation of audio amplitude, thereby improving the quality of audio playback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114727195B_ABST
    Figure CN114727195B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and device for processing audio data, and relates to the technical field of audio data. The method comprises: obtaining a target data frame, wherein the target data frame comprises the largest data frame in the data frames of the audio data to be converted; calculating a standard line according to the target data frame; obtaining unreasonable data frames in the audio data to be converted that are outside the standard line; converting each unreasonable data frame to obtain a reasonable data frame that is within the standard line. The embodiment of the present invention not only achieves the purpose of minimizing the attenuation of audio amplitude, but also avoids the occurrence of plosive sound, and is a more optimal adaptive processing method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of audio data, and in particular to a method and a device for processing audio data. Background Art

[0002] On embedded devices, the audio data signal drives the speaker through the transmission of alternating current, converting the electrical energy of the alternating current into mechanical energy of the speaker. The electrical energy interacts with the magnetic field of the magnet through the electronic magnetic field generated by the speaker coil. As the electrical energy changes, the speaker coil drives the paper plate to move forward or backward, thereby driving the air to vibrate and produce sound. When the audio data is switched, the audio data signal undergoes discontinuous changes in the voltage and current of the alternating current at the moment of switching. When the difference between the front and the back is too large, the speaker coil will be violently displaced, causing the speaker to produce a popping sound. Figure 2 , giving people strong discomfort.

[0003] In the prior art, in order to solve the problem of plosive sounds, an audio fade-in and fade-out sound effect is introduced. The traditional method can only perform a fixed attenuation transformation on the original waveform to achieve the fade-in and fade-out effect. Therefore, it cannot ensure that the output audio waveform amplitude attenuation is small enough, resulting in reduced audio playback quality. Summary of the invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide an audio data processing method and a corresponding audio data processing device that overcome the above problems or at least partially solve the above problems.

[0005] In order to solve the above problem, an embodiment of the present invention discloses a method for processing audio data, the method comprising:

[0006] Acquire a target data frame, wherein the target data frame includes a largest data frame among data frames of the audio data to be converted;

[0007] Calculate a standard line according to the target data frame;

[0008] Acquire unreasonable data frames located outside the standard line in the audio data to be converted;

[0009] Each unreasonable data frame is converted to obtain a reasonable data frame within the standard line.

[0010] In one or more embodiments, the data frame of the audio data includes a fade-in type data frame and a fade-out type data frame, and the target data frame includes a maximum fade-in data frame and a maximum fade-out data frame;

[0011] The step of acquiring the target data frame comprises:

[0012] storing the data frames of the fade-in type in the audio data into a fade-in data buffer, and storing the data frames of the fade-out type in the audio data into a fade-out data buffer;

[0013] Determining a maximum fade-in data frame from the fade-in data buffer, and determining a maximum fade-out data frame from the fade-out data buffer;

[0014] The maximum fade-in data frame and the maximum fade-out data frame are used as target data frames.

[0015] In one or more embodiments, calculating the standard line according to the target data frame includes:

[0016] Calculate a linear coefficient according to the target data frame;

[0017] The standard line is calculated according to the linear coefficient.

[0018] In one or more embodiments, converting each unreasonable data frame to obtain a reasonable data frame within the standard line includes:

[0019] Determine a gradient coefficient corresponding to each of the data frames based on the size of the audio data and the quality of each data frame in the data frames of the audio data;

[0020] Determine that a data frame whose ordinate is greater than and / or equal to zero among the unreasonable data frames is a first unreasonable data frame, and a data frame whose ordinate is less than zero is a second unreasonable data frame;

[0021] Determine, from the respective gradient coefficients, a first gradient coefficient corresponding to each of the first unreasonable data frames, and a second gradient coefficient corresponding to each of the second unreasonable data frames;

[0022] The first unreasonable data frame is converted according to the first gradient coefficient to obtain a first converted data frame, and the second unreasonable data frame is converted according to the second gradient coefficient to obtain a second converted data frame;

[0023] The first converted data frame and the second converted data frame are used as the reasonable data frames.

[0024] In one or more embodiments, determining the gradient coefficient corresponding to each data frame based on the size of the audio data and the quality size of each data frame in the data frames of the audio data includes:

[0025] Calculating a step value according to the size of the audio data and the quality of each data frame in the data frame of the audio data;

[0026] The gradient coefficient corresponding to each of the at least one data frame is calculated according to the step value.

[0027] In one or more embodiments, after converting each unreasonable data frame to obtain a reasonable data frame within the standard line, the method further includes:

[0028] The converted audio data is output, and the converted audio data includes reasonable data frames in the audio data to be converted and reasonable data frames located within the standard line obtained by converting unreasonable data frames.

[0029] Accordingly, an embodiment of the present invention discloses a device for processing audio data, the device comprising:

[0030] An acquisition module, used for acquiring a target data frame, wherein the target data frame comprises a largest data frame among data frames of the audio data to be converted;

[0031] A calculation module, used for calculating a standard line according to the target data frame;

[0032] An unreasonable data frame acquisition module, used for acquiring unreasonable data frames located outside the standard line in the audio data to be converted;

[0033] The conversion module is used to convert each unreasonable data frame to obtain a reasonable data frame within the standard line.

[0034] In one or more embodiments, the data frame of the audio data includes a fade-in type data frame and a fade-out type data frame, and the target data frame includes a maximum fade-in data frame and a maximum fade-out data frame;

[0035] The acquisition module includes: a type confirmation submodule, which is used to store the data frame of the fade-in type in the audio data into a fade-in data buffer, and to store the data frame of the fade-out type in the audio data into a fade-out data buffer;

[0036] The data confirmation submodule is used to determine the largest fade-in data frame from the fade-in data buffer and the largest fade-out data frame from the fade-out data buffer; and use the largest fade-in data frame and the largest fade-out data frame as target data frames.

[0037] In one or more embodiments, the computing module includes:

[0038] A first calculation module submodule, used to calculate a linear coefficient according to the target data frame;

[0039] The second calculation module submodule is used to calculate the standard line according to the linear coefficient.

[0040] In one or more embodiments, the conversion module includes:

[0041] A coefficient calculation submodule, used for determining a gradient coefficient corresponding to each data frame based on the size of the audio data and the quality of each data frame in the data frame of the audio data;

[0042] A determination submodule, configured to determine, among the unreasonable data frames, a data frame whose ordinate is greater than and / or equal to zero as a first unreasonable data frame, and a data frame whose ordinate is less than zero as a second unreasonable data frame;

[0043] A coefficient determination submodule, used for determining, from the respective gradient coefficients, a first gradient coefficient corresponding to each of the first unreasonable data frames, and a second gradient coefficient corresponding to each of the second unreasonable data frames;

[0044] a data conversion submodule, configured to convert the first unreasonable data frame according to the first gradient coefficient to obtain a first converted data frame, and to convert the second unreasonable data frame according to the second gradient coefficient to obtain a second converted data frame;

[0045] The output submodule is used to use the first conversion data frame and the second conversion data frame as the reasonable data frames.

[0046] In one or more embodiments, the coefficient calculation submodule includes:

[0047] A first calculation unit, configured to calculate a step value according to the size of the audio data and the quality of each data frame in the data frames of the audio data;

[0048] The second calculation unit is used to calculate the gradient coefficient corresponding to each of the at least one data frame according to the step value.

[0049] In one or more embodiments, after the conversion module, it also includes:

[0050] The output module is used to output the converted audio data, wherein the converted audio data includes reasonable data frames in the audio data to be converted and reasonable data frames located within the standard line obtained by converting unreasonable data frames.

[0051] Correspondingly, an embodiment of the present invention discloses an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the various steps of the above-mentioned audio data processing method embodiment when executed by the processor.

[0052] Accordingly, an embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each step of the above-mentioned audio data processing method embodiment is implemented.

[0053] The embodiment of the present invention includes the following advantages: by acquiring a target data frame, the target data frame includes the largest data frame in the data frame of the audio data to be converted; calculating the standard line according to the target data frame; acquiring the unreasonable data frame in the audio data to be converted that is outside the standard line; converting each unreasonable data frame to obtain a reasonable data frame that is within the standard line. The embodiment of the present invention can calculate the standard line of the audio data according to the target data frame in the audio data. Because the target data frame of each audio data is different, the calculated standard line is also different, which realizes dynamic identification of audio data, and then acquires unreasonable data frames outside the standard line. Those within the standard line do not need to be converted and can be directly output, which realizes the purpose of minimizing audio amplitude attenuation. The unreasonable data frame is outside the standard line, and after conversion, a reasonable data frame within the standard line can be obtained. Therefore, the reasonable data frames are all within the standard line, so the occurrence of plosive sound is avoided, which is a better adaptive processing method. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 is a flowchart of a method for processing audio data provided by an embodiment of the present invention;

[0055] Figure 2 is an audio data switching change diagram provided by an embodiment of the present invention;

[0056] Figure 3 The audio data distribution provided by the embodiment of the present invention Figure 1 ;

[0057] Figure 4 The audio data distribution provided by the embodiment of the present invention Figure 2 ;

[0058] Figure 5 is a waveform diagram of audio data converted according to an embodiment of the present invention;

[0059] Figure 6 The embodiment of the present invention provides Figure 5 The waveform after conversion again;

[0060] Figure 7 It is a structural framework diagram of an audio data processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0061] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0062] Reference Figure 1 , shows a flowchart of a method for processing audio data provided by an embodiment of the present invention, and the method may specifically include the following steps:

[0063] Step 101: Acquire a target data frame, wherein the target data frame includes the largest data frame among data frames of audio data to be converted.

[0064] When switching audio data, plosive sound is likely to occur due to unstable current and voltage. Therefore, the audio data needs to be converted so that the converted audio data will not produce plosive sound.

[0065] The audio data has multiple sources, such as telephone, media, navigation, voice recognition, etc. The audio data includes at least one data frame, and the at least one data frame includes a fade-in type data frame and a fade-out type data frame. The fade-in type data frame is a data frame in which the audio data gain gradually changes from weak to strong, and the fade-out type data frame is a data frame in which the audio data gain gradually changes from strong to weak, wherein the gain is the degree of increase in voltage, current or power, usually specified in decibels (dB).

[0066] When performing audio data conversion, it is necessary to obtain a target data frame, which includes the largest data frame among the data frames of the audio data to be converted, and is used for calculating the audio data in subsequent steps.

[0067] In the embodiment of the present invention, the step of acquiring the target data frame includes:

[0068] storing the data frames of the fade-in type in the audio data into a fade-in data buffer, and storing the data frames of the fade-out type in the audio data into a fade-out data buffer;

[0069] Determining a maximum fade-in data frame from the fade-in data buffer, and determining a maximum fade-out data frame from the fade-out data buffer;

[0070] The maximum fade-in data frame and the maximum fade-out data frame are used as target data frames.

[0071] The types of audio data are divided into fade-in audio type and fade-out audio type, and the target data frame includes the maximum fade-in data frame and the maximum fade-out data frame, so the audio data is divided into a fade-in data buffer and a fade-out data buffer, and the data frame of the fade-in type in the audio data is stored in the fade-in data buffer, and the data frame of the fade-out type in the audio data is stored in the fade-out data buffer, and the maximum fade-in data frame is determined from the fade-in data buffer, and the maximum fade-out data frame is determined from the fade-out data buffer, and the audio data has a data type each time, so there is one maximum target data frame (amplitude_max).

[0072] For example, when music starts to play, it fades in, and the largest target data frame obtained is a fade-in type data frame. When the music ends, it fades out, and the largest target data frame obtained is a fade-out type data frame. Therefore, the data frames at the same time are fade-in type data frames or fade-out type data frames.

[0073] Step 102, calculating a standard line according to the target data frame.

[0074] The standard line is calculated based on the target data frame in the audio data and is used to distinguish reasonable data frames from unreasonable data frames in the data frames.

[0075] In the embodiment of the present invention, the step of calculating the standard line according to the target data frame includes:

[0076] Calculate a linear coefficient according to the target data frame;

[0077] The standard line is calculated according to the linear coefficient.

[0078] Specifically, the target data frame is calculated using formula (1) to obtain the linear coefficient. Formula (1) is as follows:

[0079] K stand =amplitude_max / (buffer_size / frame_size) formula (1)

[0080] It should be noted that in formula (1), the linear coefficient K is calculated based on the acquired target data frame (amplitude_max), the audio data size (buffer_size), and the quality size of any data frame in at least one data frame (frame_size). stand .

[0081] Furthermore, the standard line is calculated according to the linear coefficient. Since the types of audio data are divided into fade-in audio type and fade-out audio type, the standard line is divided into fade-in standard line function and fade-out standard line function. The fade-in standard line function is obtained by using formula (2), wherein formula (2) is specifically as follows:

[0082] Line1[index]=K stand ×index formula(2)

[0083] Formula (3) is used to obtain the fade-out standard line function, where formula (3) is as follows:

[0084] Line2[index]=amplitude-K stand ×index formula (3)

[0085] Step 103: Acquire unreasonable data frames located outside the standard line in the audio data to be converted.

[0086] In order to prevent plosive sounds when audio data is switched, it is necessary to judge the audio data and convert the abnormal audio data. Therefore, the audio data that needs to be converted and is outside the standard line is judged as an unreasonable data frame, and the audio data that does not need to be converted and is within the standard line is judged as the first reasonable data.

[0087] For better understanding, refer to Figure 3 , put the waveform of the audio data into a plane coordinate system, the X-axis is the index value (index) corresponding to at least one data frame, and the Y-axis is at least one data frame (amplitude); flip the standard line along the horizontal axis to obtain the area composed of the standard lines, refer to Figure 3 In the dotted line part, the data frame located within the standard line in at least one data frame is determined as the first reasonable data frame amplitude_new1[index], and the data frame located outside the standard line is determined as an unreasonable data frame.

[0088] Step 104, converting each of the unreasonable data frames to obtain reasonable data frames within the standard line.

[0089] In order to prevent plosive sounds from occurring when audio data is switched, unreasonable data frames are converted to obtain reasonable data frames within the standard line.

[0090] In the embodiment of the present invention, converting each unreasonable data frame to obtain a reasonable data frame within the standard line includes:

[0091] Determine a gradient coefficient corresponding to each of the data frames based on the size of the audio data and the quality of each data frame in the data frames of the audio data;

[0092] Determine that a data frame whose ordinate is greater than and / or equal to zero among the unreasonable data frames is a first unreasonable data frame, and a data frame whose ordinate is less than zero is a second unreasonable data frame;

[0093] Determine, from the respective gradient coefficients, a first gradient coefficient corresponding to each of the first unreasonable data frames, and a second gradient coefficient corresponding to each of the second unreasonable data frames;

[0094] The first unreasonable data frame is converted according to the first gradient coefficient to obtain a first converted data frame, and the second unreasonable data frame is converted according to the second gradient coefficient to obtain a second converted data frame;

[0095] The first converted data frame and the second converted data frame are used as the reasonable data frames.

[0096] In the embodiment of the present invention, determining the gradient coefficient corresponding to each data frame based on the size of the audio data and the quality of each data frame in the data frame of the audio data includes:

[0097] Calculating a step value according to the size of the audio data and the quality of each data frame in the data frame of the audio data;

[0098] The gradient coefficient corresponding to each of the at least one data frame is calculated according to the step value.

[0099] Among them, the step value is a value calculated based on the size of the audio data and the quality of any data frame in at least one data frame. Since the quality of any data frame is the same, the step value of the current audio data is the same, and the gradient coefficient is the change value of the index value of the current data frame in the audio data relative to the step value.

[0100] Specifically, the size of the audio data and the quality of any data frame in at least one data frame are calculated using formula (4) to obtain the step value. Formula (4) is as follows:

[0101] step=1 / (buffer_size / frame_size)=frame_size / buffer_size formula (4)

[0102] Furthermore, because the types of audio data are divided into fade-in audio type and fade-out audio type, the gradient coefficient is divided into fade-in gradient coefficient and fade-out gradient coefficient, and the fade-in gradient coefficient is obtained by using formula (5), wherein formula (5) is specifically as follows:

[0103] k1[index]=step×index formula (5)

[0104] The fade-out gradient coefficient is obtained by using formula (6), wherein formula (6) is specifically as follows:

[0105] k2[index]=1-step×index formula (6)

[0106] In addition, because the audio data conversion method is different in different situations, it is necessary to distinguish unreasonable data frames. Among the unreasonable data frames, the data frames whose ordinates are greater than and / or equal to zero are determined as the first unreasonable data frames, and the data frames whose ordinates are less than zero are determined as the second unreasonable data frames. Figure 4 .

[0107] Because the audio data of the first unreasonable data frame and the second unreasonable data frame are different, the subsequent conversion methods are different, so it is necessary to obtain the corresponding gradient coefficients, that is, to obtain the first gradient coefficient corresponding to the first unreasonable data from each gradient system, and to obtain the second gradient coefficient corresponding to the second unreasonable data frame.

[0108] When converting unreasonable data frames in audio data, the first unreasonable data frame can be converted according to the first gradient coefficient to obtain a first converted data frame, and the second unreasonable data frame can be converted according to the second gradient coefficient to obtain a second converted data frame.

[0109] Specifically, the first unreasonable data frame amplitude_old1[index] is transformed using formula (7), the first gradient coefficient k1[index], and the standard line function line[index] to obtain the first transformed data frame amplitude_change1[index]. Formula (7) is as follows:

[0110] amplitude_change1[index]=

[0111] (amplitude_old1[index]-line[index]+amplitude_max)×k1[index] formula (7)

[0112] Among them, when the target data frame is the largest fade-in data frame, the standard line function line[index] is the fade-in standard line function line1[index], and when the target data frame is the largest fade-out data frame, the standard line function line[index] is the fade-out standard line function line2[index].

[0113] The second unreasonable data frame amplitude_old2[index] is transformed using formula (8), the second gradient coefficient k2[index], and the standard line function line[index] to obtain a second transformed data frame amplitude_change2[index]. Formula (8) is as follows:

[0114] amplitude_change2[index]=

[0115] (amplitude_old2[index]+line[index]-amplitude_max)×k2[index] formula (8)

[0116] Among them, when the target data frame is the largest fade-in data frame, the standard line function line[index] is the fade-in standard line function line1[index], and when the target data frame is the largest fade-out data frame, the standard line function line[index] is the fade-out standard line function line2[index].

[0117] It should be noted that the same parameters in formula (7) and formula (8) have the same meaning, the difference is that the values ​​corresponding to the parameters are different. For example, the audio data includes a first unreasonable data frame and a second unreasonable data frame. The first unreasonable data frame corresponds to a first gradient coefficient, and the second unreasonable data frame corresponds to a second gradient coefficient. The first unreasonable data frame and the first gradient coefficient are substituted into formula (7), and the second unreasonable data frame and the second gradient coefficient are substituted into formula (8). The operation of "-" followed by "+" is used in the brackets of formula (7), and the operation of "+" followed by "-" is used in the brackets of formula (8). This is because the data obtained from the first unreasonable data frame is a positive value, and the data obtained from the second unreasonable data frame is a negative value, so it is necessary to replace the "-" and "+" in the formula.

[0118] The converted first conversion data frame and the converted second conversion data frame are both data frames located within the standard line, so the first conversion data frame and the second conversion data frame are regarded as second reasonable data frames.

[0119] For example, if the audio data A belongs to an unreasonable data frame, then determine whether the ordinate of the audio data A is greater than or equal to zero or less than zero. If it is greater than or equal to zero, calculate the corresponding gradient coefficient according to the index value of the audio data A on the horizontal axis, and then substitute the ordinate data of the audio data A and the corresponding gradient coefficient into the preset first conversion method for conversion to obtain a corresponding reasonable first conversion data frame. If the audio data A is less than zero, calculate the corresponding gradient coefficient according to the index value of the audio data A on the horizontal axis, and then substitute the ordinate data of the audio data A and the corresponding gradient coefficient into the preset second conversion method for conversion to obtain a corresponding reasonable second conversion data frame. Then use the first conversion data frame and the second conversion data frame as the second reasonable data frame, so that the output audio data A is within the standard line, and then use the first reasonable data frame and the second reasonable data frame as the converted audio data.

[0120] In the embodiment of the present invention, after converting each unreasonable data frame to obtain a reasonable data frame within the standard line, the method further includes:

[0121] The converted audio data is output, and the converted audio data includes reasonable data frames in the audio data to be converted and reasonable data frames located within the standard line obtained by converting unreasonable data frames.

[0122] Specifically, the reasonable data frames in the audio data and the reasonable data frames after conversion are output together as the converted audio data.

[0123] Reference Figure 5 The range formed by the two straight lines is the amplitude range after the traditional fade-in sound effect processing, and the range formed by the waveform is the amplitude range after the processing by the embodiment of the present invention. After comparison, it can be seen that the waveform of the embodiment of the present invention has obviously smaller amplitude attenuation than the waveform formed by the traditional processing method represented by the straight line, the change curve is smoother, and the audio playback quality is higher.

[0124] Figure 6 For Figure 5 The waveform diagram shown in FIG. 1 is obtained by further processing. The range formed by the two curves is the amplitude range after the traditional fade-in sound effect processing. The range formed by the waveform is the amplitude range after the processing of the embodiment of the present invention. Because it is a waveform that has been output after the fade-in processing, there is no plosive sound problem, so there is no need to transform the waveform again. After comparison, it can be seen that the straight line indicates that the traditional processing method still has a certain effect on the sound. Figure 5 The waveform diagram shown has been transformed, resulting in a significant attenuation of the waveform amplitude. However, the processing method of the embodiment of the present invention has identified that there is no problem with the waveform, so no transformation is performed, and the audio playback quality is higher.

[0125] In the embodiment of the present invention, a target data frame is obtained, the target data frame includes the largest data frame in the data frame of the audio data to be converted; a standard line is calculated according to the target data frame; unreasonable data frames in the audio data to be converted that are outside the standard line are obtained; each unreasonable data frame is converted to obtain a reasonable data frame that is within the standard line. The embodiment of the present invention can calculate the standard line of the audio data according to the target data frame in the audio data. Because the target data frame of each audio data is different, the calculated standard line is also different, which realizes dynamic identification of audio data, and then obtains unreasonable data frames outside the standard line. Those within the standard line do not need to be converted and can be directly output, which realizes the purpose of minimizing audio amplitude attenuation. The unreasonable data frame is outside the standard line, and after conversion, a reasonable data frame within the standard line can be obtained. Therefore, the reasonable data frames are all within the standard line, so the occurrence of plosive sound is avoided, which is a better adaptive processing method.

[0126] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0127] Reference Figure 7 , shows a structural block diagram of an audio data processing device provided by an embodiment of the present invention, which may specifically include the following modules:

[0128] An acquisition module 201 is used to acquire a target data frame, wherein the target data frame includes a largest data frame among data frames of the audio data to be converted;

[0129] A calculation module 202, configured to calculate a standard line according to the target data frame;

[0130] An unreasonable data frame acquisition module 203 is used to acquire unreasonable data frames located outside the standard line in the audio data to be converted;

[0131] The conversion module 204 is used to convert each unreasonable data frame to obtain a reasonable data frame within the standard line.

[0132] In the embodiment of the present invention, the data frame of the audio data includes a fade-in type data frame and a fade-out type data frame, and the target data frame includes a maximum fade-in data frame and a maximum fade-out data frame;

[0133] The acquisition module includes: a type confirmation submodule, which is used to store the data frame of the fade-in type in the audio data into a fade-in data buffer, and to store the data frame of the fade-out type in the audio data into a fade-out data buffer;

[0134] The data confirmation submodule is used to determine the largest fade-in data frame from the fade-in data buffer and the largest fade-out data frame from the fade-out data buffer; and use the largest fade-in data frame and the largest fade-out data frame as target data frames.

[0135] In an embodiment of the present invention, the calculation module includes:

[0136] A first calculation module submodule, used to calculate a linear coefficient according to the target data frame;

[0137] The second calculation module submodule is used to calculate the standard line according to the linear coefficient.

[0138] In an embodiment of the present invention, the conversion module includes:

[0139] A coefficient calculation submodule, used for determining a gradient coefficient corresponding to each data frame based on the size of the audio data and the quality of each data frame in the data frame of the audio data;

[0140] A determination submodule, configured to determine, among the unreasonable data frames, a data frame whose ordinate is greater than and / or equal to zero as a first unreasonable data frame, and a data frame whose ordinate is less than zero as a second unreasonable data frame;

[0141] A coefficient determination submodule, used for determining, from the respective gradient coefficients, a first gradient coefficient corresponding to each of the first unreasonable data frames, and a second gradient coefficient corresponding to each of the second unreasonable data frames;

[0142] a data conversion submodule, configured to convert the first unreasonable data frame according to the first gradient coefficient to obtain a first converted data frame, and to convert the second unreasonable data frame according to the second gradient coefficient to obtain a second converted data frame;

[0143] The output submodule is used to use the first conversion data frame and the second conversion data frame as the reasonable data frames.

[0144] In an embodiment of the present invention, the coefficient calculation submodule includes:

[0145] A first calculation unit, configured to calculate a step value according to the size of the audio data and the quality of each data frame in the data frames of the audio data;

[0146] The second calculation unit is used to calculate the gradient coefficient corresponding to each of the at least one data frame according to the step value.

[0147] In the embodiment of the present invention, after the conversion module, the following is further included:

[0148] The output module is used to output the converted audio data, wherein the converted audio data includes reasonable data frames in the audio data to be converted and reasonable data frames located within the standard line obtained by converting unreasonable data frames.

[0149] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0150] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0151] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0152] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0153] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.

[0154] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0155] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0156] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0157] The above is a detailed introduction to an audio data processing method and an audio data processing device provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for processing audio data, characterized in that: The method comprises: Acquire a target data frame, wherein the target data frame includes a data frame with the largest amplitude among data frames of the audio data to be converted; Calculate a standard line according to the target data frame; Acquire unreasonable data frames in the audio data to be converted that are outside the area formed by the standard lines; Convert each unreasonable data frame to obtain a reasonable data frame within the standard line; The step of calculating the standard line according to the target data frame includes: Calculate a linear coefficient according to the target data frame, wherein the linear coefficient is obtained by calculating a ratio according to the acquired target data frame, the size of the audio data, and the quality size of any data frame in at least one data frame; The standard line is calculated according to the linear coefficient.

2. The processing method according to claim 1, characterized in that: The data frames of the audio data include a fade-in type data frame and a fade-out type data frame, and the target data frame includes a fade-in data frame with the largest amplitude and a fade-out data frame with the largest amplitude; The step of acquiring the target data frame comprises: storing the data frames of the fade-in type in the audio data into a fade-in data buffer, and storing the data frames of the fade-out type in the audio data into a fade-out data buffer; Determine a fade-in data frame with the largest amplitude from the fade-in data buffer, and determine a fade-out data frame with the largest amplitude from the fade-out data buffer; The fade-in data frame with the largest amplitude and the fade-out data frame with the largest amplitude are taken as target data frames.

3. The processing method according to claim 1, characterized in that: The converting of each unreasonable data frame to obtain a reasonable data frame within the standard line includes: Determine a gradient coefficient corresponding to each of the data frames based on the size of the audio data and the quality of each data frame in the data frames of the audio data; Determine that a data frame whose ordinate is greater than and / or equal to zero among the unreasonable data frames is a first unreasonable data frame, and a data frame whose ordinate is less than zero is a second unreasonable data frame; Determine, from the respective gradient coefficients, a first gradient coefficient corresponding to each of the first unreasonable data frames, and a second gradient coefficient corresponding to each of the second unreasonable data frames; The first unreasonable data frame is converted according to the first gradient coefficient to obtain a first converted data frame, and the second unreasonable data frame is converted according to the second gradient coefficient to obtain a second converted data frame; The first converted data frame and the second converted data frame are used as the reasonable data frames.

4. The processing method according to claim 3, characterized in that: The step of determining the gradient coefficient corresponding to each of the data frames based on the size of the audio data and the quality of each data frame in the data frames of the audio data comprises: Calculating a step value according to the size of the audio data and the quality of each data frame in the data frame of the audio data; The gradient coefficient corresponding to each of the at least one data frame is calculated according to the step value.

5. The processing method according to any one of claims 1 to 4, characterized in that: After converting each unreasonable data frame to obtain a reasonable data frame within the standard line, the method further includes: The converted audio data is output, and the converted audio data includes reasonable data frames in the audio data to be converted and reasonable data frames located within the standard line obtained by converting unreasonable data frames.

6. An audio data processing device, characterized in that: The device comprises: An acquisition module, used for acquiring a target data frame, wherein the target data frame includes a data frame with the largest amplitude among data frames of the audio data to be converted; A calculation module, used for calculating a standard line according to the target data frame; An unreasonable data frame acquisition module, used for acquiring unreasonable data frames in the audio data to be converted that are outside the area formed by the standard lines; A conversion module, used for converting each unreasonable data frame to obtain a reasonable data frame within the standard line; The calculation module comprises: A first calculation module submodule is used to calculate a linear coefficient according to the target data frame, wherein the linear coefficient is obtained by calculating a ratio according to the acquired target data frame, the size of the audio data, and the quality size of any data frame in at least one data frame; The second calculation module submodule is used to calculate the standard line according to the linear coefficient.

7. The processing device according to claim 6, characterized in that The data frames of the audio data include a fade-in type data frame and a fade-out type data frame, and the target data frame includes a fade-in data frame with the largest amplitude and a fade-out data frame with the largest amplitude; The acquisition module includes: a type confirmation submodule, which is used to store the data frame of the fade-in type in the audio data into a fade-in data buffer, and to store the data frame of the fade-out type in the audio data into a fade-out data buffer; The data confirmation submodule is used to determine the fade-in data frame with the largest amplitude from the fade-in data buffer and the fade-out data frame with the largest amplitude from the fade-out data buffer; and use the fade-in data frame with the largest amplitude and the fade-out data frame with the largest amplitude as target data frames.

8. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the method for processing audio data as claimed in any one of claims 1 to 5 are implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for processing audio data according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Audio output method and terminal

    CN110058837A