CN114727195A - Audio data processing method and device - Google Patents

Audio data processing method and device Download PDF

Info

Publication number
CN114727195A
CN114727195A CN202210255147.XA CN202210255147A CN114727195A CN 114727195 A CN114727195 A CN 114727195A CN 202210255147 A CN202210255147 A CN 202210255147A CN 114727195 A CN114727195 A CN 114727195A
Authority
CN
China
Prior art keywords
data
data frame
fade
frame
unreasonable
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
CN202210255147.XA
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.)
ThunderSoft Co Ltd
Original Assignee
ThunderSoft Co 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 ThunderSoft Co Ltd filed Critical ThunderSoft Co Ltd
Priority to CN202210255147.XA priority Critical patent/CN114727195A/en
Publication of CN114727195A publication Critical patent/CN114727195A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The embodiment of the invention provides a method and a device for processing audio data, and relates to the technical field of audio data. The method comprises the following steps: acquiring 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; acquiring unreasonable data frames outside the standard line in the audio data to be converted; and converting each frame of unreasonable data frames to obtain reasonable data frames within the standard line. The embodiment of the invention not only realizes the purpose of reducing the audio amplitude attenuation as much as possible, but also avoids the occurrence of plosive, and is a better self-adaptive processing method.

Description

Audio data processing method and device
Technical Field
The present invention relates to the field of audio data technologies, and in particular, to a method and an apparatus for processing audio data.
Background
On the embedded equipment, a signal of audio data drives a loudspeaker through the transmission of alternating current, so that the electric energy of the alternating current is converted into mechanical energy of the loudspeaker, an electronic magnetic field generated by the electric energy through a coil of the loudspeaker interacts with a magnetic field of a magnet, and the coil of the loudspeaker drives a paper disc to move forwards or backwards along with the change of the electric energy, so that air is driven to vibrate to generate sound; when audio data is switched, the voltage and current of alternating current are discontinuously changed at the moment of switching the audio data signals, and when the difference between the front and the rear is overlarge, the coil of the loudspeaker is violently displaced, so that the loudspeaker is subjected to plosive sound, and people feel strong discomfort by referring to fig. 2.
In the prior art, in order to solve the problem of plosive, a sound effect of audio fade-in fade-out is introduced, and the traditional method can only perform attenuation transformation aiming at the fixation of the original waveform so as to achieve the effect of fade-in fade-out, so that the amplitude attenuation of the output audio waveform cannot be ensured to be small enough, and the audio playing quality is reduced.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a processing method of audio data and a corresponding processing apparatus of audio data that overcome or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present invention discloses a method for processing audio data, where the method includes:
acquiring 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;
acquiring unreasonable data frames outside the standard line in the audio data to be converted;
and converting the unreasonable data frame of each frame to obtain a reasonable data frame positioned within the standard line.
In one or more embodiments, the data frames of the audio data include fade-in type data frames and fade-out type data frames, and the target data frame includes a largest fade-in data frame and a largest fade-out data frame;
the acquiring the target data frame includes:
storing the fade-in type data frame in the audio data to a fade-in data buffer area, and storing the fade-out type data frame in the audio data to a fade-out data buffer area;
determining a largest fade-in data frame from the fade-in data buffer, and determining a largest fade-out data frame from the fade-out data buffer;
and taking the maximum fade-in data frame and the maximum fade-out data frame as target data frames.
In one or more embodiments, the calculating a standard line from the target data frame includes:
calculating a linear coefficient according to the target data frame;
and calculating the standard line according to the linear coefficient.
In one or more embodiments, the converting the irrational data frames for each frame to obtain reasonable data frames within a standard line includes:
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 frames of the audio data;
determining a data frame with a vertical coordinate larger than and/or equal to zero in the unreasonable data frames as a first unreasonable data frame, and determining a data frame with a vertical coordinate smaller than zero as a second unreasonable data frame;
determining a first gradient coefficient corresponding to each first unreasonable data frame and a second gradient coefficient corresponding to each second unreasonable data frame from each gradient coefficient;
converting the first unreasonable data frame according to the first gradient coefficient to obtain a first converted data frame, and converting the second unreasonable data frame according to the second gradient coefficient to obtain a second converted data frame;
and taking the first conversion data frame and the second conversion data frame as the reasonable data frame.
In one or more embodiments, the determining, based on the size of the audio data and the quality size of each of the data frames of the audio data, a fade coefficient corresponding to each of the data frames includes:
calculating 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;
and calculating the respective corresponding gradient coefficients of the at least one data frame according to the stepping values.
In one or more embodiments, after converting the unreasonable data frames for each frame to obtain reasonable data frames within the standard line, the method further includes:
and outputting the converted audio data, wherein the converted audio data comprises reasonable data frames in the audio data to be converted and reasonable data frames which are converted from the unreasonable data frames and are positioned within the standard line.
Correspondingly, the embodiment of the invention discloses a device for processing audio data, which comprises:
the device comprises an acquisition module, a conversion module and a conversion module, wherein the acquisition module is used for acquiring a target data frame, and the target data frame comprises the largest data frame in the data frames of the audio data to be converted;
the calculation module is used for calculating a standard line according to the target data frame;
an unreasonable data frame acquisition module, configured to acquire an unreasonable data frame outside the standard line in the audio data to be converted;
and the conversion module is used for converting the unreasonable data frame of each frame to obtain a reasonable data frame positioned within the standard line.
In one or more embodiments, the data frames of the audio data include fade-in type data frames and fade-out type data frames, and the target data frame includes a largest fade-in data frame and a largest fade-out data frame;
the acquisition module includes: the type confirming submodule is used for storing the fade-in type data frame in the audio data into a fade-in data buffer area and storing the fade-out type data frame in the audio data into a fade-out data buffer area;
a data confirmation sub-module, configured to determine a largest fade-in data frame from the fade-in data buffer, and determine a largest fade-out data frame from the fade-out data buffer; and taking the maximum fade-in data frame and the maximum fade-out data frame as target data frames.
In one or more embodiments, the computing module comprises:
the first calculation module submodule is used for calculating a linear coefficient according to the target data frame;
and the second calculation module submodule is used for calculating the standard line according to the linear coefficient.
In one or more embodiments, the conversion module comprises:
the coefficient calculation sub-module is 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 frames of the audio data;
the judgment submodule is used for determining that a data frame with a vertical coordinate larger than and/or equal to zero in the unreasonable data frames is a first unreasonable data frame, and a data frame with a vertical coordinate smaller than zero is a second unreasonable data frame;
a coefficient determining sub-module, configured to 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 data conversion sub-module is used for converting the first unreasonable data frame according to the first gradient coefficient to obtain a first converted data frame and converting the second unreasonable data frame according to the second gradient coefficient to obtain a second converted data frame;
an output sub-module for taking the first converted data frame and the second converted data frame as the reasonable data frame.
In one or more embodiments, the coefficient calculation sub-module includes:
the first calculating unit is used for calculating a stepping value according to the size of the audio data and the quality of each data frame in the data frames of the audio data;
and the second calculating unit is used for calculating the gradient coefficient corresponding to each data frame according to the stepping value.
In one or more embodiments, after the converting module, the method further comprises:
and the output module is used for outputting the converted audio data, and the converted audio data comprises a reasonable data frame in the audio data to be converted and a reasonable data frame which is converted from the unreasonable data frame and is positioned within the standard line.
Correspondingly, the embodiment of the invention discloses an electronic device, which comprises: a processor, a memory and a computer program stored on the memory and capable of running on the processor, the computer program, when executed by the processor, implementing the steps of the above-described audio data processing method embodiments.
Accordingly, the embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps of the above-mentioned audio data processing method embodiment.
The embodiment of the invention has the following advantages: acquiring 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; acquiring unreasonable data frames outside the standard line in the audio data to be converted; and converting each frame of unreasonable data frames to obtain reasonable data frames within the standard line. The embodiment of the 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, the audio data is dynamically identified, unreasonable data frames outside the standard line are obtained, conversion is not needed within the standard line, the audio data can be directly output, the purpose of reducing the audio amplitude attenuation as far as possible is realized, the unreasonable data frames are outside the standard line, and reasonable data frames within the standard line can be obtained after conversion, therefore, the reasonable data frames are all within the standard line, the occurrence of the plosive is avoided, and the method is a more excellent self-adaptive processing method.
Drawings
Fig. 1 is a flowchart illustrating steps of a method for processing audio data according to an embodiment of the present invention;
FIG. 2 is a diagram of audio data switching variations provided by an embodiment of the present invention;
FIG. 3 is a first audio data distribution diagram provided by an embodiment of the invention;
FIG. 4 is a diagram of a second audio data distribution according to an embodiment of the present invention;
FIG. 5 is a waveform diagram of converted audio data provided by an embodiment of the invention;
FIG. 6 is a waveform diagram of FIG. 5 after a reconversion, according to an embodiment of the invention;
fig. 7 is a structural block diagram of an apparatus for processing audio data according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart illustrating steps of a method for processing audio data according to an embodiment of the present invention is shown, where the method specifically includes the following steps:
step 101, a target data frame is obtained, wherein the target data frame comprises the largest data frame in the data frames of the audio data to be converted.
When switching audio data, because the current and voltage are unstable, a pop noise is easily generated, and therefore, the audio data needs to be converted so that the converted audio data does not generate a pop noise.
There are multiple sources of audio data, such as telephony, media, navigation, voice recognition, etc. The audio data includes at least one data frame including a fade-in type data frame in which an audio data gain gradually becomes strong from weak and a fade-out type data frame in which an audio data gain gradually becomes weak from strong, wherein the gain is a degree of increase in voltage, current, or power, which is generally specified in decibel (dB) numbers.
When audio data conversion is performed, a target data frame is required to be acquired, wherein the target data frame comprises the largest data frame in the data frames of the audio data to be converted, and the target data frame is used for calculating the audio data in the subsequent steps.
In this embodiment of the present invention, the acquiring a target data frame includes:
storing the fade-in type data frame in the audio data to a fade-in data buffer area, and storing the fade-out type data frame in the audio data to a fade-out data buffer area;
determining a largest fade-in data frame from the fade-in data buffer, and determining a largest fade-out data frame from the fade-out data buffer;
and taking the maximum fade-in data frame and the maximum fade-out data frame as target data frames.
The types of audio data are classified into a fade-in audio type and a fade-out audio type, and the target data frame includes a largest fade-in data frame and a largest fade-out data frame, so that the audio data is classified into a fade-in data buffer and a fade-out data buffer, 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, the largest fade-in data frame is determined from the fade-in data buffer, and the largest fade-out data frame is determined from the fade-out data buffer, and the audio data occurs one data type at a time, and thus, there is one largest target data frame (amplitude _ max).
For example, when music starts to be played, fade-in play is performed, the largest target data frame acquired is a data frame of a fade-in type, and when music ends, fade-out play is performed, the largest target data frame acquired is a data frame of a fade-out type, and therefore, data frames at the same time are data frames of a fade-in type or data frames of a fade-out type.
And 102, calculating a standard line according to the target data frame.
The standard line is calculated according to a target data frame in the audio data and is used for distinguishing a reasonable data frame and an unreasonable data frame in the data frames.
In an embodiment of the present invention, the calculating a standard line according to the target data frame includes:
calculating a linear coefficient according to the target data frame;
and calculating the standard line according to the linear coefficient.
Specifically, the target data frame is calculated by using formula (1) to obtain a linear coefficient. Wherein, formula (1) is specifically as follows:
Kstandequation (1) for amplitude _ max/(buffer _ size/frame _ size)
In the formula (1), the linear coefficient K is calculated from the acquired target data frame (amplitude _ max), the audio data size (buffer _ size), and the quality size (frame _ size) of any one of the at least one data framestand
Further, a standard line is calculated according to the linear coefficient, because the type of the audio data is divided into a fade-in audio type and a fade-out audio type, the standard line is divided into a fade-in standard line function and a fade-out standard line function, and the fade-in standard line function is obtained by adopting a formula (2), wherein the formula (2) is specifically as follows:
Line1[index]=Kstandx index formula (2)
Obtaining a fade-out standard line function by adopting a formula (3), wherein the formula (3) is as follows:
Line2[index]=amplitude-Kstandx index formula (3)
And 103, acquiring unreasonable data frames outside the standard line in the audio data to be converted.
In order to prevent the occurrence of a pop sound during switching of audio data, it is necessary to determine audio data and convert abnormal audio data, and therefore, audio data that is located outside a standard line and needs to be converted is determined as an unreasonable data frame, and audio data that is located within the standard line and does not need to be converted is determined as first reasonable data.
For better understanding, referring to fig. 3, a waveform of audio data is put into a planar coordinate system, an X-axis is an index value (index) corresponding to at least one data frame, and a Y-axis is at least one data frame (amplitude); and turning the standard lines in a mirror way on a horizontal axis to obtain an area formed by the combination of the standard lines, referring to a dotted line part in fig. 3, judging a data frame positioned within the standard lines in at least one data frame as a first reasonable data frame amplitude _ new1[ index ], and judging a data frame positioned outside the standard lines as an unreasonable data frame.
And 104, converting the unreasonable data frame of each frame to obtain a reasonable data frame positioned within the standard line.
In order to prevent the occurrence of plosives during audio data switching, unreasonable data frames are converted to obtain reasonable data frames within the standard line.
In the embodiment of the present invention, the converting the unreasonable data frame of each frame to obtain a reasonable data frame located within a standard line includes:
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 frames of the audio data;
determining a data frame with a vertical coordinate larger than and/or equal to zero in the unreasonable data frames as a first unreasonable data frame, and determining a data frame with a vertical coordinate smaller than zero as a second unreasonable data frame;
determining a first gradient coefficient corresponding to each first unreasonable data frame and a second gradient coefficient corresponding to each second unreasonable data frame from each gradient coefficient;
converting the first unreasonable data frame according to the first gradient coefficient to obtain a first converted data frame, and converting the second unreasonable data frame according to the second gradient coefficient to obtain a second converted data frame;
and taking the first conversion data frame and the second conversion data frame as the reasonable data frame.
In this embodiment of the present invention, the determining, based on the size of the audio data and the quality size of each of the data frames of the audio data, a gradient coefficient corresponding to each of the data frames includes:
calculating 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;
and calculating the respective corresponding gradient coefficients of the at least one data frame according to the stepping values.
The step value is a value calculated according to the size of the audio data and the quality size of any data frame in at least one data frame, because the quality sizes of any data frame are the same, the step value of the current audio data is the same, and the gradient coefficient is a change value of an index value of the current data frame in the audio data relative to the step value.
Specifically, the size of the audio data and the quality size of any data frame in at least one data frame are calculated by adopting a formula (4) to obtain a step value. Wherein, the formula (4) is specifically as follows:
step 1/(buffer _ size/frame _ size) ═ frame _ size/buffer _ size equation (4)
Further, since the types of the audio data are divided into a fade-in audio type and a fade-out audio type, the fade coefficient is divided into a fade-in fade coefficient and a fade-out fade coefficient, and the fade-in fade coefficient is obtained by using formula (5), where formula (5) is specifically as follows:
k1[ index ] ═ step × index formula (5)
Obtaining a fade-out gradient coefficient by adopting a formula (6), wherein the formula (6) is as follows:
k2[ index ] ═ 1-step × index formula (6)
In addition, since the audio data conversion methods are different under different conditions, it is necessary to distinguish the unreasonable data frames, and among the unreasonable data frames, a data frame whose ordinate is greater than and/or equal to zero is determined as a first unreasonable data frame, and a data frame whose ordinate is less than zero is determined as a second unreasonable data frame, see fig. 4.
And because the audio data of the first unreasonable data frame is different from the audio data of the second unreasonable data frame, and the method of the subsequent conversion is different, the corresponding gradient coefficients need to be obtained, namely, the first gradient coefficient corresponding to the first unreasonable data is obtained from each gradient system, and the second gradient coefficient corresponding to the second unreasonable data frame is obtained.
When the unreasonable data frames in the audio data are converted, the first unreasonable data frames can be converted according to the first gradient coefficient to obtain first converted data frames, and the second unreasonable data frames can be converted according to the second gradient coefficient to obtain second converted data frames.
Specifically, the first irrational data frame amplitude _ old1[ index ] is converted by using formula (7), a first gradient coefficient k1[ index ] and a standard line function line [ index ], so as to obtain a first converted data frame amplitude _ change1[ index ]. Wherein, the formula (7) is specifically as follows:
amplitude_change1[index]=
(amplitude _ old1[ index ] -line [ index ] + amplitude _ max) x k1[ index ] formula (7)
Wherein, the standard line function line [ index ] is a fade-in standard line function line1[ index ] when the target data frame is the largest fade-in data frame, and the standard line function line [ index ] is a fade-out standard line function line2[ index ] when the target data frame is the largest fade-out data frame.
And converting the second unreasonable data frame amplitude _ old2[ index ] by adopting the formula (8), a second gradient coefficient k2[ index ] and a standard line function line [ index ] to obtain a second converted data frame amplitude _ change2[ index ]. Wherein, the formula (8) is specifically as follows:
amplitude_change2[index]=
(amplitude _ old2[ index ] + line [ index ] -amplitude _ max) x k2[ index ] formula (8)
Wherein, when the target data frame is the maximum 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 maximum fade-out data frame, the standard line function line [ index ] is the fade-out standard line function line2[ index ].
It should be noted that the same parameters in formula (7) and formula (8) are expressed by the same meaning, and 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, 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), the second unreasonable data frame and the second gradient coefficient are substituted into formula (8), the brackets in formula (7) adopt the operation of first "-" then "+", the brackets in formula (8) adopt the operation of first "+" then "-", this is because the first unreasonable data frame acquires data having positive values and the second unreasonable data frame acquires data having negative values, and therefore, the "-" and "+" in the formula need to be replaced.
The converted first converted data frame and the converted second converted data frame are both data frames located within the standard line, and therefore, the first converted data frame and the second converted data frame are taken as the second reasonable data frame.
For example, if the audio data a belongs to an unreasonable data frame, it is determined whether the ordinate of the audio data a is greater than or equal to zero or less than zero, if so, the corresponding gradient coefficient is calculated according to the index value of the audio data a on the abscissa, then the ordinate data of the audio data a and the corresponding gradient coefficient are substituted into a preset first conversion method for conversion to obtain a corresponding reasonable first conversion data frame, if the audio data a is less than zero, the corresponding gradient coefficient is calculated according to the index value of the audio data a on the abscissa, then the ordinate data of the audio data a and the corresponding gradient coefficient are substituted into a preset second conversion method for conversion to obtain a corresponding reasonable second conversion data frame, then the first conversion data frame and the second conversion data frame are used as a second reasonable data frame, and the audio data a output in this way is within the standard line, and then the first reasonable data frame and the second reasonable data frame are used as the converted audio data.
In the embodiment of the present invention, after converting the unreasonable data frame of each frame to obtain a reasonable data frame located within the standard line, the method further includes:
and outputting the converted audio data, wherein the converted audio data comprises reasonable data frames in the audio data to be converted and reasonable data frames which are converted from the unreasonable data frames and are positioned within the standard line.
Specifically, the rational data frames in the audio data and the converted rational data frames may be output together as the converted audio data.
Referring to fig. 5, the range formed by the two straight lines is the amplitude range after the traditional fade-in sound effect processing is used, and the range formed by the waveform is the amplitude range after the processing of the embodiment of the present invention.
Fig. 6 is a waveform diagram obtained by processing the waveform diagram shown in fig. 5 again, where the range formed by two curves is the amplitude range after the traditional fade-in sound effect processing is used, and the range formed by the waveform is the amplitude range after the processing of the embodiment of the present invention, because the waveform is output after the fade-in processing, there is no plosive problem, so that it is not necessary to transform the waveform again.
In the embodiment of the invention, a target data frame is obtained, 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; acquiring unreasonable data frames outside the standard line in the audio data to be converted; and converting each frame of unreasonable data frames to obtain reasonable data frames within the standard line. The embodiment of the 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, the audio data is dynamically identified, unreasonable data frames outside the standard line are obtained, conversion is not needed within the standard line, the audio data can be directly output, the purpose of reducing the audio amplitude attenuation as far as possible is realized, the unreasonable data frames are outside the standard line, and reasonable data frames within the standard line can be obtained after conversion, therefore, the reasonable data frames are all within the standard line, the occurrence of the plosive is avoided, and the method is a more excellent self-adaptive processing method.
It should be noted that for simplicity of description, the method embodiments are shown as a series of combinations of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 7, a block diagram of a structure of an audio data processing apparatus according to an embodiment of the present invention is shown, which may specifically include the following modules:
an obtaining module 201, configured to obtain a target data frame, where the target data frame includes a largest data frame in data frames of audio data to be converted;
a calculating module 202, configured to calculate a standard line according to the target data frame;
an unreasonable data frame acquisition module 203, configured to acquire an unreasonable data frame outside the standard line in the audio data to be converted;
and the conversion module 204 is configured to convert the unreasonable data frame of each frame to obtain a reasonable data frame located within the standard line.
In an embodiment of the present invention, the data frames of the audio data include fade-in type data frames and fade-out type data frames, and the target data frame includes a largest fade-in data frame and a largest fade-out data frame;
the acquisition module includes: the type confirming submodule is used for storing the fade-in type data frame in the audio data into a fade-in data buffer area and storing the fade-out type data frame in the audio data into a fade-out data buffer area;
a data confirmation submodule for determining a largest fade-in data frame from the fade-in data buffer and determining a largest fade-out data frame from the fade-out data buffer; and taking the maximum fade-in data frame and the maximum fade-out data frame as target data frames.
In an embodiment of the present invention, the calculation module includes:
the first calculation module submodule is used for calculating a linear coefficient according to the target data frame;
and the second calculation module submodule is used for calculating the standard line according to the linear coefficient.
In the embodiment of the present invention, the conversion module includes:
the coefficient calculation sub-module is 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 frames of the audio data;
the judgment submodule is used for determining that a data frame with a vertical coordinate larger than and/or equal to zero in the unreasonable data frames is a first unreasonable data frame, and a data frame with a vertical coordinate smaller than zero is a second unreasonable data frame;
a coefficient determining submodule for determining 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 from among the respective gradient coefficients;
the data conversion sub-module is used for converting the first unreasonable data frame according to the first gradient coefficient to obtain a first converted data frame and converting the second unreasonable data frame according to the second gradient coefficient to obtain a second converted data frame;
an output sub-module configured to use the first converted data frame and the second converted data frame as the reasonable data frame.
In an embodiment of the present invention, the coefficient calculation sub-module includes:
the first calculating unit is used for calculating a stepping value according to the size of the audio data and the quality of each data frame in the data frames of the audio data;
and the second calculating unit is used for calculating the gradient coefficient corresponding to each data frame according to the stepping value.
In the embodiment of the present invention, after the converting module, the method further includes:
and the output module is used for outputting the converted audio data, and the converted audio data comprises a reasonable data frame in the audio data to be converted and a reasonable data frame which is converted from the unreasonable data frame and is positioned within the standard line.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The foregoing describes in detail a method and apparatus for processing audio data according to the present invention, and specific examples are used herein to explain the principles and embodiments of the present invention, and the descriptions of the foregoing examples are only provided to help understand the method and core ideas of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, 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 invention.

Claims (10)

1. A method of processing audio data, the method comprising:
acquiring 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;
acquiring unreasonable data frames outside the standard line in the audio data to be converted;
and converting the unreasonable data frame of each frame to obtain a reasonable data frame positioned within the standard line.
2. The processing method according to claim 1, wherein 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 largest fade-in data frame and a largest fade-out data frame;
the acquiring the target data frame includes:
storing the fade-in type data frame in the audio data to a fade-in data buffer area, and storing the fade-out type data frame in the audio data to a fade-out data buffer area;
determining a largest fade-in data frame from the fade-in data buffer, and determining a largest fade-out data frame from the fade-out data buffer;
and taking the maximum fade-in data frame and the maximum fade-out data frame as target data frames.
3. The processing method according to claim 1, wherein said calculating a standard line from the target data frame comprises:
calculating a linear coefficient according to the target data frame;
and calculating the standard line according to the linear coefficient.
4. The processing method according to claim 1, wherein said converting each frame of said unreasonable data frames to obtain reasonable data frames within a standard line comprises:
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 frames of the audio data;
determining a data frame with a vertical coordinate larger than and/or equal to zero in the unreasonable data frames as a first unreasonable data frame, and determining a data frame with a vertical coordinate smaller than zero as a second unreasonable data frame;
determining a first gradient coefficient corresponding to each first unreasonable data frame and a second gradient coefficient corresponding to each second unreasonable data frame from each gradient coefficient;
converting the first unreasonable data frame according to the first gradient coefficient to obtain a first converted data frame, and converting the second unreasonable data frame according to the second gradient coefficient to obtain a second converted data frame;
and taking the first conversion data frame and the second conversion data frame as the reasonable data frame.
5. The processing method according to claim 4, wherein the determining the fade coefficient corresponding to each of the data frames of the audio data based on the size of the audio data and the quality size of each of the data frames comprises:
calculating 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;
and calculating the respective corresponding gradient coefficients of the at least one data frame according to the stepping values.
6. The processing method according to any of claims 1-5, wherein after converting the unreasonable data frames for each frame to obtain reasonable data frames within the standard line, the method further comprises:
and outputting the converted audio data, wherein the converted audio data comprises reasonable data frames in the audio data to be converted and reasonable data frames which are converted from the unreasonable data frames and are positioned within the standard line.
7. An apparatus for processing audio data, the apparatus comprising:
the device comprises an acquisition module, a conversion module and a conversion module, wherein the acquisition module is used for acquiring a target data frame which comprises the largest data frame in the data frames of the audio data to be converted;
the calculation module is used for calculating a standard line according to the target data frame;
an unreasonable data frame acquisition module, configured to acquire an unreasonable data frame outside the standard line in the audio data to be converted;
and the conversion module is used for converting the unreasonable data frame of each frame to obtain a reasonable data frame positioned within the standard line.
8. The processing apparatus according to claim 7, wherein 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 largest fade-in data frame and a largest fade-out data frame;
the acquisition module includes: the type confirming submodule is used for storing the fade-in type data frame in the audio data into a fade-in data buffer area and storing the fade-out type data frame in the audio data into a fade-out data buffer area;
a data confirmation submodule for determining a largest fade-in data frame from the fade-in data buffer and determining a largest fade-out data frame from the fade-out data buffer; and taking the maximum fade-in data frame and the maximum fade-out data frame as target data frames.
9. An electronic device, comprising: processor, memory and computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the method of processing audio data according to any one of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of processing audio data according to any one of claims 1 to 6.
CN202210255147.XA 2022-03-15 2022-03-15 Audio data processing method and device Pending CN114727195A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210255147.XA CN114727195A (en) 2022-03-15 2022-03-15 Audio data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210255147.XA CN114727195A (en) 2022-03-15 2022-03-15 Audio data processing method and device

Publications (1)

Publication Number Publication Date
CN114727195A true CN114727195A (en) 2022-07-08

Family

ID=82238602

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210255147.XA Pending CN114727195A (en) 2022-03-15 2022-03-15 Audio data processing method and device

Country Status (1)

Country Link
CN (1) CN114727195A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030031335A1 (en) * 2001-08-08 2003-02-13 Hans-Ueli Roeck Method for processing an input signal to generate an output signal, and application of said method in hearing aids and listening devices
CN110058837A (en) * 2019-04-22 2019-07-26 维沃移动通信有限公司 A kind of audio-frequency inputting method and terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030031335A1 (en) * 2001-08-08 2003-02-13 Hans-Ueli Roeck Method for processing an input signal to generate an output signal, and application of said method in hearing aids and listening devices
CN110058837A (en) * 2019-04-22 2019-07-26 维沃移动通信有限公司 A kind of audio-frequency inputting method and terminal

Similar Documents

Publication Publication Date Title
KR101503541B1 (en) System and method for digital signal processing
CN104685563B (en) The audio signal shaping of playback in making an uproar for noisy environment
EP1947903B1 (en) Bass enhancing apparatus and method
RU2595912C2 (en) Audio system and method therefor
US8386242B2 (en) Method, medium and apparatus enhancing a bass signal using an auditory property
JP3505085B2 (en) Audio equipment
JPH1070796A (en) Stereophonic sound processor
CN111970628B (en) Audio signal enhancement method, device, storage medium and processor
JP2006222867A (en) Acoustic signal processing device and method thereof
CN1805278A (en) Method and apparatus to record a signal using a beam forming algorithm
CN113170260B (en) Audio processing method and device, storage medium and electronic equipment
JP4983694B2 (en) Audio playback device
CN1929698B (en) Sound reproduction apparatus and method of enhancing low frequency component
US20140067384A1 (en) Method and apparatus for canceling vocal signal from audio signal
CN101422054B (en) Sound image localization apparatus
CN114727195A (en) Audio data processing method and device
JP2008072600A (en) Acoustic signal processing apparatus, acoustic signal processing program, and acoustic signal processing method
EP0779764A2 (en) Apparatus for enhancing stereo effect with central sound image maintenance circuit
EP2370971B1 (en) An audio equipment and a signal processing method thereof
US20050152554A1 (en) Method and apparatus for processing audio signals
JP2010032599A (en) Voice processing apparatus and program
CN112669872B (en) Audio data gain method and device
CN117292698B (en) Processing method and device for vehicle-mounted audio data and electronic equipment
JP2012027101A (en) Sound playback apparatus, sound playback method, program, and recording medium
JP6314803B2 (en) Signal processing apparatus, signal processing method, and program

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