Audio Processing Method, Apparatus, Device, and Medium Based on Gain Compensation
By using gain compensation technology during the dereverberation process, the problem of inconsistency in the audio size and sound after dereverberation in the prior art is solved, and the stability and intensity balance of audio sound are achieved.
Patent Information
- Application Number
- CN202210601310.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2042-05-30
AI Technical Summary
In the prior art, the dereverberation method cannot ensure that the output audio size and sound are consistent under different dereverberation intensity, resulting in unstable audio sound.
By receiving preset dereverberation commands, obtain dereverberation interface information and detect whether it meets the dereverberation conditions. After determining the reverberation time, use the gain compensation formula to calculate the gain compensation value and perform gain compensation on the dereverberation audio signal to ensure that the output audio is of the same size and sound.
The output audio size and sound are consistent under different dereverberation intensity, effectively improving the intensity gap of the output audio signal.
Smart Images

Figure CN115019819B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technical field of audio processing, and in particular, to an audio processing method, apparatus, device, and medium based on gain compensation. Background Art
[0002] Reverberation removal is a type of speech enhancement in audio processing, mainly to increase speech clarity. For example, reverberant recordings made in a reverberant environment can be processed to remove reverberation and extract clean and non-muddy sounds. There are many ways to implement reverberation removal in the prior art, and the most widely used one is spectral subtraction. However, the reverberation removal method based on spectral subtraction cannot ensure that the audio volume before and after reverberation removal is the same. Because in principle, spectral subtraction subtracts the part of the sound spectrum that belongs to reverberation. That is, if the reverberation removal intensity is increased, the components subtracted from the sound spectrum will be larger, and the remaining audio energy will be smaller, resulting in a smaller audio volume. Conversely, the audio volume will be larger. Summary of the Invention
[0003] Embodiments of the present invention provide an audio processing method, apparatus, device, and medium based on gain compensation, aiming to solve the problem that the output audio volume is inconsistent under different reverberation removal intensities in the prior art.
[0004] In a first aspect, embodiments of the present invention provide an audio processing method based on gain compensation, which includes:
[0005] If a preset reverberation removal instruction is received, obtain reverberation removal interface information according to the preset reverberation removal instruction, and detect whether the reverberation removal interface information meets the reverberation removal conditions, where the reverberation removal interface information includes an audio signal to be processed and a reverberation removal intensity;
[0006] If the reverberation removal interface information meets the reverberation removal conditions, determine the reverberation time according to the reverberation removal intensity and the preset intensity-time correspondence;
[0007] Perform reverberation removal on the audio signal to be processed according to the reverberation time to obtain a reverberation-removed audio signal;
[0008] Calculate a gain compensation value according to the reverberation time through a gain compensation formula, and perform gain compensation on the reverberation-removed audio signal through the gain compensation value to obtain an output audio signal.
[0009] Further, detect whether the file format of the audio signal to be processed is a preset file format; if the file format of the audio signal to be processed is the preset file format, detect whether the reverberation removal intensity is within a preset reverberation level range; if the reverberation removal intensity is within the preset reverberation level range, determine that the reverberation removal interface information meets the reverberation removal conditions.
[0010] Further, if the file format of the audio signal to be processed is not the preset file format, a prompt is sent to the user asking whether to convert the file format of the audio signal to be processed; if a preset confirmation format conversion instruction is received from the user through the prompt interface, the file format of the audio signal to be processed is converted to the preset file format.
[0011] Further, the reverberation signal in the audio signal to be processed is determined according to the audio signal to be processed and the reverberation time; the audio signal to be processed is de-reverberated according to the reverberation signal and a preset de-reverberation factor to obtain a de-reverberated audio signal.
[0012] Further, a gain compensation value is calculated according to the reverberation time through a gain compensation formula, where the gain compensation formula is Output Gain = 1 - 0.33 (RT60 -0 .1+1) , RT in the gain compensation formula 60 is the reverberation time; the gain compensation value is multiplied by the amplitude value of the de-reverberated audio signal to perform gain compensation on the de-reverberated audio signal to obtain an output audio signal.
[0013] Further, the file name and file path of the audio signal to be processed are obtained; the output audio signal is renamed according to the file name and a preset character; the renamed output audio signal is saved to the file path, and a message indicating that de-reverberation is completed is displayed on the de-reverberation interface.
[0014] Further, if a de-reverberation intensity adjustment instruction is received, the de-reverberation intensity is obtained according to the de-reverberation intensity adjustment instruction, and the de-reverberation intensity is adjusted according to a preset adjustment value; the adjusted de-reverberation intensity is displayed.
[0015] In a second aspect, an embodiment of the present invention further provides an audio processing device based on gain compensation, which includes:
[0016] A detection unit, configured to, if a preset de-reverberation instruction is received, obtain de-reverberation interface information according to the preset de-reverberation instruction, and detect whether the de-reverberation interface information meets the de-reverberation condition, where the de-reverberation interface information includes an audio signal to be processed and a de-reverberation intensity;
[0017] A determination unit, configured to, if the de-reverberation interface information meets the de-reverberation condition, determine the reverberation time according to the de-reverberation intensity and a preset intensity-time correspondence;
[0018] A de-reverberation unit, configured to de-reverberate the audio signal to be processed according to the reverberation time to obtain a de-reverberated audio signal;
[0019] A gain compensation unit, configured to calculate a gain compensation value according to the reverberation time through a gain compensation formula, and perform gain compensation on the dereverberated audio signal by using the gain compensation value to obtain an output audio signal.
[0020] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor. A computer program is stored on the memory, and when the processor executes the computer program, the above method is implemented.
[0021] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the above method can be implemented.
[0022] An embodiment of the present invention provides an audio processing method, device, equipment and medium based on gain compensation. Among them, the method includes: if a preset dereverberation instruction is received, obtaining dereverberation interface information according to the preset dereverberation instruction, and detecting whether the dereverberation interface information meets the dereverberation condition, where the dereverberation interface information includes an audio signal to be processed and a dereverberation intensity; if the dereverberation interface information meets the dereverberation condition, determining the reverberation time according to the dereverberation intensity and a preset intensity-time correspondence relationship; performing dereverberation on the audio signal to be processed according to the reverberation time to obtain a dereverberated audio signal; calculating a gain compensation value according to the reverberation time through a gain compensation formula, and performing gain compensation on the dereverberated audio signal by using the gain compensation value to obtain an output audio signal. The technical solution of the embodiment of the present invention first determines the reverberation time according to the dereverberation intensity and the preset intensity-time correspondence relationship, then calculates the gain compensation value according to the reverberation time through the gain compensation formula, and finally performs gain compensation on the dereverberated audio signal by using the gain compensation value, which can not only ensure that the output audio is of the same volume under different dereverberation intensities, but also effectively improve the intensity drop of the output audio signal. Description of the Drawings
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0024] Figure 1 It is a schematic flowchart of an audio processing method based on gain compensation provided by an embodiment of the present invention;
[0025] Figure 2 It is a schematic sub-flowchart of an audio processing method based on gain compensation provided by an embodiment of the present invention;
[0026] Figure 3 The reverberation time RT of an audio processing method based on gain compensation provided by an embodiment of the present invention 60 The waveform diagrams of the audio signal to be processed and the output audio signal obtained without gain compensation when RT = 0.5;
[0027] Figure 4 The reverberation time RT of an audio processing method based on gain compensation provided by an embodiment of the present invention 60 The waveform diagrams of the audio signal to be processed and the output audio signal obtained with gain compensation when RT = 0.5;
[0028] Figure 5 The reverberation time RT of an audio processing method based on gain compensation provided by an embodiment of the present invention 60 The waveform diagrams of the audio signal to be processed and the output audio signal obtained with gain compensation when RT = 2;
[0029] Figure 6 The schematic block diagram of an audio processing device based on gain compensation provided by an embodiment of the present invention; and
[0030] Figure 7 The schematic block diagram of a computer device provided by an embodiment of the present invention. Detailed implementation manners
[0031] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0032] It should be understood that when used in this specification and the appended claims, the terms "comprises" and "comprising" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0033] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in this specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.
[0034] It should be further understood that the term "and / or" as used in the specification and appended claims of the present invention refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0035] As used in this specification and the appended claims, the term "if" may be construed, depending on the context, as "when" or "once" or "in response to determining" or "in response to detecting". Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be construed, depending on the context, as meaning "once determined" or "in response to determining" or "once [the described condition or event] is detected" or "in response to detecting [the described condition or event]".
[0036] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of the audio processing method based on gain compensation provided by an embodiment of the present invention. The audio processing method based on gain compensation will be described in detail below. As Figure 1 shown, the method includes the following steps S100 - S130.
[0037] S100. If a preset dereverberation instruction is received, obtain dereverberation interface information according to the preset dereverberation instruction, and detect whether the dereverberation interface information meets the dereverberation condition, where the dereverberation interface information includes an audio signal to be processed and a dereverberation intensity.
[0038] In an embodiment of the present invention, when the user clicks the dereverberation button on the dereverberation interface of the dereverberation application, it triggers the sending of a preset dereverberation instruction. The dereverberation application receives the preset dereverberation instruction and obtains dereverberation interface information according to the preset dereverberation instruction, where the dereverberation interface information includes an audio signal to be processed and a dereverberation intensity; after obtaining the reverberation interface information, it detects whether the dereverberation interface information meets the dereverberation condition.
[0039] It should be noted that in an embodiment of the present invention, before the user clicks the dereverberation button on the dereverberation interface of the dereverberation application, the user also clicks the file import button to import the file of the audio signal to be processed, and at the same time, sets the dereverberation intensity on the dereverberation interface. Understandably, there is also a dereverberation intensity adjustment button on the dereverberation interface. Through the dereverberation intensity adjustment button, the dereverberation intensity can be adjusted. Specifically, the dereverberation intensity adjustment button includes an up button and a down button. The user can preset an adjustment value by clicking the up button or the down button to increase or decrease the dereverberation intensity, where the preset adjustment value is 1.
[0040] Please refer to Figure 2, in one embodiment, for example, in the embodiment of the present invention, step S100 includes the following steps S101 - S103.
[0041] S101. Detect whether the file format of the audio signal to be processed is a preset file format;
[0042] S102. If the file format of the audio signal to be processed is the preset file format, then detect whether the reverberation removal intensity is within the preset reverberation level range;
[0043] S103. If the reverberation removal intensity is within the preset reverberation level range, then determine that the reverberation removal interface information meets the reverberation removal conditions.
[0044] In the embodiment of the present invention, to detect whether the reverberation removal interface information meets the reverberation removal conditions, specifically, it is to detect whether the file format of the audio signal to be processed is a preset file format, where the preset file format is wav; if it is not the preset file format, a prompt for whether to convert the file format of the audio signal to be processed is sent to the user; according to the file conversion prompt, if the user clicks the conversion button on the reverberation removal interface, a preset confirmation format conversion instruction is sent to the reverberation removal application program, and the reverberation removal application program converts the file format of the audio signal to be processed into the preset file format according to the preset confirmation format conversion instruction; it is understandable that if the user clicks the non - conversion button on the reverberation removal interface, the reverberation removal application program continues to display the interface for selecting the audio signal to be processed; if it is the preset file format, then detect whether the reverberation removal intensity is within the preset reverberation level range, where the preset reverberation level range is 0% - 100%; if the reverberation removal intensity is within the preset reverberation level range, then determine that the reverberation removal interface information meets the reverberation removal conditions; it is understandable that if the reverberation removal intensity is not within the preset reverberation level range, for example, the reverberation removal intensity set by the user is 110%, then it is not within the preset reverberation level range, and a prompt message indicating that the reverberation interface information does not meet the reverberation conditions is sent to the user. It should be noted that in the embodiment of the present invention, it is also possible to first detect whether the reverberation removal intensity is within the preset reverberation level range, and if it is within the range, then continue to detect whether the file format of the audio signal to be processed is the preset file format.
[0045] S110. If the reverberation removal interface information meets the reverberation removal conditions, then determine the reverberation time according to the corresponding relationship between the reverberation removal intensity and the preset intensity time.
[0046] In an embodiment of the present invention, if the file format of the audio signal to be processed is the preset file format and the reverberation removal intensity is within the preset reverberation level range, indicating that the reverberation removal interface information meets the reverberation removal condition, then the reverberation time is determined according to the reverberation removal intensity and the preset intensity-time correspondence relationship, where the preset intensity-time correspondence relationship is 0%-100% corresponding to 0.1-10. Specifically, assuming that the reverberation removal intensity is 0%, the reverberation time is 0.1, and so on.
[0047] S120. Reverberation is removed from the audio signal to be processed according to the reverberation time to obtain a reverberation-removed audio signal.
[0048] In an embodiment of the present invention, reverberation is removed from the audio signal to be processed through a preset reverberation removal algorithm according to the reverberation time to obtain a reverberation-removed audio signal, where the preset reverberation removal algorithm is the spectral subtraction method. In practical applications, the audio signal to be processed is first converted from the time domain to the frequency domain to obtain a first audio signal, and then the reverberation signal in the audio signal to be processed is determined according to the first audio signal and the reverberation time; the first audio signal is de-reverberated according to the reverberation signal and a preset de-reverberation factor to obtain a second audio signal, and the second audio signal is converted from the frequency domain to the time domain to obtain a reverberation-removed audio signal.
[0049] S130. A gain compensation value is calculated according to the reverberation time through a gain compensation formula, and the reverberation-removed audio signal is gain-compensated through the gain compensation value to obtain an output audio signal.
[0050] In an embodiment of the present invention, a gain compensation value is calculated according to the reverberation time through a gain compensation formula, where the gain compensation formula is Output Gain = 1 - 0.33 (RT60-0.1+1) , and RT in the gain compensation formula 60 is the reverberation time; after obtaining the gain compensation value, the gain compensation value is multiplied by the amplitude value of the reverberation-removed audio signal to perform gain compensation on the reverberation-removed audio signal to obtain an output audio signal, which can not only ensure that the output audio is of the same volume under different reverberation removal intensities, but also effectively improve the intensity drop of the output audio signal. It should be noted that in an embodiment of the present invention, after obtaining the output audio signal, the file name and file path of the audio signal to be processed are obtained; the output audio signal is renamed according to the file name and a preset character, where the preset character is dereverb; the renamed output audio signal is saved to the file path, and a message indicating that the reverberation removal is completed is displayed on the reverberation removal interface.
[0051] It should also be noted that in an embodiment of the present invention, as Figure 3As shown, it shows the reverberation time RT 60 = 0.5, the waveform diagrams of the audio signal to be processed and the output audio signal obtained without gain compensation; as Figure 4 shown, it shows the reverberation time RT 60 = 0.5, the waveform diagrams of the audio signal to be processed and the output audio signal obtained through gain compensation; as Figure 5 shown, it shows the reverberation time RT 60 = 2, the waveform diagrams of the audio signal to be processed and the output audio signal obtained through gain compensation; from Figure 3 and Figure 4 it can be seen that after gain compensation, the intensity drop of the output audio signal can be effectively improved; from Figure 4 and Figure 5 it can be seen that after gain compensation, it can ensure that the output audio is the same volume under different reverberation intensities. Understandably, in Figure 3 , Figure 4 and Figure 5 , input waveform and algorithm output waveform represent the audio signal to be processed and the output audio signal.
[0052] Figure 6 is a schematic block diagram of an audio processing device 200 based on gain compensation provided by an embodiment of the present invention. As Figure 6 shown, corresponding to the above audio processing method based on gain compensation, the present invention also provides an audio processing device 200 based on gain compensation. The audio processing device 200 based on gain compensation includes units for executing the above audio processing method based on gain compensation, and this device can be configured in a computer device. Specifically, please refer to Figure 6 , the audio processing device 200 based on gain compensation includes a detection unit 201, a determination unit 202, a reverberation removal unit 203, and a gain compensation unit 204.
[0053] Among them, the detection unit is used to, if a preset reverberation removal instruction is received, obtain reverberation removal interface information according to the preset reverberation removal instruction, and detect whether the reverberation removal interface information meets the reverberation removal conditions, where the reverberation removal interface information includes the audio signal to be processed and the reverberation removal intensity; the determination unit is used to, if the reverberation removal interface information meets the reverberation removal conditions, determine the reverberation time according to the reverberation removal intensity and the preset intensity-time correspondence; the reverberation removal unit is used to remove the reverberation of the audio signal to be processed according to the reverberation time to obtain a reverberation-removed audio signal; the gain compensation unit is used to calculate a gain compensation value according to the reverberation time through a gain compensation formula, and perform gain compensation on the reverberation-removed audio signal through the gain compensation value to obtain an output audio signal.
[0054] In some embodiments, such as this embodiment, the detection unit 201 includes a first detection subunit, a second detection subunit, a determination unit, a prompt unit, and a conversion unit.
[0055] Among them, the first detection subunit is used to detect whether the file format of the audio signal to be processed is a preset file format; the second detection subunit is used to detect whether the reverberation removal intensity is within a preset reverberation level range if the file format of the audio signal to be processed is the preset file format; the determination unit is used to determine that the reverberation removal interface information meets the reverberation removal condition if the reverberation removal intensity is within the preset reverberation level range; the prompt unit is used to send a prompt to the user asking whether to convert the file format of the audio signal to be processed if the file format of the audio signal to be processed is not the preset file format; the conversion unit is used to convert the file format of the audio signal to be processed into the preset file format if a preset confirmation format conversion instruction sent by the user through the prompt interface is received.
[0056] In some embodiments, such as this embodiment, the reverberation removal unit 203 includes a determination subunit and a reverberation removal subunit.
[0057] Among them, the determination subunit is used to determine the reverberation signal in the audio signal to be processed according to the audio signal to be processed and the reverberation time; the reverberation removal subunit is used to remove the reverberation from the audio signal to be processed according to the reverberation signal and a preset reverberation removal factor to obtain a reverberation-removed audio signal.
[0058] In some embodiments, such as this embodiment, the gain compensation unit 204 includes a first calculation subunit and a second calculation subunit.
[0059] Among them, the first calculation subunit is used to calculate a gain compensation value according to the reverberation time through a gain compensation formula, where the gain compensation formula is Output Gain = 1 - 0.33 (RT60 -0 .1+1) , and RT in the gain compensation formula 60 is the reverberation time; the second calculation subunit is used to multiply the gain compensation value by the amplitude value of the reverberation-removed audio signal to perform gain compensation on the reverberation-removed audio signal to obtain an output audio signal.
[0060] In some embodiments, such as this embodiment, the audio processing device 200 based on gain compensation further includes an acquisition unit, a rename unit, a save unit, an adjustment unit, and a display unit.
[0061] Wherein, the obtaining unit is configured to obtain the file name and file path of the audio signal to be processed; the renaming unit is configured to rename the output audio signal according to the file name and a preset character; the saving unit is configured to save the renamed output audio signal to the file path and display a completion message for dereverberation on the dereverberation interface; the adjusting unit is configured to, if receiving a dereverberation intensity adjustment instruction, obtain the dereverberation intensity according to the dereverberation intensity adjustment instruction and adjust the dereverberation intensity according to a preset adjustment value; and the displaying unit is configured to display the adjusted dereverberation intensity.
[0062] The above audio processing device based on gain compensation can be implemented in the form of a computer program, and this computer program can run on a computer device as shown in Figure 7 .
[0063] Please refer to Figure 7 . Figure 7 FIG. is a schematic block diagram of a computer device provided by an embodiment of the present invention. The computer device 300 is a display device with audio processing function based on gain compensation.
[0064] Referring to Figure 7 , the computer device 300 includes a processor 302, a memory, and a network interface 305 connected through a system bus 301. Among them, the memory may include a non-volatile storage medium 303 and an internal memory 304.
[0065] The non-volatile storage medium 303 can store an operating system 3031 and a computer program 3032. When the computer program 3032 is executed, the processor 302 can be caused to execute an audio processing method based on gain compensation.
[0066] The processor 302 is configured to provide computing and control capabilities to support the operation of the entire computer device 300.
[0067] The internal memory 304 provides an environment for the operation of the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can be caused to execute an audio processing method based on gain compensation.
[0068] The network interface 305 is configured to communicate with other devices via a network. Those skilled in the art can understand that Figure 7 the structure shown in FIG. is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device 300 to which the solution of the present invention is applied. The specific computer device 300 may include more or fewer components than those shown in the figure, or combine certain components, or have a different component layout.
[0069] Wherein, the processor 302 is configured to run a computer program 3032 stored in the memory to implement the following steps: if a preset dereverberation instruction is received, obtain dereverberation interface information according to the preset dereverberation instruction, and detect whether the dereverberation interface information meets the dereverberation condition, wherein the dereverberation interface information includes an audio signal to be processed and a dereverberation intensity; if the dereverberation interface information meets the dereverberation condition, determine a reverberation time according to the dereverberation intensity and a preset intensity-time correspondence; dereverberate the audio signal to be processed according to the reverberation time to obtain a dereverberated audio signal; calculate a gain compensation value according to the reverberation time through a gain compensation formula, and perform gain compensation on the dereverberated audio signal through the gain compensation value to obtain an output audio signal.
[0070] In some embodiments, such as this embodiment, when the processor 302 implements the step of detecting whether the dereverberation interface information meets the dereverberation condition, the following steps are specifically implemented: detect whether the file format of the audio signal to be processed is a preset file format; if the file format of the audio signal to be processed is the preset file format, detect whether the dereverberation intensity is within a preset reverberation level range; if the dereverberation intensity is within the preset reverberation level range, determine that the dereverberation interface information meets the dereverberation condition; if the file format of the audio signal to be processed is not the preset file format, send a prompt to the user asking whether to convert the file format of the audio signal to be processed; if a preset confirmation format conversion instruction is received from the user through the prompt interface, convert the file format of the audio signal to be processed to the preset file format.
[0071] In some embodiments, such as this embodiment, when the processor 302 implements the step of dereverberating the audio signal to be processed according to the reverberation time to obtain a dereverberated audio signal, the following steps are specifically implemented: determine a reverberation signal in the audio signal to be processed according to the audio signal to be processed and the reverberation time; dereverberate the audio signal to be processed according to the reverberation signal and a preset dereverberation factor to obtain a dereverberated audio signal.
[0072] In some embodiments, such as this embodiment, when the processor 302 implements the step of calculating a gain compensation value according to the reverberation time through a gain compensation formula, and performing gain compensation on the dereverberated audio signal through the gain compensation value to obtain an output audio signal, the following steps are specifically implemented: calculate a gain compensation value according to the reverberation time through a gain compensation formula, wherein the gain compensation formula is Output Gain = 1 - 0.33 (RT60 -0 .1+1) , RT in the gain compensation formula 60is the reverberation time; multiplying the gain compensation value by the amplitude value of the dereverberated audio signal to perform gain compensation on the dereverberated audio signal to obtain an output audio signal.
[0073] In some embodiments, such as this embodiment, after the processor 302 implements the step of calculating the gain compensation value according to the reverberation time through the gain compensation formula and performing gain compensation on the dereverberated audio signal by the gain compensation value to obtain the output audio signal, the specific implementation further includes the following steps: obtaining the file name and file path of the audio signal to be processed; renaming the output audio signal according to the file name and a preset character; saving the renamed output audio signal to the file path, and displaying a message indicating that dereverberation is completed on the dereverberation interface.
[0074] In some embodiments, such as this embodiment, before the processor 302 implements the step of if a preset dereverberation instruction is received, obtaining dereverberation interface information according to the preset dereverberation instruction and detecting whether the dereverberation interface information meets the dereverberation condition, where the dereverberation interface information includes the audio signal to be processed and the dereverberation intensity, the specific implementation further includes the following steps: if a dereverberation intensity adjustment instruction is received, obtaining the dereverberation intensity according to the dereverberation intensity adjustment instruction and adjusting the dereverberation intensity according to a preset adjustment value; displaying the adjusted dereverberation intensity.
[0075] It should be understood that in the embodiments of the present invention, the processor 302 may be a central processing unit (CPU), and the processor 302 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0076] Those of ordinary skill in the art can understand that all or part of the processes of the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a storage medium, and the storage medium is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0077] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. When the computer program is executed by a processor, the processor executes any of the embodiments of the above-described audio processing method based on gain compensation.
[0078] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, an optical disk, or other various computer-readable storage media that can store program codes.
[0079] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0080] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0081] The steps in the method embodiments of the present invention can be adjusted, combined, and deleted according to actual needs. The units in the device embodiments of the present invention can be combined, divided, and deleted according to actual needs. In addition, the functional units in each embodiment of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0082] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention.
[0083] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0084] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, provided that these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these changes and modifications therein.
[0085] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. An audio processing method based on gain compensation, characterized in that, Including: If a preset dereverberation instruction is received, obtain dereverberation interface information according to the preset dereverberation instruction, and detect whether the dereverberation interface information meets the dereverberation condition, where the dereverberation interface information includes an audio signal to be processed and a dereverberation intensity; If the dereverberation interface information meets the dereverberation condition, determine the reverberation time according to the dereverberation intensity and a preset intensity-time correspondence; Dereverberate the audio signal to be processed according to the reverberation time to obtain a dereverberated audio signal; Calculate a gain compensation value according to the reverberation time through a gain compensation formula, and perform gain compensation on the dereverberated audio signal through the gain compensation value to obtain an output audio signal; Among them, the detection of whether the dereverberation interface information meets the dereverberation condition includes: Detect whether the file format of the audio signal to be processed is a preset file format; If the file format of the audio signal to be processed is the preset file format, detect whether the dereverberation intensity is within a preset reverberation level range; If the dereverberation intensity is within the preset reverberation level range, determine that the dereverberation interface information meets the dereverberation condition; The calculating a gain compensation value according to the reverberation time through a gain compensation formula, and performing gain compensation on the dereverberated audio signal through the gain compensation value to obtain an output audio signal includes: Calculate the gain compensation value according to the reverberation time through the gain compensation formula, where the gain compensation formula is Output Gain = 1 - 0.33(RT60 - 0.1 + 1), and RT60 in the gain compensation formula is the reverberation time; Multiply the gain compensation value by the amplitude value of the dereverberated audio signal to perform gain compensation on the dereverberated audio signal to obtain the output audio signal.
2. The method according to claim 1, wherein After detecting whether the file format of the audio signal to be processed is a preset file format, it further includes: If the file format of the audio signal to be processed is not the preset file format, send a prompt to the user asking whether to convert the file format of the audio signal to be processed; If a preset confirmation format conversion instruction sent by the user through the prompt interface is received, convert the file format of the audio signal to be processed to the preset file format.
3. The method according to claim 1, wherein The dereverberating the audio signal to be processed according to the reverberation time to obtain a dereverberated audio signal includes: Determine the reverberation signal in the audio signal to be processed according to the audio signal to be processed and the reverberation time; Dereverberate the audio signal to be processed according to the reverberation signal and a preset dereverberation factor to obtain a dereverberated audio signal.
4. The method according to claim 1, characterized in that, After calculating a gain compensation value according to the reverberation time through a gain compensation formula, and performing gain compensation on the dereverberated audio signal through the gain compensation value to obtain an output audio signal, it further includes: Obtain the file name and file path of the audio signal to be processed; Rename the output audio signal according to the file name and a preset character; Save the renamed output audio signal to the file path, and display the word "reverberation removal completed" on the reverberation removal interface.
5. The method according to claim 1, characterized in that, The method further includes: If a reverberation removal intensity adjustment instruction is received, obtain the reverberation removal intensity according to the reverberation removal intensity adjustment instruction, and adjust the reverberation removal intensity according to a preset adjustment value; Display the adjusted reverberation removal intensity.
6. An audio processing device based on gain compensation, characterized in that, It includes: A detection unit, configured to, if a preset reverberation removal instruction is received, obtain reverberation removal interface information according to the preset reverberation removal instruction, and detect whether the reverberation removal interface information meets the reverberation removal conditions, where the reverberation removal interface information includes an audio signal to be processed and a reverberation removal intensity; A determination unit, configured to, if the reverberation removal interface information meets the reverberation removal conditions, determine the reverberation time according to the reverberation removal intensity and a preset intensity-time correspondence relationship; A reverberation removal unit, configured to perform reverberation removal on the audio signal to be processed according to the reverberation time to obtain a reverberation-removed audio signal; A gain compensation unit, configured to calculate a gain compensation value according to the reverberation time through a gain compensation formula, and perform gain compensation on the reverberation-removed audio signal through the gain compensation value to obtain an output audio signal; Wherein, the detection unit includes: A first detection subunit, configured to detect whether the file format of the audio signal to be processed is a preset file format; A second detection subunit, configured to, if the file format of the audio signal to be processed is the preset file format, detect whether the reverberation removal intensity is within a preset reverberation level range; A determination unit, configured to, if the reverberation removal intensity is within the preset reverberation level range, determine that the reverberation removal interface information meets the reverberation removal conditions; The gain compensation unit includes: A first calculation subunit, configured to calculate the gain compensation value according to the reverberation time through the gain compensation formula, where the gain compensation formula is Output Gain = 1 - 0.33(RT60 - 0.1 + 1), and RT60 in the gain compensation formula is the reverberation time; A second calculation subunit, configured to multiply the gain compensation value by the amplitude value of the reverberation-removed audio signal to perform gain compensation on the reverberation-removed audio signal to obtain the output audio signal.
7. A computer device, characterized in that, The computer device includes a memory and a processor, and a computer program is stored on the memory. When the processor executes the computer program, the method described in any one of claims 1-5 is implemented.
8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1-5 can be implemented.
Citation Information
Patent Citations
Method and device for calculating sound compensation parameters as well as sound compensation system
CN102456348A
Vehicle-mounted audio processing system, method and device
CN113808557A