Audio processing method and device, electronic equipment and storage medium
Through audio processing methods, frame processing and feature extraction, the sound effects of important sounds in shooting games are enhanced, which solves the problem of important sounds being masked, improves sound clarity without increasing device power consumption, and improves User experience.
Patent Information
- Application Number
- CN202411020508.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-10-08
AI Technical Summary
In shooting games, important sounds such as gunshots and footsteps are often masked by background sounds, causing users to increase the volume of their electronic devices to obtain clearer sounds, but this increases power consumption and causes the device to heat up or freeze. Affect user experience.
Through the audio processing method, the audio to be processed is processed in frames, the feature vector of the audio frame is extracted, the audio type is determined, and the sound effect is enhanced for the target audio type to achieve sound enhancement without increasing the volume, thereby reducing device power consumption and potential Hot card problem.
Enhance the sound of the target audio type without increasing the volume, reduce the power consumption and heat card risk of electronic devices, and improve the user experience.
Smart Images

Figure CN118748022A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing, and in particular, to an audio processing method, device, electronic device and storage medium. Background Art
[0002] In most programs that run on electronic devices such as mobile phones and tablets, audio is a relatively important element. Take shooting games as an example. Sounds such as gunshots and footsteps in shooting games are usually relatively important information. Users can make judgments about the current situation of the game based on these sounds. Therefore, these sounds have a greater impact on the outcome of the game and the user's experience.
[0003] Currently, when users play the above-mentioned shooting games, important sounds such as gunshots and footsteps are often relatively quiet or covered by background sounds. At this time, users usually choose to increase the playback volume of electronic devices to make the important sounds clearer.
[0004] However, increasing the playback volume of an electronic device will increase the power consumption of the electronic device and may even cause the electronic device to become hot or freeze, resulting in a poor user experience. Summary of the invention
[0005] In view of this, embodiments of the present application provide an audio processing method, device, electronic device and storage medium to at least partially solve the above problems.
[0006] According to the first aspect of the embodiment of the present application, there is provided an audio processing method, characterized in that it includes: obtaining audio to be processed; performing frame processing on the audio to be processed to obtain multiple audio frames; performing feature extraction on the audio frame to obtain a feature vector of the audio frame; determining the audio type of the audio frame according to the feature vector of the audio frame; if the audio type of the audio frame is a target audio type, performing sound enhancement on the audio frame to obtain a processed audio frame corresponding to the audio frame; performing frame splicing processing on the processed audio frames corresponding to the multiple audio frames to obtain processed audio corresponding to the audio to be processed.
[0007] According to a second aspect of an embodiment of the present application, an audio processing device is provided, comprising: an acquisition unit, configured to acquire audio to be processed; a framing unit, configured to perform framing processing on the audio to be processed to obtain a plurality of audio frames; a feature unit, configured to perform feature extraction on the audio frame to obtain a feature vector of the audio frame; a determination unit, configured to determine an audio type of the audio frame according to the feature vector of the audio frame; an enhancement unit, configured to perform sound effect enhancement on the audio frame when the audio type of the audio frame is a target audio type to obtain a processed audio frame corresponding to the audio frame; and a splicing unit, configured to perform splicing processing on the processed audio frames corresponding to the plurality of audio frames to obtain processed audio corresponding to the audio to be processed.
[0008] According to the third aspect of an embodiment of the present application, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the method of the first aspect mentioned above.
[0009] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored, and the program is executed by a processor to perform the method of the first aspect.
[0010] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising computer instructions, wherein the computer instructions instruct a computing device to execute the method of the first aspect described above.
[0011] According to the audio processing scheme provided in the embodiment of the present application, the processed audio can be subjected to frame processing to obtain multiple audio frames, and then the feature vector of the audio frame can be obtained by feature extraction, and the audio type of the audio frame can be determined according to the feature vector of the audio frame. For the audio frame whose audio type is the target audio type, the audio frame is subjected to sound effect enhancement to obtain the processed audio frame corresponding to the audio frame, and then the processed audio frames corresponding to the multiple audio frames are subjected to frame splicing processing to obtain the processed audio corresponding to the processed audio. Thus, the processed audio in the present application is obtained by performing sound effect enhancement on the audio frame whose audio type is the target audio type in the processed audio, and then the sound of the audio frame corresponding to the target audio type can be made louder and clearer under the condition that the playback volume remains unchanged. Compared with obtaining the processed audio by increasing the playback volume of the audio to be processed, the present application can reduce the power consumption of the electronic device used to play the processed audio, and can also reduce the possibility of the electronic device getting hot or stuck, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0013] Figure 1 is a flow chart of an audio processing method according to an embodiment of the present application;
[0014] Figure 2 is a schematic diagram of a process for determining a feature vector according to an embodiment of the present application;
[0015] Figure 3 is a flowchart of a method for training an audio recognition model according to an embodiment of the present application;
[0016] Figure 4 is a structural diagram of an initial model of an embodiment of the present application;
[0017] Figure 5 is a schematic diagram of an audio processing device according to an embodiment of the present application;
[0018] Figure 6 It is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0019] First, some nouns or terms that appear in the process of describing the embodiments of the present application are subject to the following explanations.
[0020] Spectral centroid: It is the average point of the spectral energy distribution of the speech frame, representing the brightness of the speech. It is one of the important physical parameters for describing the timbre properties. It is the frequency obtained by energy-weighted averaging within a certain frequency range, and its unit is Hertz (Hz).
[0021] The second-order central moment of the spectrum: also known as spectrum spread, it describes the distribution of the signal around the center of the spectrum.
[0022] Mel-frequency cepstrum coefficients: In the field of sound processing, the Mel-frequency cepstrum is a linear transformation of the logarithmic energy spectrum based on the nonlinear Mel scale of the sound frequency. The Mel-frequency cepstrum takes into account the auditory characteristics of humans, first mapping the linear spectrum to the Mel-nonlinear spectrum based on auditory perception, and then converting it to the cepstrum.
[0023] Application environment of this application
[0024] The embodiment of the present application proposes a solution for audio processing. The entire audio processing solution is relatively universal and can be used to process the audio of a program while the program is running, such as for processing the audio in a game that uses an electronic device as a running carrier. The audio processing method can be executed by a data center, a server, a personal computer, an Internet of Things (IoT) device, an embedded device, etc. The audio processing solution is independent of the hardware deployed by the computing device that executes the solution.
[0025] Audio Processing Methods
[0026] Based on the above application environment, an embodiment of the present application provides an audio processing method, and the audio processing method is described in detail through multiple embodiments below.
[0027] Figure 1 FIG. 1 is a flow chart of an audio processing method according to an embodiment of the present application. Figure 1 As shown, the audio processing method comprises the following steps:
[0028] Step 101: Obtain audio to be processed.
[0029] The audio to be processed may be audio in a game that uses an electronic device as a running carrier, or audio in an audio or video such as a movie or a radio drama, etc., and this embodiment of the present application does not limit this.
[0030] Step 102: Perform frame processing on the audio to be processed to obtain multiple audio frames.
[0031] After obtaining the audio to be processed, the audio to be processed can be split into multiple audio frames, each audio frame having the same duration. Usually, the duration of a single audio frame is 10 to 30 milliseconds. The embodiment of the present application does not limit the duration of a single audio frame.
[0032] Step 103: extract features from the audio frame to obtain a feature vector of the audio frame.
[0033] For each audio frame in the above-mentioned multiple audio frames, the audio frame can be transmitted to the main link and the sub-link respectively. In the sub-link, feature extraction can be performed on the audio frame to obtain a feature vector of the audio frame.
[0034] Step 104: Determine the audio type of the audio frame according to the feature vector of the audio frame.
[0035] For each of the above-mentioned multiple audio frames, after obtaining the feature vector of the audio frame, the audio type of the audio frame can be determined from multiple preset audio types in the sub-link based on the feature vector of the audio frame through vector feature analysis or classification recognition model and other means.
[0036] In one example, taking the audio to be processed as the audio in the game as an example, multiple preset audio types may be gunshots, footsteps, and background sounds (including music sounds, surround sounds, etc. in the game). Based on this, the audio type of each audio frame can be determined among the three preset audio types of gunshots, footsteps, and background sounds.
[0037] In another example, taking the audio to be processed as the audio in the audio or video as an example, the multiple preset audio types can be dialogue sounds, music sounds, and different types of ambient sounds. Based on this, the audio type of each audio frame can be determined among the multiple preset audio types of dialogue sounds, music sounds, and different types of ambient sounds.
[0038] The preset audio type can be represented by the identifier of the preset audio type. Taking the audio to be processed as the audio in the game as an example, if the audio type of the audio frame is gunshot, then 1 can be output according to the feature vector of the audio frame. If the audio type of the audio frame is footsteps, then 2 can be output according to the feature vector of the audio frame. If the audio type of the audio frame is background sound, then 3 can be output according to the feature vector of the audio frame.
[0039] Step 105: If the audio type of the audio frame is the target audio type, the audio frame is enhanced to obtain a processed audio frame corresponding to the audio frame.
[0040] Among them, at least some of the multiple preset audio types are target audio types.
[0041] For each of the above-mentioned multiple audio frames, after determining the audio type of the audio frame in the sub-link, if the audio type of the audio frame is the target audio type, the audio frame input to the main link can be enhanced in the main link so that the main link outputs the processed audio frame corresponding to the audio frame.
[0042] In an example, taking the audio to be processed as the audio in the game as an example, based on the fact that gunshots and footsteps among the three preset audio types of gunshots, footsteps and background sounds are both target audio types, for each audio frame, if the audio type of the audio frame is footsteps or gunshots, the audio frame is enhanced to obtain a processed audio frame corresponding to the audio frame.
[0043] In another example, taking the audio to be processed as the audio in the audio and video as an example, based on the dialogue sound among multiple preset audio types including dialogue sound, music sound and different types of ambient sounds, the target audio type is the dialogue sound. For each audio frame, if the audio type of the audio frame is dialogue sound, the audio frame is enhanced to obtain a processed audio frame corresponding to the audio frame.
[0044] The above-mentioned audio enhancement can be achieved through sound effect debugging means such as DEQ (Dynamic EQ), EQ (Equalizer) and / or DRC (Dynamic range compression), which is not limited in the embodiments of the present application.
[0045] When the target audio type is not unique, for any two audio frames corresponding to different target audio types, the sound effect enhancement can be performed by the same sound effect enhancement module or by two independent sound effect enhancement modules, wherein the two independent sound effect enhancement modules can adopt the same sound effect debugging means or different sound effect debugging means, which is not limited to the embodiments of the present application.
[0046] Step 106: perform frame splicing processing on the processed audio frames corresponding to the multiple audio frames to obtain processed audio corresponding to the audio to be processed.
[0047] An audio frame whose audio type is the target audio type can be determined as a first audio frame, and an audio frame whose audio type is not the target audio type can be determined as a second audio frame. Based on this, the processed audio frame corresponding to the first audio frame in the multiple audio frames and the second audio frame in the multiple audio frames can be spliced in the time sequence of the multiple audio frames to obtain the processed audio.
[0048] In an embodiment of the present application, multiple audio frames can be obtained after the processed audio is subjected to frame processing, and then the feature vector of the audio frame can be obtained by feature extraction, and the audio type of the audio frame can be determined according to the feature vector of the audio frame. For the audio frame whose audio type is the target audio type, the audio frame is subjected to sound effect enhancement to obtain the processed audio frame corresponding to the audio frame, and then the processed audio frames corresponding to the multiple audio frames are subjected to frame splicing processing to obtain the processed audio corresponding to the processed audio. Thus, the processed audio in the present application is obtained by performing sound effect enhancement on the audio frame whose audio type is the target audio type in the processed audio, and then, under the condition that the playback volume remains unchanged, the sound of the audio frame corresponding to the target audio type can be made louder and clearer. Compared with obtaining the processed audio by increasing the playback volume of the audio to be processed, the present application can reduce the power consumption of the electronic device used to play the processed audio, and can also reduce the possibility of the electronic device getting hot or stuck, thereby improving the user experience.
[0049] In addition, the processed audio in the present application is obtained by performing sound effect enhancement on audio frames whose audio type is the target audio type in the processed audio. Compared with directly performing sound effect enhancement on the processed audio to obtain the processed audio, the processed audio in the present application can perform targeted identification on audio frames whose audio type is the target audio type and then align them for sound effect enhancement, thereby further highlighting audio frames whose audio type is the target audio type. For example, in the audio of shooting games, gunshots and footsteps are more prominent, so that users can make more correct judgments about the current situation of the game based on the gunshots and footsteps, thereby improving the user experience.
[0050] In a possible implementation, the above step 103 includes the following processing: Figure 2 As shown, Fourier transform is performed on the audio frame to obtain spectrum information corresponding to the audio frame; based on the spectrum information, a feature calculation result is determined, wherein the feature calculation result includes the spectrum centroid, the spectrum second-order central moment and the Mel Frequency Cepstrum Coefficient (MFCC) coefficient corresponding to the audio frame; based on the feature calculation result, a feature vector of the audio frame is determined.
[0051] The Fourier transform may be a fast Fourier transform (FFT) or a short-time Fourier transform (STFT), etc., which is not limited in the embodiments of the present application.
[0052] The spectrum information includes multiple spectrum data, based on which:
[0053] Spectral centroid C i and the second-order central moment S of the spectrum i The formulas are as follows:
[0054]
[0055] Where N is the number of spectrum data in the spectrum information, X i (k) is the kth spectrum data included in the spectrum information.
[0056] The MFCC coefficients are determined as follows:
[0057] The spectrum information including multiple spectrum data is passed through a set of Mel filters to obtain the Mel spectrum corresponding to each spectrum data. The formula for determining the Mel spectrum corresponding to the spectrum data according to the spectrum data is as follows:
[0058]
[0059] Where, f is any spectrum data, mel(f) is the Mel spectrum corresponding to the spectrum data f;
[0060] Then take the logarithm of each Mel spectrum, and perform inverse transform on the result obtained by taking the logarithm through Discrete Cosine Transform (DCT). At least part of the results obtained after DCT can be used as MFCC coefficients. For example, the spectrum information can include 13 spectrum data, and the second to 13th results obtained after DCT can be used as MFCC coefficients.
[0061] In an embodiment of the present application, in the process of extracting features from an audio frame to obtain a feature vector, the spectral centroid, the spectral second-order central moment and the MFCC coefficient are selected as the extracted features of the audio frame to obtain the feature vector of the audio frame. This can make the feature vector of the audio frame more comprehensive in displaying the characteristics of the audio frame, and thus make it more accurate in subsequently determining the audio type of the audio frame based on the feature vector, so that the processing of sound enhancement for the audio type being the target audio type is more accurate.
[0062] In a possible implementation, in the process of determining the feature vector of an audio frame based on feature calculation results, data normalization processing can be performed on the spectral centroid, the spectral second-order central moment, and the Mel-frequency cepstral coefficients to obtain a first eigenvalue corresponding to the spectral centroid, a second eigenvalue corresponding to the spectral second-order central moment, and a third eigenvalue corresponding to the Mel-frequency cepstral coefficients, and then a vector is generated whose vector elements include the first eigenvalue, the second eigenvalue, and the third eigenvalue, and the vector is determined as the feature vector of the audio frame.
[0063] For example, the first eigenvalue corresponding to the centroid of the spectrum of any audio frame is a, the second eigenvalue corresponding to the second-order central moment of the spectrum is b, and the third eigenvalues corresponding to multiple Mel-frequency cepstral coefficients are c, d, e, and f respectively. Then the eigenvector of the audio frame is (a, b, c, d, e, f).
[0064] In an embodiment of the present application, the feature vector of the audio frame is obtained by standardizing the spectral centroid, the second-order central moment of the spectrum and the Mel-frequency cepstral coefficients, so that the balance between different features of different audio frames can be improved, so that the audio type of the audio frame determined according to the feature vector of the audio frame is more accurate.
[0065] In a possible implementation, in the process of determining the audio type of the audio frame according to the feature vector of the audio frame, the feature vector of the audio frame may be input into an audio recognition model, and the audio type of the audio frame output by the audio recognition model may be obtained.
[0066] The audio recognition model may be a model for classification and recognition, such as a back propagation (BP) neural network model. The embodiment of the present application does not limit the specific audio recognition model, and the audio recognition model may be obtained through a machine learning training mechanism.
[0067] In an embodiment of the present application, the feature vector of the audio frame is input into an audio recognition model, and the audio recognition model can directly output the audio type of the audio frame. Compared with directly performing feature analysis on the feature vector, the efficiency of determining the audio type of the audio frame can be improved, and the sound effect of the audio frame with the target audio type can be enhanced in real time.
[0068] Figure 3 FIG. 1 is a flow chart of a method for training an audio recognition model according to an embodiment of the present application. Figure 3 As shown, the training method of the audio recognition model includes the following specific steps:
[0069] Step 301: Obtain an initial model.
[0070] Among them, Figure 4 The structural diagram of the initial model shown in FIG. 1 , the initial model includes an input layer, a hidden layer, an output layer, and a comparison layer connected in sequence.
[0071] Step 302: Acquire multiple training audio frames and the expected audio type corresponding to each training audio frame.
[0072] The expected audio type is any preset audio type among multiple preset audio types, and at least some of the multiple preset audio types are target audio types.
[0073] Step 303: extract features from each training audio frame to obtain a training feature vector corresponding to each training audio frame.
[0074] The specific processing of extracting features from training audio frames to obtain corresponding training feature vectors is similar to the specific processing of extracting features from audio frames to obtain corresponding feature vectors, and the embodiments of the present application will not be repeated here.
[0075] Step 304: Process the training feature vectors corresponding to the multiple training audio frames through the initial model, and adjust the parameters of the input layer, hidden layer and output layer according to the comparison result output by the comparison layer until the comparison result meets the preset conditions, and obtain the audio recognition model including the current input layer, hidden layer and output layer.
[0076] In one possible implementation, the input layer is used to receive training feature vectors corresponding to multiple training audio frames, the hidden layer is used to process the training feature vectors received by the input layer separately to obtain processing results corresponding to each training feature vector, the output layer is used to determine the training audio type corresponding to each training feature vector from multiple preset audio types based on the processing results corresponding to each training feature vector, and for each training feature vector, the comparison layer is used to compare the expected audio type corresponding to the training feature vector with the training audio type of the training feature vector.
[0077] In a specific embodiment, Figure 4 As shown, after obtaining multiple training feature vectors, the multiple training feature vectors can be input into the input layer in sequence. After the input layer receives any training feature vector, the input layer can start forward propagation, that is, the input layer transmits the training feature vector to the hidden layer, the hidden layer performs nonlinear transformation processing on the received training feature vector, and outputs the obtained processing result to the output layer. The output layer determines the probability value of the training feature vector corresponding to each preset audio type in multiple preset audio types according to the received processing result, and the preset audio type with the highest corresponding probability value can be the training audio type corresponding to the training feature vector, and then the probability value of the training feature vector corresponding to the training audio type is input to the comparison layer, and the comparison layer determines the training feature vector. The residual of the probability value of the feature vector and the expected probability value of the training feature vector, and determine whether the residual is less than a first preset threshold value. If the residual is less than the first preset threshold value, the comparison result of the comparison layer meets the preset conditions, and an audio recognition model including the current input layer, the current hidden layer and the current output layer is obtained. Otherwise, the comparison result of the comparison layer does not meet the preset conditions, and a back propagation process is performed, that is, an error signal is transmitted to the input layer, the hidden layer and the output layer in sequence according to the comparison result output by the comparison layer, so as to adjust the weights of the input layer, the hidden layer and the output layer and / or the above-mentioned first preset threshold value according to the error signal, until any training feature vector makes the comparison result of the comparison layer meet the preset conditions, and the trained audio recognition model can be obtained.
[0078] Among them, the specific value of the first preset threshold can be set according to actual needs, and the embodiment of the present application does not limit this.
[0079] In another specific embodiment, Figure 4As shown, after obtaining multiple training feature vectors, the multiple training feature vectors can be divided into multiple batches of training feature vectors, each batch of training feature vectors includes multiple training feature vectors, and then the first batch of training feature vectors is input into the input layer, and then the input layer can start forward propagation, that is, the input layer transmits the first batch of training feature vectors to the hidden layer, the hidden layer performs nonlinear transformation processing on the received training feature vectors, and outputs the obtained processing results to the output layer, the output layer determines the training audio type corresponding to the first batch of training feature vectors from multiple preset audio types according to the received processing results, and inputs the training audio type corresponding to each training feature vector in the first batch of training feature vectors to the comparison layer, the comparison layer compares the expected audio type of the training audio type and the corresponding training feature vector for each received training audio type, and obtains the expected audio type and the training audio type in the batch of training feature vectors. The proportion of the number of training feature vectors with consistent types, and then determine whether the proportion is equal to or greater than the second preset threshold value. If so, the comparison result of the comparison layer meets the preset conditions, and an audio recognition model including the current input layer, the current hidden layer and the current output layer is obtained. Otherwise, the comparison result of the comparison layer does not meet the preset conditions, and a back propagation process is performed, that is, an error signal is transmitted to the input layer, the hidden layer and the output layer in sequence according to the comparison result output by the comparison layer, so as to adjust the weights of the input layer, the hidden layer and the output layer and / or the above-mentioned second preset threshold value according to the error signal, and then the next batch of training feature vectors are input to the input layer. For each layer in the input layer, the hidden layer, the output layer and the comparison layer, the specific processing process of this layer for each batch of training feature vectors is similar, and the embodiments of the present application will not be repeated here, until any batch of training feature vectors makes the comparison result of the comparison layer meet the preset conditions, then the trained audio recognition model can be obtained.
[0080] Among them, the specific value of the second preset threshold can be set according to actual needs, and the embodiment of the present application does not limit this.
[0081] In the embodiment of the present application, in the process of training the initial model to obtain the audio recognition model, the initial model can be continuously trained by forward propagation and back propagation. In the back propagation process, the error signal can be back-propagated to the output layer, hidden layer and input layer layer by layer to adjust the parameters of the input layer, hidden layer and output layer. Therefore, the gradient search technology is used in the present application to minimize the error between the actual output value and the expected output value of the audio recognition model, thereby improving the recognition accuracy of the audio recognition model.
[0082] In a possible implementation manner, the audio processing method further includes the following specific processing: if the audio type of the audio frame is not the target audio type, determining the audio frame as a processed audio frame.
[0083] For each of the above-mentioned multiple audio frames, after determining the audio type of the audio frame in the sub-link, if the audio type of the audio frame is not the target audio type, the audio frame input to the main link can be determined as a processed audio frame in the main link.
[0084] Based on this, in step 106, the processed audio frames corresponding to the multiple audio frames can be directly spliced according to the time sequence of the multiple audio frames to obtain the processed audio.
[0085] In an embodiment of the present application, by directly determining an audio frame whose audio type is not the target audio type as a processed audio frame, the processed audio frames corresponding to multiple audio frames can be directly spliced during the splicing process. Compared with the above-mentioned splicing process of processing the processed audio frames corresponding to the first audio frame among the multiple audio frames and the second audio frame among the multiple audio frames, the present application can improve the efficiency of obtaining the processed audio, and can also simplify the process of obtaining the processed audio, thereby improving the efficiency of obtaining the processed audio.
[0086] Audio processing device
[0087] Corresponding to the above method embodiment, Figure 5 A schematic diagram of an audio processing device according to an embodiment of the present application is shown. Figure 5 As shown, the audio processing device 500 includes:
[0088] An acquisition unit 501 is used to acquire audio to be processed;
[0089] A framing unit 502, configured to perform framing processing on the audio to be processed to obtain multiple audio frames;
[0090] A feature unit 503 is used to extract features from the audio frame to obtain a feature vector of the audio frame;
[0091] A determination unit 504, configured to determine an audio type of the audio frame according to a feature vector of the audio frame;
[0092] The enhancement unit 505 is used to enhance the audio effect of the audio frame when the audio type of the audio frame is the target audio type, so as to obtain a processed audio frame corresponding to the audio frame;
[0093] The frame splicing unit 506 is used to perform frame splicing processing on the processed audio frames corresponding to the multiple audio frames to obtain processed audio corresponding to the audio to be processed.
[0094] In the embodiment of the present application, the acquisition unit 501 can acquire the audio to be processed, the framing unit 502 can obtain multiple audio frames after framing the audio to be processed, the feature unit 503 obtains the feature vector of the audio frame by feature extraction, the determination unit 504 determines the audio type of the audio frame according to the feature vector of the audio frame, the enhancement unit 505 performs sound effect enhancement on the audio frame for the audio type of the target audio type to obtain the processed audio frame corresponding to the audio frame, and the splicing unit 506 can perform splicing on the processed audio frames corresponding to the multiple audio frames to obtain the processed audio corresponding to the audio to be processed. Therefore, the processed audio in the present application is obtained by performing sound effect enhancement on the audio frame of the audio type of the target audio type in the audio to be processed, and then, under the condition that the playback volume remains unchanged, the sound of the audio frame corresponding to the target audio type can be made louder and clearer. Compared with obtaining the processed audio by increasing the playback volume of the audio to be processed, the present application can reduce the power consumption of the electronic device used to play the processed audio, and can also reduce the possibility of the electronic device getting hot or stuck, thereby improving the user experience.
[0095] It should be noted that the audio processing device of this embodiment is used to implement the corresponding audio processing method in the aforementioned method embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0096] Electronic devices
[0097] Figure 6 This is a schematic block diagram of an electronic device provided in an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device. Figure 6 As shown, the electronic device may include: a processor (processor) 602, a communication interface (Communications Interface) 604, a memory (memory) 606, and a communication bus 608. Among them:
[0098] The processor 602 , the communication interface 604 , and the memory 606 communicate with each other via a communication bus 608 .
[0099] The communication interface 604 is used to communicate with other electronic devices or servers.
[0100] The processor 602 is used to execute the program 610, and specifically can execute the relevant steps in any of the aforementioned audio processing method embodiments.
[0101] Specifically, the program 610 may include program codes, which include computer operation instructions.
[0102] The processor 602 may be a CPU, or an application specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0103] RISC-V is an open source instruction set architecture based on the Reduced Instruction Set (RISC) principle. It can be applied to various aspects such as single-chip microcomputers and FPGA chips. Specifically, it can be applied to the fields of IoT security, industrial control, mobile phones, personal computers, etc., and because it is designed with small, fast, and low-power realities in mind, it is particularly suitable for modern computing devices such as warehouse-scale cloud computers, high-end mobile phones, and tiny embedded systems. With the rise of artificial intelligence Internet of Things (AIoT), the RISC-V instruction set architecture has also received more and more attention and support, and is expected to become the next generation of widely used CPU architecture.
[0104] The computer operation instructions in the embodiment of the present application may be computer operation instructions based on the RISC-V instruction set architecture, and correspondingly, the processor 602 may be designed based on the RISC-V instruction set. Specifically, the chip of the processor in the electronic device provided in the embodiment of the present application may be a chip designed with the RISC-V instruction set, and the chip may execute executable code based on the configured instructions, thereby implementing the audio processing method in the above embodiment.
[0105] The memory 606 is used to store the program 610. The memory 606 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0106] The program 610 may be specifically used to enable the processor 602 to execute the audio processing method in any of the aforementioned embodiments.
[0107] The specific implementation of each step in program 610 can refer to the corresponding description of the corresponding steps and units in any of the above-mentioned audio processing method embodiments, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above-mentioned method embodiments, which will not be repeated here.
[0108] Through the electronic device of the embodiment of the present application, multiple audio frames can be obtained after the processed audio is processed by frame processing, and then the feature vector of the audio frame can be obtained by feature extraction, and the audio type of the audio frame can be determined according to the feature vector of the audio frame. For the audio frame whose audio type is the target audio type, the audio frame is enhanced with sound effects to obtain the processed audio frame corresponding to the audio frame, and then the processed audio frames corresponding to the multiple audio frames are spliced to obtain the processed audio corresponding to the processed audio. Therefore, the processed audio in the present application is obtained by enhancing the sound effects of the audio frame whose audio type is the target audio type in the processed audio, and then the sound of the audio frame corresponding to the target audio type can be made louder and clearer under the condition that the playback volume remains unchanged. Compared with obtaining the processed audio by increasing the playback volume of the audio to be processed, the present application can reduce the power consumption of the electronic device used to play the processed audio, and can also reduce the possibility of the electronic device getting hot or stuck, thereby improving the user experience.
[0109] Computer storage media
[0110] The present application also provides a computer-readable storage medium storing instructions for causing a machine to execute the audio processing method as described herein. Specifically, a system or device equipped with a storage medium may be provided, on which a software program code implementing the functions of any of the above-mentioned embodiments is stored, and a computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.
[0111] In this case, the program code read from the storage medium itself can implement the function of any one of the above embodiments, so the program code and the storage medium storing the program code constitute part of the present application.
[0112] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.
[0113] Computer program product
[0114] An embodiment of the present application also provides a computer program product, including computer instructions, which instruct a computing device to perform any corresponding operation in the above-mentioned multiple method embodiments.
[0115] It should be noted that the user-related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data used to train the model, data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0116] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0117] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a special-purpose processor or programmable or special-purpose hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown here, the execution of the code converts the general-purpose computer into a special-purpose computer for executing the method shown here.
[0118] It should be noted that the user-related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data used to train the model, data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0119] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for specific applications, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.
[0120] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.
Claims
1. An audio processing method, It is characterized in that include: Get the audio to be processed; Performing frame processing on the audio to be processed to obtain multiple audio frames; Performing feature extraction on the audio frame to obtain a feature vector of the audio frame; Determining the audio type of the audio frame according to the feature vector of the audio frame; If the audio type of the audio frame is the target audio type, then the audio frame is enhanced to obtain a processed audio frame corresponding to the audio frame; Perform frame splicing processing on the processed audio frames corresponding to the multiple audio frames to obtain processed audio corresponding to the audio to be processed.
2. The method according to claim 1, It is characterized in that The extracting features of the audio frame to obtain a feature vector of the audio frame includes: Performing Fourier transform on the audio frame to obtain frequency spectrum information corresponding to the audio frame; Determine a feature calculation result according to the spectrum information, wherein the feature calculation result includes a spectrum centroid, a spectrum second-order central moment, and a Mel-frequency cepstrum coefficient corresponding to the audio frame; A feature vector of the audio frame is determined according to the feature calculation result.
3. The method according to claim 2, It is characterized in that Determining a feature vector of the audio frame according to the feature calculation result includes: Performing data normalization processing on the spectrum centroid, the spectrum second-order central moment and the Mel-frequency cepstrum coefficient to obtain a first eigenvalue corresponding to the spectrum centroid, a second eigenvalue corresponding to the spectrum second-order central moment and a third eigenvalue corresponding to the Mel-frequency cepstrum coefficient; A vector is generated, the vector elements of which include the first eigenvalue, the second eigenvalue, and the third eigenvalue, and the vector is determined as a feature vector of the audio frame.
4. The method according to claim 1, It is characterized in that The step of determining the audio type of the audio frame according to the feature vector of the audio frame includes: Inputting the feature vector of the audio frame into an audio recognition model; Obtain the audio type of the audio frame output by the audio recognition model.
5. The method according to claim 4, It is characterized in that The training method of the audio recognition model includes: Acquire an initial model, wherein the initial model includes an input layer, a hidden layer, an output layer, and a comparison layer; Acquire multiple training audio frames and expected audio types corresponding to each of the training audio frames, wherein the expected audio type is any one of multiple preset audio types, and at least some of the multiple preset audio types are target audio types; Performing feature extraction on each of the training audio frames to obtain a training feature vector corresponding to each of the training audio frames; The training feature vectors corresponding to the multiple training audio frames are processed by the initial model, and the parameters of the input layer, hidden layer and output layer are adjusted according to the comparison result output by the comparison layer until the comparison result meets the preset conditions, thereby obtaining the audio recognition model including the current input layer, hidden layer and output layer.
6. The method according to claim 5, It is characterized in that The input layer is used to receive training feature vectors corresponding to the multiple training audio frames, the hidden layer is used to process the training feature vectors received by the input layer respectively to obtain processing results corresponding to each of the training feature vectors, the output layer is used to determine the training audio type corresponding to each of the training feature vectors from the multiple preset audio types according to the processing results corresponding to each of the training feature vectors, and the comparison layer is used to compare the expected audio type corresponding to each of the training feature vectors with the training audio type.
7. The method according to claim 1, It is characterized in that The method further comprises: If the audio type of the audio frame is not the target audio type, the audio frame is determined as a processed audio frame.
8. An audio processing device, include: An acquisition unit, used for acquiring audio to be processed; A framing unit, used to perform frame processing on the audio to be processed to obtain multiple audio frames; A feature unit, used to extract features from the audio frame to obtain a feature vector of the audio frame; a determining unit, configured to determine an audio type of the audio frame according to a feature vector of the audio frame; an enhancing unit, configured to, when the audio type of the audio frame is a target audio type, perform sound effect enhancement on the audio frame to obtain a processed audio frame corresponding to the audio frame; The frame splicing unit is used to perform frame splicing processing on the processed audio frames corresponding to the multiple audio frames to obtain the processed audio corresponding to the audio to be processed.
9. An electronic device, include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the audio processing method according to any one of claims 1 to 7.
10. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the audio processing method according to any one of claims 1 to 7 is implemented.
11. A computer program product, comprising computer instructions, wherein the computer instructions instruct a computing device to execute the audio processing method according to any one of claims 1 to 7.
Citation Information
Cited By
Audio processing method, audio processing device and electronic equipment
CN120600050A
Audio processing method, audio processing apparatus, and electronic device
CN120600050B
