Audio processing method, device, electronic device and storage medium
By classifying audio signals to be processed and determining the target encoding rate, the problem in the prior art is solved that it is difficult to reduce the audio encoding stream transmission bandwidth while ensuring the audio encoding quality, and more efficient audio encoding processing is achieved.
Patent Information
- Application Number
- CN202210887729.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-26
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2042-07-26
AI Technical Summary
While ensuring the quality of audio encoding, the prior art is difficult to effectively reduce the bandwidth required for audio encoding code streaming.
By audio classification of the audio signal to be processed, the target audio category is determined, and the target encoding code rate is determined based on the correspondence between the audio category and the preset encoding code rate range. This target encoding rate is used to perform audio encoding processing on the audio signal to be processed, so that different types of audio are encoded using different encoding rates.
While ensuring the audio encoding quality, the audio encoding coding rate is effectively reduced, thereby reducing the bandwidth required for audio encoding code streaming.
Smart Images

Figure CN115410586B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an audio processing method, device, electronic device and storage medium. Background Art
[0002] Audio coding refers to the process of compressing audio signals using coding technology during audio transmission. Its purpose is to reduce the transmission bandwidth requirements of audio streaming media and the storage size of audio files. The transmission bandwidth and audio coding quality of audio streaming media are closely related to the audio coding bit rate. Generally, the higher the audio coding bit rate, the higher the audio coding quality, and the larger the bandwidth required for the audio coding stream during transmission. However, when the audio coding bit rate reaches a certain threshold, the audio coding quality reaches its peak, and the bandwidth required for transmission continues to increase.
[0003] Therefore, a reliable and effective audio processing method is needed to reduce the bandwidth required for audio coding stream transmission as much as possible while ensuring the audio coding quality. Summary of the invention
[0004] The present disclosure provides an audio processing method, device, electronic device and storage medium to reduce the bandwidth required for audio coding stream transmission as much as possible while ensuring the audio coding quality. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, there is provided an audio processing method, including:
[0006] Acquire an audio signal to be processed, and perform audio classification on the audio signal to be processed to obtain a target audio category;
[0007] Determining a target preset encoding bit rate range corresponding to the target audio category based on a correspondence between the audio category and the preset encoding bit rate range;
[0008] Determining a rate coding coefficient of the audio signal to be processed based on the frequency spectrum data of the audio signal to be processed;
[0009] Based on the target preset encoding rate range and the rate coding coefficient, a target encoding rate corresponding to the audio signal to be processed is determined; the target encoding rate is used to perform audio encoding processing on the audio signal to be processed.
[0010] In an exemplary embodiment, performing audio classification on the audio signal to be processed to obtain a target audio category includes:
[0011] Extracting acoustic features of the audio signal to be processed based on the frequency spectrum data of the audio signal to be processed;
[0012] The acoustic features are input into an audio classification model to obtain a classification result output by the audio classification model; the classification result indicates a target audio category.
[0013] In an exemplary embodiment, the training method of the audio classification model includes:
[0014] Acquire a sample audio signal and corresponding annotation information; the annotation information indicates a reference audio category of the sample audio signal;
[0015] Extracting acoustic features of the sample audio signal based on the frequency spectrum data of the sample audio signal to obtain sample acoustic features;
[0016] Inputting the sample acoustic features into an initial audio classification model to perform audio classification, and obtaining a predicted classification result; the predicted classification result indicates the probability of belonging to the reference audio category;
[0017] Based on the difference between the predicted classification result and the labeled information, the model parameters of the initial audio classification model are adjusted until a preset training end condition is met to obtain the audio classification model.
[0018] In an exemplary embodiment, the rate coding coefficient includes an effective bandwidth coefficient; and determining the rate coding coefficient of the audio signal to be processed based on the spectrum data of the audio signal to be processed includes:
[0019] Determining the energy of each frequency band in the audio signal to be processed based on the frequency spectrum data of the audio signal to be processed;
[0020] Determining an effective bandwidth based on the energy of each frequency band;
[0021] Based on the effective bandwidth and the sampling frequency, an effective bandwidth coefficient is obtained.
[0022] In an exemplary embodiment, determining the effective bandwidth based on the energy of each frequency band includes:
[0023] Determining an energy threshold based on a maximum energy among the energies of the frequency bands;
[0024] Determine a target energy among the energies that is less than the energy threshold;
[0025] Determine a frequency band point of a frequency band corresponding to a minimum energy in the target energy;
[0026] An effective bandwidth is determined based on the frequency band points, the sampling frequency and the total number of frequency bands.
[0027] In an exemplary embodiment, the preset encoding bit rate range includes a preset encoding bit rate upper limit and a preset encoding bit rate lower limit; and determining the target encoding bit rate corresponding to the audio signal to be processed based on the target preset encoding bit rate range and the bit rate coding coefficient includes:
[0028] Obtaining a target encoding rate upper limit based on the product of the effective bandwidth coefficient and the target preset encoding rate upper limit, and obtaining a target encoding rate lower limit based on the product of the effective bandwidth coefficient and the target preset encoding rate lower limit;
[0029] Based on the target encoding rate range defined by the target encoding rate upper limit and the target encoding rate lower limit, a target encoding rate corresponding to the audio signal to be processed is determined.
[0030] In an exemplary embodiment, the rate coding coefficient further includes spectrum sparsity; and determining the rate coding coefficient of the audio signal to be processed based on the spectrum data of the audio signal to be processed further includes:
[0031] Performing weighted average processing on the energy corresponding to each of the frequency bands to obtain the spectrum centroid;
[0032] The spectrum sparsity is obtained based on the ratio of the spectrum centroid to the total number of frequency bands.
[0033] In an exemplary embodiment, determining the target encoding rate corresponding to the audio signal to be processed based on the target encoding rate range defined by the target encoding rate upper limit and the target encoding rate lower limit includes:
[0034] Determine a code rate difference between the target encoding code rate upper limit and the target encoding code rate lower limit;
[0035] Determine the product of the spectrum sparsity and the bit rate difference;
[0036] The target encoding rate corresponding to the audio data to be processed is determined according to the sum of the product and the lower limit of the target encoding rate.
[0037] According to a second aspect of an embodiment of the present disclosure, there is provided an audio processing device, including:
[0038] An audio classification unit is configured to obtain an audio signal to be processed, and perform audio classification on the audio signal to be processed to obtain a target audio category;
[0039] A coding bit rate range determining unit, configured to determine a target preset coding bit rate range corresponding to the target audio category based on a correspondence between the audio category and the preset coding bit rate range;
[0040] A rate coding coefficient determining unit, configured to determine a rate coding coefficient of the audio signal to be processed based on the spectrum data of the audio signal to be processed;
[0041] The target encoding rate determination unit is configured to determine the target encoding rate corresponding to the audio signal to be processed based on the target preset encoding rate range and the rate coding coefficient; the target encoding rate is used to perform audio encoding processing on the audio signal to be processed.
[0042] In an exemplary embodiment, the audio classification unit includes:
[0043] an acoustic feature extraction unit, configured to extract acoustic features of the audio signal to be processed based on the frequency spectrum data of the audio signal to be processed;
[0044] The classification unit is configured to input the acoustic features into an audio classification model to obtain a classification result output by the audio classification model; the classification result indicates a target audio category.
[0045] In an exemplary embodiment, the apparatus further comprises a training unit, wherein the training unit is configured to execute:
[0046] Acquire a sample audio signal and corresponding annotation information; the annotation information indicates a reference audio category of the sample audio signal;
[0047] Extracting acoustic features of the sample audio signal based on the frequency spectrum data of the sample audio signal to obtain sample acoustic features;
[0048] Inputting the sample acoustic features into an initial audio classification model to perform audio classification, and obtaining a predicted classification result; the predicted classification result indicates the probability of belonging to the reference audio category;
[0049] Based on the difference between the predicted classification result and the labeled information, the model parameters of the initial audio classification model are adjusted until a preset training end condition is met to obtain the audio classification model.
[0050] In an exemplary embodiment, the rate coding coefficient includes an effective bandwidth coefficient; and the rate coding coefficient determination unit includes:
[0051] a frequency band energy determination unit, configured to determine the energy of each frequency band in the audio signal to be processed based on the frequency spectrum data of the audio signal to be processed;
[0052] An effective bandwidth determination unit, configured to determine an effective bandwidth based on the energy of each frequency band;
[0053] The effective bandwidth coefficient determination unit is configured to obtain the effective bandwidth coefficient based on the effective bandwidth and the sampling frequency.
[0054] In an exemplary embodiment, the effective bandwidth determining unit includes:
[0055] an energy threshold determination unit, configured to determine an energy threshold based on a maximum energy among the energies of the frequency bands;
[0056] A target energy determination unit is configured to determine a target energy that is less than the energy threshold among the energies;
[0057] A frequency band point determination unit, configured to determine a frequency band point of a frequency band corresponding to a minimum energy in the target energy;
[0058] The effective bandwidth determination subunit is configured to determine the effective bandwidth based on the frequency band points, the sampling frequency and the total number of frequency bands.
[0059] In an exemplary embodiment, the preset encoding bit rate range includes a preset encoding bit rate upper limit and a preset encoding bit rate lower limit; the target encoding bit rate determination unit includes:
[0060] A coding rate limit determination unit is configured to obtain a target coding rate upper limit based on the product of the effective bandwidth coefficient and the target preset coding rate upper limit, and obtain a target coding rate lower limit based on the product of the effective bandwidth coefficient and the target preset coding rate lower limit;
[0061] The target encoding rate determination subunit is configured to determine the target encoding rate corresponding to the audio signal to be processed based on the target encoding rate range defined by the target encoding rate upper limit and the target encoding rate lower limit.
[0062] In an exemplary embodiment, the rate coding coefficient further includes spectrum sparsity; and the rate coding coefficient determination unit further includes:
[0063] A spectrum centroid determination unit is configured to perform weighted averaging processing on the energy corresponding to each of the frequency bands to obtain the spectrum centroid;
[0064] The spectrum sparsity determination unit is configured to obtain the spectrum sparsity based on the ratio of the spectrum centroid to the total number of frequency bands.
[0065] In an exemplary embodiment, the target encoding bit rate determination subunit includes:
[0066] A bit rate difference determination unit, configured to determine a bit rate difference between the target encoding bit rate upper limit and the target encoding bit rate lower limit;
[0067] A first calculation unit is configured to determine the product of the spectrum sparsity and the bit rate difference;
[0068] The second calculation unit is configured to determine the target encoding rate corresponding to the audio data to be processed according to the sum of the product and the lower limit of the target encoding rate.
[0069] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0070] processor;
[0071] a memory for storing instructions executable by the processor;
[0072] The processor is configured to execute the instructions to implement the audio processing method of the first aspect.
[0073] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the audio processing method of the first aspect described above.
[0074] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer program product, comprising a computer program / instructions, which implement the audio processing method of the first aspect when executed by a processor.
[0075] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0076] A target audio category is obtained by performing audio classification on an audio signal to be processed, and based on the correspondence between the audio category and the preset encoding rate range, a target preset encoding rate range corresponding to the target audio category is determined, and then a rate coding coefficient is determined based on the spectrum data of the audio signal to be processed, and a target encoding rate for audio encoding of the audio signal to be processed is determined based on the target preset encoding rate range and the rate coding coefficient, thereby achieving encoding of different types of audio at different encoding rates, while effectively ensuring the audio encoding quality, reducing the audio encoding rate as much as possible, thereby reducing the bandwidth required for audio encoding stream transmission.
[0077] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0079] Figure 1 The present invention is a flowchart of an audio processing method according to an exemplary embodiment.
[0080] Figure 2 The flowchart of another audio processing method is shown according to an exemplary embodiment.
[0081] Figure 3 is a structural block diagram of an audio processing device according to an exemplary embodiment;
[0082] Figure 4 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0083] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0084] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0085] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0086] When audio is encoded during audio transmission, the audio encoding bit rate generally needs to be limited due to the influence of transmission bandwidth and audio encoding quality. Under normal circumstances, the higher the audio encoding bit rate, the higher the audio quality that can be restored by the audio encoding stream, and the larger the bandwidth required during transmission. However, when the audio encoding bit rate reaches a certain threshold, the audio quality that can be restored by the audio encoding stream reaches its peak and can no longer be perceived by human hearing. Therefore, while ensuring that the audio quality perceived by humans remains unchanged, the bandwidth required for audio encoding stream transmission should be reduced as much as possible.
[0087] In the process of implementing the embodiments of the present disclosure, the inventors found that the same bit rate is used for encoding different types of audio in the related art, but the encoding bit rate thresholds corresponding to different types of audio (i.e., the audio quality that can be restored by audio encoding at a bit rate greater than the encoding bit rate can no longer be perceived by human hearing) are different. Taking the encoding of audio using AAC (Advanced Audio Coding) as an example, when the encoding bit rate of noise reaches 48kbps, the encoding bit rate of speech reaches 64kbps, and the encoding bit rate of music reaches 96kbps, as the encoding bit rate increases, the quality of noise, speech and music can no longer be perceived by human hearing. Therefore, using the same bit rate to encode different types of audio will cause a great waste of audio transmission bandwidth, and it is impossible to reduce the transmission bandwidth of the audio encoding code stream while ensuring the audio encoding quality.
[0088] In view of this, an embodiment of the present disclosure provides an audio processing method, which classifies an audio signal to be processed, and determines a target preset encoding rate range corresponding to a target audio category based on a correspondence between the audio category and the preset encoding rate range, and then determines a rate coding coefficient based on spectrum data of the audio signal to be processed, and determines a target encoding rate for audio encoding of the audio signal to be processed based on the target preset encoding rate range and the rate coding coefficient, thereby achieving encoding of different types of audio at different encoding rates, while ensuring the audio encoding quality, reducing the audio encoding rate as much as possible, thereby effectively reducing the bandwidth required for audio encoding stream transmission.
[0089] It should be noted that the audio processing method of the embodiment of the present disclosure can be applied to an audio processing device, and the audio processing device can be configured in an electronic device, and the electronic device can be a terminal or a server.
[0090] The terminal may be a smart phone, tablet computer, laptop computer, desktop computer, etc., but is not limited thereto. The server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or an edge computing node, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0091] Figure 1 is a flowchart of an audio processing method according to an exemplary embodiment. Figure 1 As shown, taking the audio processing method used in electronic equipment as an example, the method includes the following steps.
[0092] In step S101, an audio signal to be processed is obtained, and the audio signal to be processed is classified to obtain a target audio category.
[0093] Among them, the audio signal to be processed is an audio time-domain signal with a preset time length, and the preset time length can be set according to actual experience. For example, the preset time length T can be 3 seconds.
[0094] The target audio category can be any one of multiple preset audio categories. The multiple preset audio categories can include, for example, noise, speech, and music.
[0095] In a specific implementation, for the received input audio signal, the electronic device can truncate it according to the preset time length to obtain the audio signal to be processed, and then classify the audio signal to be processed to obtain the target audio category of the audio signal to be processed.
[0096] In an exemplary implementation manner, step S101 may include the following steps when implemented:
[0097] Based on the spectral data of the audio signal to be processed, extract the acoustic features of the audio signal to be processed;
[0098] Input the acoustic features into an audio classification model to obtain a classification result output by the audio classification model, where the classification result indicates the target audio category.
[0099] Specifically, the spectral data of the audio signal to be processed can be obtained by transforming the audio signal to be processed from the time domain to the frequency domain. Assume that the audio signal x with a preset time length T is represented as x(t), where t represents time and 0 < t ≤ T. Then, after short-time Fourier transform (STFT), the spectral data of x can be represented by the following formula (1):
[0100] X(n,k) = STFT(x(t)) (1)
[0101] Among them, n is the frame index, 0 < n ≤ N, N is the total number of frames; k is the frequency band point, 0 < k ≤ K, K is the total number of frequency bands; STFT(·) represents performing short-time Fourier transform processing, and the specific processing process can refer to the description in related technologies and will not be elaborated here.
[0102] Specifically, the acoustic features can be Mel Frequency Cepstral Coefficients (MFCC). Then, for the spectral data X(n,k) of the audio signal to be processed x, the Mel frequency cepstral coefficients Mel corresponding to each frame can be calculated by the following formula (2)x (n,p):
[0103] Mel x (n,p)=mfcc(X 16k (n,k)) (2)
[0104] Wherein, mfcc(·) represents the calculation of Mel frequency cepstrum coefficients, and the calculation process of MFCC can be referred to in the related art, which will not be described here; Fs represents the sampling frequency of the audio signal to be processed, for example, Fs can be 16k. ;
[0105] After obtaining the Mel-frequency cepstral coefficient corresponding to each frame, the Mel-frequency cepstral coefficient Mel(p) of the audio signal to be processed x is obtained by averaging the Mel-frequency cepstral coefficients corresponding to each frame. For example, the Mel-frequency cepstral coefficient Mel(p) of the audio signal to be processed x can be expressed as the following formula (3):
[0106] Mel(p)=ave(Mel x (n,p)) (3)
[0107] Where ave(·) represents the average calculation.
[0108] After obtaining the acoustic features of the audio signal to be processed, such as Mel(p), based on the above formulas (1) to (3), the Mel(p) is input into a pre-trained audio classification model for audio classification processing, thereby obtaining a classification result output by the audio classification model. The classification result indicates the target audio category to which the audio signal to be processed belongs, such as noise, speech, or music.
[0109] Among them, the audio classification model can be a neural network model, such as a convolutional neural network model, a deep neural network model, etc. The present disclosure does not specifically limit the type of neural network model. Any neural network model that can be trained to perform classification tasks can be used as the audio classification model of the embodiments of the present disclosure.
[0110] The above implementation method obtains acoustic features based on the spectrum data of the audio signal to be processed, and then performs audio classification on the acoustic features in combination with the audio classification model, so as to quickly and accurately determine the audio category of the audio signal to be processed, which is conducive to improving the efficiency of audio processing.
[0111] Based on this, in an exemplary embodiment, before performing audio classification based on the audio classification model, the method may further include training the audio classification model. The training process of the audio classification model may include the following steps:
[0112] Obtaining sample audio signals and corresponding annotation information;
[0113] Extracting acoustic features of the sample audio signal based on the frequency spectrum data of the sample audio signal to obtain sample acoustic features;
[0114] Inputting the sample acoustic features into an initial audio classification model to perform audio classification to obtain a predicted classification result; the predicted classification result indicates a probability of belonging to a reference audio category;
[0115] Based on the difference between the predicted classification result and the labeled information, the model parameters of the initial audio classification model are adjusted until a preset training end condition is met to obtain the audio classification model.
[0116] The annotation information corresponding to the sample audio signal indicates the reference audio category of the sample audio signal, which is the actual audio category of the sample audio signal and can be determined by manually analyzing the sample audio signal. Exemplarily, the reference audio category may include noise, speech, and music.
[0117] The frequency spectrum data of the sample audio signal can be calculated by referring to the aforementioned formula (1), and the sample acoustic features can be calculated by referring to the aforementioned formulas (2) to (3), which will not be described in detail here.
[0118] The initial audio classification model can be an initialized neural network model. When adjusting the model parameters of the initial audio classification model based on the difference between the predicted classification results and the labeled information, a preset loss function can be used to determine the loss value according to the difference between the predicted classification results and the labeled information, and then backpropagation is performed based on the loss value to adjust the model parameters of the initial audio classification model, and iterative training is continued based on the adjusted model parameters until the preset training end conditions are met to obtain the audio classification model.
[0119] The preset loss function may be a cross entropy loss function. The preset training end condition may be that the loss value reaches a preset loss threshold, or the number of iterations reaches a preset iteration number threshold, or the difference between the loss values of two adjacent iterations reaches a preset loss difference threshold.
[0120] The above-mentioned implementation method can train an audio classification model for classifying multiple audio categories through machine learning, so that the audio processing method of the disclosed embodiment has greater flexibility. When there are new audio categories, the audio classification model can be trained and updated through sample audio signals corresponding to the new audio categories to achieve classification processing of the new audio categories.
[0121] In step S103, based on the correspondence between the audio category and the preset encoding bit rate range, the target preset encoding bit rate range corresponding to the target audio category is determined.
[0122] The audio categories in the corresponding relationship include audio categories that can be identified by the audio classification model. The preset encoding bit rate range corresponding to each audio category can be set according to experience in actual applications.
[0123] Exemplarily, the preset encoding bit rate range corresponding to noise is 32-48 kbps, the preset encoding bit rate range corresponding to speech is 48-64 kbps, and the preset encoding bit rate range corresponding to music is 64-96 kbps.
[0124] After determining the target audio category of the audio signal to be processed, the target corresponding relationship hitting the target audio category can be searched in the corresponding relationship between the audio category and the preset encoding bit rate range, and then the preset encoding bit rate range in the target corresponding relationship is determined as the target preset encoding bit rate range.
[0125] In step S105, a rate coding coefficient of the audio signal to be processed is determined based on the frequency spectrum data of the audio signal to be processed.
[0126] In step S107, a target encoding rate corresponding to the audio signal to be processed is determined based on the target preset encoding rate range and the rate coding coefficient.
[0127] The target coding bit rate is used to perform audio coding processing on the audio signal to be processed. Exemplarily, the audio coding processing may use advanced audio coding to encode the audio signal to be processed.
[0128] Specifically, based on the bit rate coding coefficient, the target preset coding bit rate range can be adjusted to obtain a target coding bit rate range, and then the target coding bit rate is determined within the target coding bit rate range. This can minimize the target coding bit rate while ensuring the audio coding quality, thereby effectively reducing the bandwidth required for audio transmission.
[0129] In an exemplary embodiment, the bit rate coding coefficient may include an effective bandwidth coefficient, which represents the proportion of the effective frequency bandwidth in the audio signal to be processed. Generally, the audio coding bit rate is positively correlated with the effective frequency bandwidth, that is, the higher the effective audio bandwidth, the larger the audio coding bit rate.
[0130] Based on this, the above step S105 may include the following steps when implemented:
[0131] Based on the frequency spectrum data of the audio signal to be processed, the energy of each frequency band in the audio signal to be processed is determined.
[0132] Based on the energy of each frequency band, an effective bandwidth is determined.
[0133] Based on the effective bandwidth and the sampling frequency, an effective bandwidth coefficient is obtained.
[0134] Specifically, the frequency spectrum data of the audio signal to be processed can refer to the aforementioned formula (1).
[0135] For each frequency band point, the energy of each frequency band can be determined based on the absolute value of the Fourier transform corresponding to the frequency band point in each frame, and then the effective bandwidth (i.e., effective bandwidth width) can be determined based on the energy of each frequency band. Based on the ratio of the effective bandwidth width to half of the audio sampling frequency, the effective bandwidth coefficient, i.e., the effective bandwidth coefficient β, can be obtained. eb It can be expressed as the following formula (4):
[0136] β eb =EB / (Fs / 2) (4)
[0137] Wherein, EB represents the effective bandwidth; Fs represents the sampling frequency of the audio signal to be processed.
[0138] Exemplarily, the energy of each frequency band in the audio signal to be processed can be calculated by the following formula (5):
[0139] P(k)=20*log10(ave(abs(X(n,k)))) (5)
[0140] Wherein, P(k) represents the energy of the frequency band corresponding to the frequency band point k; abs(·) represents taking the absolute value; and ave(·) represents finding the average.
[0141] In the above-mentioned embodiment, the effective bandwidth coefficient of the audio signal to be processed can be accurately calculated through the energy of each frequency band in the audio signal to be processed.
[0142] In an exemplary embodiment, the determining of the effective bandwidth based on the energy of each frequency band may include:
[0143] Determining an energy threshold based on a maximum energy among the energies of the frequency bands;
[0144] Determine a target energy among the energies that is less than the energy threshold;
[0145] Determine a frequency band point of a frequency band corresponding to a minimum energy in the target energy;
[0146] An effective bandwidth is determined based on the frequency band points, the sampling frequency and the total number of frequency bands.
[0147] The energy threshold can be obtained based on the difference between the maximum energy and the preset energy value. The preset energy value can be set according to actual experience, for example, it can be 60dB. The energy threshold can be expressed as P max -60dB, the P max is the maximum energy among the energies corresponding to each frequency band, that is, Pmax =max(P(k)).
[0148] Then the frequency band point index_k of the frequency band corresponding to the minimum energy in the target energy can be expressed as the following formula (6):
[0149] index_k=min(where(P(k)<(P max -60dB))) (6)
[0150] Where(·) is used to return the indexes that meet the set conditions.
[0151] Furthermore, when determining the effective bandwidth based on the frequency band point corresponding to the minimum energy in the target energy, the sampling frequency and the total number of frequency bands, it can be calculated based on the following formula (7):
[0152] EB=min(index_k*Fs / fft_len,Fs / 2) (7)
[0153] Among them, EB is the effective bandwidth; index_k is the frequency band point of the frequency band corresponding to the minimum energy in the target energy; fft_len is the FFT (Fast Fourier transform) length; Fs is the audio sampling frequency.
[0154] In an exemplary embodiment, the preset encoding bit rate range includes a preset encoding bit rate upper limit and a preset encoding bit rate lower limit, and the target preset encoding bit rate range includes a target preset encoding bit rate upper limit and a target preset encoding bit rate lower limit, and then the above step S107, when determining the target encoding bit rate corresponding to the audio signal to be processed based on the target preset encoding bit rate range and the bit rate coding coefficient, may include:
[0155] Obtaining a target encoding rate upper limit based on the product of the effective bandwidth coefficient and the target preset encoding rate upper limit, and obtaining a target encoding rate lower limit based on the product of the effective bandwidth coefficient and the target preset encoding rate lower limit;
[0156] Based on the target encoding rate range defined by the target encoding rate upper limit and the target encoding rate lower limit, a target encoding rate corresponding to the audio signal to be processed is determined.
[0157] (B min ,B max ) represents the target preset encoding bit rate range, where B min Indicates the target preset encoding bit rate lower limit, B max Indicates the target preset encoding bit rate upper limit, then the target encoding bit rate upper limit It can be expressed as The target coding rate lower limit Bmin can be expressed as Bmin=βeb*Bmin, where βeb is the effective bandwidth coefficient.
[0158] Then, the target encoding bit rate can be based on the range Determine, for example, A bit rate is selected as the target encoding bit rate, so that the encoding bit rate can be reduced while ensuring the audio encoding quality, thereby reducing the audio transmission bandwidth.
[0159] In order to achieve better coding effects, in an exemplary embodiment, the bit rate coding coefficient also includes spectral sparsity, which can characterize the complexity of the audio. Spectral sparsity can also be referred to as spectral richness. Generally, spectral sparsity is positively correlated with the audio coding bit rate, that is, the greater the spectral sparsity, the greater the audio coding bit rate.
[0160] Based on this, when determining the rate coding coefficient of the audio signal to be processed based on the spectrum data of the audio signal to be processed, the above step S105 may further include:
[0161] Performing weighted average processing on the energy corresponding to each of the frequency bands to obtain the spectrum centroid;
[0162] The spectrum sparsity is obtained based on the ratio of the spectrum centroid to the total number of frequency bands.
[0163] The spectrum centroid is a feature used to measure the center of the spectrum. Generally, the larger the value of the spectrum centroid is, the more high-frequency components the audio signal has. In a specific implementation, the spectrum centroid can be calculated using the following formula (8):
[0164]
[0165] Wherein, C represents the centroid of the spectrum; |X(k)| represents the amplitude value of the frequency band corresponding to the frequency band point k, which can be obtained by averaging the amplitude values of the frequency band points corresponding to each frame; and K represents the total number of frequency bands.
[0166] Then, the spectral sparsity 95 It can be calculated by the following formula (9):
[0167] Sparsity 95 =C / K (9)
[0168] In the above implementation, the spectrum sparsity is determined by the spectrum centroid, thereby accurately representing the complexity of the audio signal.
[0169] Based on this, in the above step S107, when determining the target encoding rate corresponding to the to-be-processed audio signal based on the target preset encoding rate range and the rate coding coefficient, the target encoding rate can be determined based on a preset function, and the parameters in the preset function include the target encoding rate upper limit, the target encoding rate lower limit, and the spectrum sparsity, wherein the target encoding rate upper limit and the lower limit can be obtained by adjusting the target preset encoding rate upper limit and the lower limit based on the effective bandwidth coefficient, that is, when the rate coding coefficient includes the effective bandwidth coefficient and the spectrum sparsity, the target encoding rate can be expressed by the following formula (10):
[0170]
[0171] Among them, B min Indicates the target preset encoding bit rate lower limit, B max Indicates the target preset encoding bit rate upper limit, Sparsity 95 Indicates spectral sparsity, func() indicates a preset function, EB o Indicates the target encoding bit rate.
[0172] In an exemplary embodiment, the preset function may be a linear function. Then, based on the target encoding rate range defined by the target encoding rate upper limit and the target encoding rate lower limit, determining the target encoding rate corresponding to the audio signal to be processed may include:
[0173] Determine a code rate difference between the target encoding code rate upper limit and the target encoding code rate lower limit;
[0174] Determine the product of the spectrum sparsity and the bit rate difference;
[0175] The target encoding rate corresponding to the audio data to be processed is determined according to the sum of the product and the lower limit of the target encoding rate.
[0176] Specifically, the sum of the above product (ie, the product of the spectrum sparsity and the bit rate difference) and the lower limit of the target encoding bit rate may be used as the target encoding bit rate corresponding to the audio data to be processed.
[0177] In a specific implementation, the target encoding bit rate can be calculated by the following formula (11):
[0178]
[0179] The target encoding bit rate of the audio signal to be processed can be calculated quickly and accurately through the above linear function.
[0180] In order to better understand the technical solution of the embodiment of the present disclosure, Figure 2 The flowchart diagram of the audio processing method of the embodiment of the present invention is described.
[0181] like Figure 2 As shown, after the audio signal to be processed undergoes short-time Fourier transform, audio classification is performed based on the result of the short-time Fourier transform and the audio classification model, and the audio category to which the audio signal to be processed belongs, namely noise / speech / music, is output.
[0182] In addition, audio effective bandwidth detection and spectrum sparsity detection are further performed based on the results of short-time Fourier transform, and then the effective bandwidth coefficient and spectrum sparsity are obtained.
[0183] Finally, based on the preset coding rate range, effective bandwidth coefficient and spectrum sparsity corresponding to the audio classification result, code rate allocation is performed to obtain the target coding rate, and then the target coding rate can be used to perform audio coding on the audio signal to be processed.
[0184] Figure 3 is a block diagram of an audio processing device according to an exemplary embodiment. Figure 3 The audio processing device 300 includes an audio classification unit 310, a coding rate range determination unit 320, a rate coding coefficient determination unit 330 and a target coding rate determination unit 340, wherein:
[0185] The audio classification unit 310 is configured to obtain an audio signal to be processed, and perform audio classification on the audio signal to be processed to obtain a target audio category;
[0186] The encoding bit rate range determining unit 320 is configured to determine a target preset encoding bit rate range corresponding to the target audio category based on a correspondence between the audio category and the preset encoding bit rate range;
[0187] A rate coding coefficient determining unit 330 is configured to determine a rate coding coefficient of the audio signal to be processed based on the spectrum data of the audio signal to be processed;
[0188] The target encoding rate determination unit 340 is configured to determine the target encoding rate corresponding to the audio signal to be processed based on the target preset encoding rate range and the rate coding coefficient; the target encoding rate is used to perform audio encoding processing on the audio signal to be processed.
[0189] In an exemplary embodiment, the audio classification unit 310 includes:
[0190] an acoustic feature extraction unit, configured to extract acoustic features of the audio signal to be processed based on the frequency spectrum data of the audio signal to be processed;
[0191] The classification unit is configured to input the acoustic features into an audio classification model to obtain a classification result output by the audio classification model; the classification result indicates a target audio category.
[0192] In an exemplary embodiment, the apparatus further comprises a training unit, wherein the training unit is configured to execute:
[0193] Acquire a sample audio signal and corresponding annotation information; the annotation information indicates a reference audio category of the sample audio signal;
[0194] Extracting acoustic features of the sample audio signal based on the frequency spectrum data of the sample audio signal to obtain sample acoustic features;
[0195] Inputting the sample acoustic features into an initial audio classification model to perform audio classification, and obtaining a predicted classification result; the predicted classification result indicates the probability of belonging to the reference audio category;
[0196] Based on the difference between the predicted classification result and the labeled information, the model parameters of the initial audio classification model are adjusted until a preset training end condition is met to obtain the audio classification model.
[0197] In an exemplary embodiment, the rate coding coefficient includes an effective bandwidth coefficient; the rate coding coefficient determination unit 330 includes:
[0198] a frequency band energy determination unit, configured to determine the energy of each frequency band in the audio signal to be processed based on the frequency spectrum data of the audio signal to be processed;
[0199] An effective bandwidth determination unit, configured to determine an effective bandwidth based on the energy of each frequency band;
[0200] The effective bandwidth coefficient determination unit is configured to obtain the effective bandwidth coefficient based on the effective bandwidth and the sampling frequency.
[0201] In an exemplary embodiment, the effective bandwidth determining unit includes:
[0202] an energy threshold determination unit, configured to determine an energy threshold based on a maximum energy among the energies of the frequency bands;
[0203] A target energy determination unit is configured to determine a target energy that is less than the energy threshold among the energies;
[0204] A frequency band point determination unit, configured to determine a frequency band point of a frequency band corresponding to a minimum energy in the target energy;
[0205] The effective bandwidth determination subunit is configured to determine the effective bandwidth based on the frequency band points, the sampling frequency and the total number of frequency bands.
[0206] In an exemplary embodiment, the preset encoding bit rate range includes a preset encoding bit rate upper limit and a preset encoding bit rate lower limit; the target encoding bit rate determination unit 340 includes:
[0207] A coding rate limit determination unit is configured to obtain a target coding rate upper limit based on the product of the effective bandwidth coefficient and the target preset coding rate upper limit, and obtain a target coding rate lower limit based on the product of the effective bandwidth coefficient and the target preset coding rate lower limit;
[0208] The target encoding rate determination subunit is configured to determine the target encoding rate corresponding to the audio signal to be processed based on the target encoding rate range defined by the target encoding rate upper limit and the target encoding rate lower limit.
[0209] In an exemplary embodiment, the rate coding coefficient further includes spectrum sparsity; the rate coding coefficient determination unit 330 further includes:
[0210] A spectrum centroid determination unit is configured to perform weighted averaging processing on the energy corresponding to each of the frequency bands to obtain the spectrum centroid;
[0211] The spectrum sparsity determination unit is configured to obtain the spectrum sparsity based on the ratio of the spectrum centroid to the total number of frequency bands.
[0212] In an exemplary embodiment, the target encoding bit rate determination subunit includes:
[0213] A bit rate difference determination unit, configured to determine a bit rate difference between the target encoding bit rate upper limit and the target encoding bit rate lower limit;
[0214] A first calculation unit is configured to determine the product of the spectrum sparsity and the bit rate difference;
[0215] The second calculation unit is configured to determine the target encoding rate corresponding to the audio data to be processed according to the sum of the product and the lower limit of the target encoding rate.
[0216] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0217] In an exemplary embodiment, an electronic device is also provided, including a processor; a memory for storing instructions executable by the processor; wherein, when the processor is configured to execute the instructions stored in the memory, the audio processing method provided in any of the above embodiments is implemented.
[0218] The electronic device may be a terminal, a server or a similar computing device. For example, the electronic device is a terminal. Figure 4 is a block diagram of an electronic device for audio processing according to an exemplary embodiment, specifically:
[0219] The terminal may include components such as an RF (Radio Frequency) circuit 410, a memory 420 including one or more computer-readable storage media, an input unit 430, a display unit 440, a sensor 450, an audio circuit 460, a WiFi (wireless fidelity) module 470, a processor 480 including one or more processing cores, and a power supply 490. Those skilled in the art will appreciate that Figure 4 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0220] The RF circuit 410 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 480 for processing; in addition, the data related to the uplink is sent to the base station. Generally, the RF circuit 410 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a user identity module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. In addition, the RF circuit 410 can also communicate with the network and other terminals through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.
[0221] The memory 420 can be used to store software programs and modules, and the processor 480 executes various functional applications and data processing by running the software programs and modules stored in the memory 420. The memory 420 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for functions, etc.; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 420 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 420 may also include a memory controller to provide the processor 480 and the input unit 430 with access to the memory 420.
[0222] The input unit 430 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 330 may include a touch-sensitive surface 431 and other input devices 432. The touch-sensitive surface 431, also known as a touch display screen or touchpad, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch-sensitive surface 431), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 431 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 480, and can receive and execute commands sent by the processor 480. In addition, the touch-sensitive surface 431 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 431, the input unit 430 may further include other input devices 432. Specifically, other input devices 432 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
[0223] The display unit 440 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the terminal, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 440 may include a display panel 441, and optionally, the display panel 441 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 431 may cover the display panel 441, and when the touch-sensitive surface 431 detects a touch operation on or near it, it is transmitted to the processor 480 to determine the type of the touch event, and then the processor 480 provides corresponding visual output on the display panel 441 according to the type of the touch event. Among them, the touch-sensitive surface 431 and the display panel 441 can be two independent components to realize the input and output functions, but in some embodiments, the touch-sensitive surface 431 and the display panel 441 can also be integrated to realize the input and output functions.
[0224] The terminal may also include at least one sensor 450, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 441 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 441 and / or the backlight when the terminal is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the terminal posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can be configured in the terminal, they will not be repeated here.
[0225] The audio circuit 460, the speaker 461, and the microphone 462 can provide an audio interface between the user and the terminal. The audio circuit 460 can transmit the received audio data to the speaker 461 after converting the electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 462 converts the collected sound signal into an electrical signal, which is received by the audio circuit 360 and converted into audio data, and then the audio data is output to the processor 480 for processing, and then sent to another terminal through the RF circuit 410, or the audio data is output to the memory 420 for further processing. The audio circuit 460 may also include an earplug jack to provide communication between an external headset and the terminal.
[0226] WiFi is a short-range wireless transmission technology. The terminal can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 470, which provides users with wireless broadband Internet access. Figure 4 A WiFi module 470 is shown, but it is understandable that it is not an essential component of the terminal and can be omitted as needed without changing the essence of the invention.
[0227] The processor 480 is the control center of the terminal, and uses various interfaces and lines to connect various parts of the entire terminal. By running or executing software programs and / or modules stored in the memory 420, and calling data stored in the memory 420, the processor 480 performs various functions of the terminal and processes data, thereby monitoring the terminal as a whole. Optionally, the processor 480 may include one or more processing cores; preferably, the processor 480 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 480.
[0228] The terminal also includes a power supply 490 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 480 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 490 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0229] Although not shown, the terminal may also include a camera, a Bluetooth module, etc., which will not be described in detail herein. Specifically in this embodiment, the terminal also includes a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors. The one or more programs include instructions for executing the audio processing method provided in the above method embodiment.
[0230] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 420 including instructions, and the instructions can be executed by a processor 480 of the device 400 to complete the above method. Alternatively, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0231] In an exemplary embodiment, a computer program product is also provided, including a computer program / instruction, and when the computer program / instruction is executed by a processor, the audio processing method provided in any of the above embodiments is implemented.
[0232] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0233] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An audio processing method, characterized in that: include: Acquire an audio signal to be processed, and perform audio classification on the audio signal to be processed to obtain a target audio category; Determining a target preset encoding bit rate range corresponding to the target audio category based on a correspondence between the audio category and the preset encoding bit rate range; Determining a rate coding coefficient of the audio signal to be processed based on the frequency spectrum data of the audio signal to be processed; Determining a target encoding rate corresponding to the audio signal to be processed based on the target preset encoding rate range and the rate coding coefficient; The target encoding bit rate is used to perform audio encoding processing on the audio signal to be processed; The rate coding coefficient includes an effective bandwidth coefficient; and determining the rate coding coefficient of the audio signal to be processed based on the spectrum data of the audio signal to be processed includes: Based on the frequency spectrum data of the audio signal to be processed, the energy of each frequency band in the audio signal to be processed is determined; based on the energy of each frequency band, the effective bandwidth is determined; based on the effective bandwidth and the sampling frequency, the effective bandwidth coefficient is obtained.
2. The audio processing method according to claim 1, characterized in that: The performing audio classification on the audio signal to be processed to obtain a target audio category includes: Extracting acoustic features of the audio signal to be processed based on the frequency spectrum data of the audio signal to be processed; The acoustic features are input into an audio classification model to obtain a classification result output by the audio classification model; the classification result indicates a target audio category.
3. The audio processing method according to claim 2, characterized in that: The training method of the audio classification model includes: Acquire a sample audio signal and corresponding annotation information; the annotation information indicates a reference audio category of the sample audio signal; Extracting acoustic features of the sample audio signal based on the frequency spectrum data of the sample audio signal to obtain sample acoustic features; Inputting the sample acoustic features into an initial audio classification model to perform audio classification, and obtaining a predicted classification result; the predicted classification result indicates the probability of belonging to the reference audio category; Based on the difference between the predicted classification result and the labeled information, the model parameters of the initial audio classification model are adjusted until a preset training end condition is met to obtain the audio classification model.
4. The audio processing method according to claim 1, characterized in that: The determining of the effective bandwidth based on the energy of each frequency band comprises: Determining an energy threshold based on a maximum energy among the energies of the frequency bands; Determine a target energy among the energies that is less than the energy threshold; Determine a frequency band point of a frequency band corresponding to a minimum energy in the target energy; An effective bandwidth is determined based on the frequency band points, the sampling frequency and the total number of frequency bands.
5. The audio processing method according to claim 4, characterized in that: The preset encoding rate range includes a preset encoding rate upper limit and a preset encoding rate lower limit; and determining a target encoding rate corresponding to the audio signal to be processed based on the target preset encoding rate range and the rate coding coefficient includes: Obtaining a target encoding rate upper limit based on the product of the effective bandwidth coefficient and the target preset encoding rate upper limit, and obtaining a target encoding rate lower limit based on the product of the effective bandwidth coefficient and the target preset encoding rate lower limit; Based on the target encoding rate range defined by the target encoding rate upper limit and the target encoding rate lower limit, a target encoding rate corresponding to the audio signal to be processed is determined.
6. The audio processing method according to claim 5, characterized in that: The rate coding coefficient also includes spectrum sparsity; and determining the rate coding coefficient of the audio signal to be processed based on the spectrum data of the audio signal to be processed further includes: Performing weighted average processing on the energy corresponding to each of the frequency bands to obtain the spectrum centroid; The spectrum sparsity is obtained based on the ratio of the spectrum centroid to the total number of frequency bands.
7. The audio processing method according to claim 6, characterized in that: The determining, based on the target encoding rate range defined by the target encoding rate upper limit and the target encoding rate lower limit, the target encoding rate corresponding to the audio signal to be processed includes: Determine a bit rate difference between the target encoding bit rate upper limit and the target encoding bit rate lower limit; Determining the product of the spectrum sparsity and the bit rate difference; The target encoding rate corresponding to the audio data to be processed is determined according to the sum of the product and the lower limit of the target encoding rate.
8. An audio processing device, characterized in that: include: An audio classification unit is configured to obtain an audio signal to be processed, and perform audio classification on the audio signal to be processed to obtain a target audio category; A coding bit rate range determining unit, configured to determine a target preset coding bit rate range corresponding to the target audio category based on a correspondence between the audio category and the preset coding bit rate range; a rate coding coefficient determining unit, configured to determine a rate coding coefficient of the audio signal to be processed based on the spectrum data of the audio signal to be processed; a target encoding rate determining unit, configured to determine a target encoding rate corresponding to the audio signal to be processed based on the target preset encoding rate range and the rate coding coefficient; The target encoding bit rate is used to perform audio encoding processing on the audio signal to be processed; The rate coding coefficient includes an effective bandwidth coefficient; and determining the rate coding coefficient of the audio signal to be processed based on the spectrum data of the audio signal to be processed includes: Based on the frequency spectrum data of the audio signal to be processed, the energy of each frequency band in the audio signal to be processed is determined; based on the energy of each frequency band, the effective bandwidth is determined; based on the effective bandwidth and the sampling frequency, the effective bandwidth coefficient is obtained.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the audio processing method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the audio processing method according to any one of claims 1 to 7.
11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the audio processing method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and device for transmitting voice data
CN111768790A
Audio encoding method and device, electronic equipment and storage medium
CN111816197A