Audio signal processing method and device
A combined software and hardware approach for audio signal processing adjusts volume levels to ensure consistent playback by using digital gain processing and system gain adjustments, addressing the limitations of existing technologies in maintaining volume consistency.
Patent Information
- Application Number
- CN202310667482.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-06
- Publication Date
- 2024-12-06
AI Technical Summary
Existing audio signal processing technologies face challenges in maintaining consistent volume levels due to device and environmental variations, leading to poor playback effects as they rely solely on software-level gain control, which often fails to meet volume requirements.
A combined software and hardware approach is employed to adjust audio signal volume, involving digital gain processing followed by system gain parameter adjustments until the volume falls within a preset standard range, ensuring consistent playback.
This method ensures that the audio signal volume is maintained within a desired range, preventing loud or soft playback, thereby improving the overall audio playback experience.
Smart Images

Figure CN119094953A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio processing technology, and in particular to a method and device for processing an audio signal. Background Art
[0002] In transmission scenarios such as Voice over Internet Protocol (VoIP), live broadcast, and conference, different users have different speaking volumes due to the influence of the environment and equipment. Sometimes, the playback volume needs to be adjusted frequently to meet the listening needs. Headphone users are always facing the "critical hit" of sound. Therefore, it is particularly important to balance the volume. An excellent automatic gain control algorithm can unify the audio volume, greatly alleviating the volume differences caused by factors such as device acquisition differences, speaker volume, and distance. The existing technology for processing audio signals mainly detects the volume of the audio signal, and then adjusts the gain value according to the volume, and performs gain processing on the signal according to the gain value. This software-level gain control is prone to bottlenecks, making the signal after gain processing unable to meet the requirements, making the played sound louder or smaller, resulting in poor playback effect of the final audio signal.
[0003] That is, the playing effect of the audio signal in the prior art is relatively poor. Summary of the invention
[0004] The embodiments of the present application provide a method and device for processing an audio signal, which can improve the playing effect of the audio signal.
[0005] In a first aspect, the present application provides a method for processing an audio signal, comprising:
[0006] Acquire a first output audio signal output by an audio acquisition device, wherein the audio acquisition device processes the collected input audio signal based on a preset system gain parameter to obtain the first output audio signal;
[0007] When the volume of the first output audio signal does not belong to the preset standard volume range, the first output audio signal is processed based on a preset first digital gain parameter to obtain a second output audio signal;
[0008] When the volume of the second output audio signal does not belong to the preset standard volume range, adjusting the preset system gain parameter until the volume of the second output audio signal belongs to the preset standard volume range;
[0009] The second output audio signal whose volume belongs to the preset standard volume range is input into the audio playing device for playing.
[0010] In a second aspect, the present application provides an audio signal processing device, comprising:
[0011] A signal acquisition module, configured to acquire a first output audio signal output by an audio acquisition device, wherein the audio acquisition device processes the collected input audio signal based on a preset system gain parameter to obtain the first output audio signal;
[0012] a digital gain adjustment module, configured to process the first output audio signal based on a preset first digital gain parameter to obtain a second output audio signal when the volume of the first output audio signal does not belong to a preset standard volume range;
[0013] a system gain adjustment module, configured to adjust the preset system gain parameter so that the volume of the second output audio signal falls within the preset standard volume range when the volume of the second output audio signal does not fall within the preset standard volume range;
[0014] The signal playing module is used to input the second output audio signal whose volume belongs to the preset standard volume range into the audio playing device for playing.
[0015] In an optional embodiment, the digital gain adjustment module is used to:
[0016] When the volume of the first output audio signal does not belong to the preset standard volume range, processing the first output audio signal to obtain a third output audio signal;
[0017] The third output audio signal is processed based on a preset first digital gain parameter to obtain a second output audio signal.
[0018] In an optional embodiment, the digital gain adjustment module is used to:
[0019] Get the preset volume gain mapping relationship;
[0020] Determining a digital gain parameter corresponding to the third output audio signal based on the volume of the third output audio signal and the volume gain mapping relationship;
[0021] determining the first digital gain parameter based on the digital gain parameter corresponding to the third output audio signal;
[0022] The third output audio signal is subjected to gain processing based on the first digital gain parameter to obtain a second output audio signal.
[0023] In an optional embodiment, the volume gain mapping relationship includes at least two preset non-standard volume intervals and corresponding digital gain parameters, and each of the preset non-standard volume intervals does not overlap with the preset standard volume interval;
[0024] The digital gain adjustment module is used for:
[0025] determining, based on at least two of the preset non-standard volume intervals, a preset non-standard volume interval into which the volume of the third output audio signal falls;
[0026] determining a preset non-standard volume interval within which the volume of the third output audio signal falls as a target volume interval;
[0027] Determine the digital gain parameter corresponding to the target volume interval based on the volume gain mapping relationship;
[0028] The digital gain parameter corresponding to the target volume interval is determined as the digital gain parameter corresponding to the third output audio signal.
[0029] In an optional embodiment, the digital gain adjustment module is used to:
[0030] Determining whether the digital gain parameter corresponding to the third output audio signal is greater than a preset gain value;
[0031] If the digital gain parameter corresponding to the third output audio signal is greater than a preset gain value, obtaining the sound scene type of the first output audio signal;
[0032] If the sound scene type of the first output audio signal does not belong to the noise scene type and does not belong to the echo scene type, the digital gain parameter corresponding to the third output audio signal is determined as the first digital gain parameter; if the sound scene type of the first output audio signal belongs to the noise scene type or the echo scene type, the preset gain value is determined as the first digital gain parameter.
[0033] In an optional embodiment, the digital gain adjustment module is used to:
[0034] Acquire a playback audio signal that is historically input into the audio playback device for playback;
[0035] determining a second digital gain parameter based on the volume of the played audio signal and the volume of the first output audio signal;
[0036] Performing gain processing on the first output audio signal based on the second digital gain parameter to obtain a gained audio signal;
[0037] The third output audio signal is determined based on the gain audio signal.
[0038] In an optional embodiment, the digital gain adjustment module is used to:
[0039] The gain audio signal is enhanced to obtain the third output audio signal.
[0040] In an optional embodiment, the signal playing module is used to:
[0041] Detect whether the input gain parameter input by the user is received;
[0042] If the input gain parameter is not detected, the second output audio signal belonging to the preset standard volume range is input into the audio playback device for playback; if the input gain parameter is detected, the second output audio signal whose volume belongs to the preset standard volume range is gain processed based on the input gain parameter and is input into the audio playback device for playback.
[0043] In a third aspect, the electronic device provided in the present application includes a memory and a processor, the memory stores a computer program, and the processor is used to run the computer program in the memory to implement the steps in the audio signal processing method provided in the present application.
[0044] In a fourth aspect, the computer-readable storage medium provided in the present application stores a plurality of instructions, which are suitable for loading by a processor to implement the steps in the audio signal processing method provided in the present application.
[0045] In a fifth aspect, the computer program product provided in the present application includes a computer program or instructions, which, when executed by a processor, implements the steps in the audio signal processing method provided in the present application.
[0046] In the present application, compared with the related art, after obtaining the first output audio signal output by the audio acquisition device, the first output audio signal is first processed by a preset first digital gain parameter to obtain a second output audio signal. When the volume of the second output audio signal processed by the first digital gain parameter from the software level does not belong to the preset standard volume range, the preset system gain parameter of the audio acquisition device is adjusted, and a secondary adjustment is performed through the audio acquisition device from the hardware level so that the volume of the final second output audio signal belongs to the preset standard volume range, and then the final second output audio signal is played. The audio signal is processed by a comprehensive adjustment method at both the software level and the hardware level, which can overcome the bottleneck of unilateral adjustment at the software level, ensure that the volume of the final second output audio signal belongs to the preset standard volume range, so that the played sound will not be too loud or too soft, and the playback effect of the audio signal can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0048] Figure 1 is a schematic diagram of a scenario of an audio signal processing system provided in an embodiment of the present application;
[0049] Figure 2 is a flowchart of a method for processing an audio signal provided in an embodiment of the present application;
[0050] Figure 3 is a schematic diagram of a volume setting page provided in an embodiment of the present application;
[0051] Figure 4 It is a flow chart of obtaining a second output audio signal by processing a third output audio signal based on a preset first digital gain parameter in the audio signal processing method provided in an embodiment of the present application;
[0052] Figure 5 It is a schematic flow chart of processing a first output audio signal to obtain a third output audio signal in the audio signal processing method provided in an embodiment of the present application;
[0053] Figure 6 is a flowchart of another embodiment of the method for processing an audio signal provided in an embodiment of the present application;
[0054] Figure 7 is a structural schematic diagram of an audio signal processing device provided in an embodiment of the present application;
[0055] Figure 8 is another structural schematic diagram of the audio signal processing device provided in an embodiment of the present application;
[0056] Fig. 9 is a schematic diagram of signal processing in the audio signal processing method provided in an embodiment of the present application;
[0057] Fig.10 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] It should be noted that the principles of the present application are illustrated by implementing them in an appropriate computing environment. The following description is based on the illustrated specific embodiments of the present application and should not be considered as limiting other specific embodiments of the present application that are not described in detail herein.
[0059] In the following description of the present application, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0060] In the following description of the present application, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0062] In order to improve the efficiency of private cloud page code generation, the embodiments of the present application provide an audio signal processing method, an audio signal processing device, an electronic device, a computer-readable storage medium, and a computer program product. The audio signal processing method can be executed by the audio signal processing device, or by an electronic device integrated with the audio signal processing device.
[0063] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0064] Please refer to Figure 1 , the present application also provides an audio signal processing system, such as Figure 1As shown, the audio signal processing system includes an electronic device 100, an audio acquisition device 300, and an audio playback device 400, and the electronic device 100 is integrated with the audio signal processing device provided by the present application. For example, the electronic device 100 can obtain a first output audio signal output by the audio acquisition device, wherein the audio acquisition device processes the collected input audio signal based on a preset system gain parameter to obtain a first output audio signal; when the volume of the first output audio signal does not belong to the preset standard volume interval, the first output audio signal is processed based on a preset first digital gain parameter to obtain a second output audio signal; when the volume of the second output audio signal does not belong to the preset standard volume interval, the preset system gain parameter is adjusted until the volume of the second output audio signal belongs to the preset standard volume interval; the second output audio signal whose volume belongs to the preset standard volume interval is input into the audio playback device for playback.
[0065] The audio collection device 300 may be a microphone, and the audio playback device 400 may be a speaker.
[0066] Among them, the electronic device 100 can be any device equipped with a processor and has processing capabilities, such as mobile electronic devices with processors such as smart phones, tablet computers, PDAs, laptops, smart speakers, or fixed electronic devices with processors such as desktop computers, televisions, servers, industrial equipment, etc.
[0067] In addition, if Figure 1 As shown, the audio signal processing system may further include a memory 200 for storing original data, intermediate data, and result data in the audio processing process. For example, the electronic device 100 acquires a first output audio signal (original data) output by the audio acquisition device, processes the first output audio signal based on a preset first digital gain parameter, and stores the obtained second output audio signal (intermediate data) in the memory 200 by adjusting the preset system gain parameter.
[0068] In the embodiment of the present application, the memory 200 can be a cloud storage. Cloud storage is a new concept extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as the storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
[0069] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID entity, ID). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.
[0070] The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of the Redundant Array of Independent Disks (RAID), the physical storage space is divided into stripes in advance. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.
[0071] It should be noted that Figure 1 The scenario diagram of the audio signal processing system shown is merely an example. The audio signal processing system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the audio signal processing system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is equally applicable to similar technical problems.
[0072] It should be noted that the serial numbers of the following embodiments are not intended to limit the preferred order of the embodiments.
[0073] Please refer to Figure 2 , Figure 2 is a flowchart of a method for processing an audio signal provided in an embodiment of the present application, such as Figure 2 As shown, the process of the audio signal processing method provided by this application is as follows:
[0074] 201. Obtain a first output audio signal output by an audio acquisition device.
[0075] The audio collection device processes the collected input audio signal based on a preset system gain parameter to obtain a first output audio signal.
[0076] In the embodiment of the present application, the audio acquisition device may be an acquisition device such as a microphone. When a person speaks to the audio acquisition device, the audio acquisition device can acquire the input audio signal, and process the acquired input audio signal based on the preset system gain parameter to obtain the first output audio signal. Specifically, the audio acquisition device acquires and outputs the first output audio signal according to a preset period, and obtains the first output audio signal output by the audio acquisition device in the current period, wherein the preset period may be 1s, 0.1s, etc., depending on the specific setting.
[0077] Among them, the preset system gain parameter is used to increase or decrease the sound collected by the microphone. For example, the preset system gain coefficient is 0-100. The user can manually adjust the preset system gain coefficient on the volume setting page. Generally speaking, there is a power amplifier in the microphone. The task of the power amplifier is to amplify the weak electrical signal from the signal source to drive the speaker to make sound. The preset system gain coefficient acts on the power amplifier in the microphone. By adjusting the power of the power amplifier, the sound collected by the microphone is adjusted.
[0078] like Figure 3 As shown, the volume setting page includes a system volume drag bar and an application volume drag bar. When the system volume drag bar is detected to be dragged, the preset system gain coefficient is determined according to the moving distance of the system volume drag bar. When the application volume drag bar is detected to be dragged, the digital gain coefficient of the application is determined according to the moving distance of the application volume drag bar. Among them, the system volume drag bar and the application volume drag bar are independent of each other. If one of the system volume drag bar and the application volume drag bar is dragged, the other will not move.
[0079] 202. When the volume of the first output audio signal does not belong to a preset standard volume range, the first output audio signal is processed based on a preset first digital gain parameter to obtain a second output audio signal.
[0080] In the embodiment of the present application, the volume of the first output audio signal is detected to determine whether the volume of the first output audio signal belongs to a preset standard volume interval. If the volume of the first output audio signal does not belong to the preset standard volume interval, the first output audio signal is processed based on a preset first digital gain parameter to obtain a second output audio signal. If the volume of the first output audio signal belongs to the preset standard volume interval, indicating that the volume of the first output audio signal meets the requirements, the first output audio signal is input into the audio playback device for playback.
[0081] The preset standard volume interval and the first preset number can be determined based on manual experience. For example, the volume range is 0-100, the preset standard volume interval is [40,60], and the first preset number is a preset ratio of the total amount of audio frames on the audio signal, for example, the preset ratio is 80%. When the volume falls into the preset standard volume interval, it indicates that the sound volume at this time meets the needs of the human body.
[0082] In a specific embodiment, the first output audio signal is gain-processed based on the first digital gain parameter to obtain the second output audio signal. Specifically, the first output audio signal is sampled and multiplied by a first digital gain parameter.
[0083] In another specific embodiment, when the volume of the first output audio signal does not belong to the preset standard volume range, the first output audio signal is processed to obtain a third output audio signal; and the third output audio signal is processed based on a preset first digital gain parameter to obtain a second output audio signal. The processing of the first output audio signal may include acoustic echo cancellation (AEC), automatic gain control (AGC), noise suppression (NS), etc., to improve the sound quality.
[0084] The acoustic echo cancellation (AEC) algorithm may be a least mean square algorithm, a normalized least mean square algorithm, a sparse class adaptive algorithm, a sub-band adaptive filter, etc., which may be selected according to the specific situation.
[0085] Automatic Gain Control (AGC) refers to an automatic control method that makes the gain of the amplifier circuit automatically adjust with the signal strength. The circuit that realizes this function is referred to as the AGC loop. The AGC loop is a closed-loop electronic circuit and a negative feedback system. It can be divided into two parts: a gain-controlled amplifier circuit and a control voltage forming circuit. The gain-controlled amplifier circuit is located in the forward amplification path, and its gain changes with the control voltage. The basic components of the control voltage forming circuit are the AGC detector and the low-pass smoothing filter, and sometimes also include components such as gate circuits and DC amplifiers. After the output signal of the amplifier circuit is detected and filtered out by the filter to remove the low-frequency modulation component and noise, a voltage is generated to control the gain-controlled amplifier. There are two control modes of AGC: one is to reduce the gain by increasing the AGC voltage, which is called forward AGC, and the other is to reduce the gain by reducing the AGC voltage, which is called reverse AGC. Forward AGC has strong control ability, large control power required, large range of variation of the operating point of the controlled amplifier stage, and large impedance variation at both ends of the amplifier; reverse AGC requires small control power and small control range.
[0086] Noise Suppression (NS), noise suppression technology is used to eliminate background noise, improve the signal-to-noise ratio and intelligibility of audio signals, and make people and machines hear more clearly. Noise suppression consists of two parts: noise estimation and gain factor estimation.
[0087] 203. When the volume of the second output audio signal does not belong to the preset standard volume range, adjust the preset system gain parameter until the volume of the second output audio signal belongs to the preset standard volume range.
[0088] In the embodiment of the present application, the first output audio signal is processed based on the preset first digital gain parameter to obtain the second output audio signal, and then it is determined whether the sound of the second output audio signal belongs to the preset standard volume interval. When the volume of the second output audio signal does not belong to the preset standard volume interval, it indicates that the volume of the audio signal cannot be adjusted to the preset standard volume interval through the digital gain control at the software level, and it needs to be adjusted through the system gain control at the hardware level, then the preset system gain parameter is adjusted until the volume of the second output audio signal belongs to the preset standard volume interval. When the volume of the second output audio signal belongs to the preset standard volume interval, the second output audio signal is input into the audio playback device for playback.
[0089] In a specific embodiment, adjusting the preset system gain parameter until the volume of the second output audio signal belongs to the preset standard volume range may include: increasing or decreasing the preset system gain parameter to obtain a new preset system gain parameter, repeatedly executing 201-S202 to obtain a new second output audio signal, and if the new second output audio signal does not belong to the preset standard volume range, repeatedly adjusting the preset system gain parameter until the volume of the second output audio signal belongs to the preset standard volume range.
[0090] In another specific embodiment, in order to improve the efficiency of adjusting the preset system gain parameter, adjusting the preset system gain parameter until the volume of the second output audio signal belongs to the preset standard volume interval may include: when the volume of the second output audio signal does not belong to the preset standard volume interval, judging whether the volume of the second output audio signal is greater than the maximum value of the preset standard volume interval, if the volume of the second output audio signal is greater than the maximum value of the preset standard volume interval, reducing the preset system gain parameter by a first predetermined value to obtain a new preset system gain parameter, and executing 201-S202 to obtain a new second output audio signal. Judging whether the volume of the new second output audio signal is greater than the maximum value of the preset standard volume interval, if the new preset system gain parameter is greater than the maximum value of the preset standard volume interval, reducing the second predetermined value to obtain a new preset system gain parameter, and repeatedly adjusting the preset system gain parameter until the volume of the second output audio signal belongs to the preset standard volume interval. Among them, the second predetermined value is greater than the first predetermined value. Increasing the reduction value of the preset system gain parameter in each iteration can improve the adjustment efficiency.
[0091] Further, in order to avoid the audio playback device from playing too loud a sound, when the volume of the second output audio signal does not belong to the preset standard volume interval, it is determined whether the volume of the second output audio signal is greater than the maximum value of the preset standard volume interval. If the volume of the second output audio signal is greater than the maximum value of the preset standard volume interval, a preset linear gain value is obtained, and the second output audio signal is gain-processed based on the preset linear gain value to obtain the second output audio signal after gain processing, and the second output audio signal after gain processing is input into the audio playback device for playback, wherein the linear gain value has a value range of [0,1], when the linear gain value is 1, it is the original sound, when the linear gain value is 0, it is silent, and the linear gain value has a value range of [0,1], then the sound can only be turned down, not increased. When the sound exceeds a certain level and affects the hearing sense, the linear digital gain can be used to reduce the volume, and the linear gain value multiplied by the audio signal level can directly reduce the sound, thereby avoiding the audio playback device from playing too loud a sound.
[0092] 204. Input the second output audio signal whose volume belongs to the preset standard volume range into the audio playback device for playback.
[0093] In an embodiment of the present application, after the volume of the second output audio signal is adjusted to a preset standard volume range through digital gain control at the software level and system gain control at the hardware level, the second output audio signal whose volume belongs to the preset standard volume range is input into the audio playback device for playback.
[0094] Further, after adjusting the preset system gain parameter to the volume of the second output audio signal to belong to the preset standard volume range, the adjusted second output audio signal may not meet the user's requirements, and the user may manually input the input gain parameter. The user may input the gain parameter to the electronic device by text input, dragging the application volume bar, voice input, etc. Figure 3 As shown, the user inputs the input gain parameter by dragging the application volume bar. When it is detected that the user drags the application volume drag bar, the digital gain coefficient of the application is determined according to the distance dragged by the user, and the digital gain coefficient of the application is determined as the input gain parameter.
[0095] Specifically, before the second output audio signal whose volume belongs to a preset standard volume range is input into the audio playback device for playback, the method includes: detecting whether an input gain parameter input by a user is received; if the input gain parameter is not received, inputting the second output audio signal whose volume belongs to the preset standard volume range into the audio playback device for playback; if the input gain parameter is received, performing gain processing on the second output audio signal whose volume belongs to the preset standard volume range based on the input gain parameter, and inputting the signal into the audio playback device for playback.
[0096] For further information, please refer to Figure 4 , Figure 4 FIG. 1 is a flow chart of processing the third output audio signal based on the preset first digital gain parameter to obtain the second output audio signal in the audio signal processing method provided in the embodiment of the present application. Figure 4 As shown, in the embodiment of the present application, the third output audio signal is processed based on the preset first digital gain parameter to obtain the second output audio signal, including:
[0097] 301. Obtain a preset volume gain mapping relationship.
[0098] In the embodiment of the present application, the volume gain mapping relationship includes at least two preset non-standard volume intervals and corresponding digital gain parameters, and each preset non-standard volume interval does not overlap with the preset standard volume interval.
[0099] In a specific embodiment, at least two preset non-standard volume intervals include a first volume amplification interval, a second volume amplification interval, a first volume reduction interval, and a second volume reduction interval. The first volume amplification interval, the second volume amplification interval, the preset standard volume interval, the first volume reduction interval, and the second volume reduction interval are arranged in sequence on the coordinate axis. For example, the first volume amplification interval is [20,30), and the corresponding digital gain parameter is 1.5, the second volume amplification interval is [30,40), and the corresponding digital gain parameter is 1.2, the preset standard volume interval is [40,60), and the corresponding digital gain parameter is 1, the first volume reduction interval is [60,70), and the corresponding digital gain parameter is 0.8, and the second volume reduction interval is [70,80), and the corresponding digital gain parameter is 0.5.
[0100] In another specific embodiment, the volume gain mapping relationship includes a mapping curve between each volume and a digital gain parameter, which can be set manually.
[0101] 302. Determine a digital gain parameter corresponding to the third output audio signal based on a mapping relationship between the volume of the third output audio signal and the volume gain.
[0102] In a specific embodiment, determining a digital gain parameter corresponding to the third output audio signal based on a volume and volume gain mapping relationship of the third output audio signal includes:
[0103] (1) Determining a preset non-standard volume interval into which the volume of the third output audio signal falls based on at least two preset non-standard volume intervals.
[0104] (2) Determine a preset non-standard volume interval within which the volume of the third output audio signal falls as a target volume interval.
[0105] Specifically, if the third output audio signal contains multiple audio frames, the volume of each audio frame in the third output audio signal is obtained; if the volumes of a preset number of audio frames in the third output audio signal all fall into the same preset non-standard volume interval, the preset non-standard volume interval into which the volumes of a preset number of audio frames in the third output audio signal all fall is determined as the preset non-standard volume interval into which the volume of the third output audio signal falls.
[0106] (3) Determine the digital gain parameter corresponding to the target volume range based on the volume gain mapping relationship.
[0107] (4) Determine the digital gain parameter corresponding to the target volume interval as the digital gain parameter corresponding to the third output audio signal.
[0108] 303. Determine a first digital gain parameter based on a digital gain parameter corresponding to the third output audio signal.
[0109] In a specific embodiment, the digital gain parameter corresponding to the third output audio signal is determined as the first digital gain parameter.
[0110] In another specific embodiment, determining the first digital gain parameter based on the digital gain parameter corresponding to the third output audio signal includes:
[0111] (1) Determine whether the digital gain parameter corresponding to the third output audio signal is greater than a preset gain value.
[0112] The preset gain value may be 1. In other embodiments, the preset gain value may be set according to specific conditions and is not limited here.
[0113] (2) If the digital gain parameter corresponding to the third output audio signal is greater than the preset gain value, the sound scene type of the first output audio signal is obtained.
[0114] In an embodiment of the present application, if the digital gain parameter corresponding to the third output audio signal is greater than a preset gain value, it indicates that the digital gain parameter corresponding to the third output audio signal will increase the volume. If the third output audio signal contains echo or noise, the echo or noise will be amplified synchronously. In order to avoid this situation, the first output audio signal is subjected to acoustic scene classification to obtain the sound scene type of the first output audio signal.
[0115] Acoustic Scenes Classification (ASC) is an important technology for computational analysis of natural acoustic scenes. It will be an indispensable component for applications such as intelligent service robots, intelligent transportation, urban noise monitoring, automatic assisted driving, and ecological environment monitoring. In short, acoustic scene classification and sound event detection technology have important research significance and a wide range of applications. The goal of acoustic scene classification is to classify the test record into one of the provided artificial predefined label categories, which describes the environment in which the audio data is recorded.
[0116] (3) If the sound scene type of the first output audio signal does not belong to the noise scene type and does not belong to the echo scene type, the digital gain parameter corresponding to the third output audio signal is determined as the first digital gain parameter; if the sound scene type of the first output audio signal belongs to the noise scene type or the echo scene type, the preset gain value is determined as the first digital gain parameter.
[0117] If the sound scene type of the first output audio signal belongs to the noise scene type or the echo scene type, it indicates that the first output audio signal contains noise or echo. If the gain is performed according to the first digital gain parameter greater than the preset gain value, the noise or echo will also be amplified, which is what we do not want to see. Therefore, in order to avoid the noise or echo being amplified to a large extent, the preset gain value is determined as the first digital gain parameter at this time, so that the first output audio signal with echo or noise is not amplified. Of course, in other embodiments, the digital gain parameter less than the preset gain value can also be determined as the first digital gain parameter to reduce the first output audio signal with echo or noise.
[0118] 304. Perform gain processing on the third output audio signal based on the first digital gain parameter to obtain a second output audio signal.
[0119] Specifically, the first digital gain parameter is multiplied by each signal value of the third output audio signal to obtain the second output audio signal.
[0120] For further information, please refer to Figure 5 , Figure 5 FIG. 1 is a flow chart of processing a first output audio signal to obtain a third output audio signal in the audio signal processing method provided in an embodiment of the present application. Figure 5 As shown, in the embodiment of the present application, the first output audio signal is processed to obtain a third output audio signal, including:
[0121] 401. Obtain a playback audio signal that is historically input into an audio playback device for playback.
[0122] In the embodiment of the present application, the played audio signal is an audio signal that has been played in the past by the audio playback device, which is an echo relative to the first output audio signal currently obtained.
[0123] In a specific embodiment, a playback audio signal input into an audio playback device for playback in a previous preset period is obtained.
[0124] 402. Determine a second digital gain parameter based on the volume of the played audio signal and the volume of the first output audio signal.
[0125] In a specific embodiment, a third digital gain parameter is determined according to a near-end gain determination strategy and the volume of a played audio signal, a fourth digital gain parameter is determined according to a far-end gain determination strategy and the volume of a first output audio signal, and a weighted average of the third digital gain parameter and the fourth digital gain parameter is performed based on the volume of the played audio signal and the volume of the first output audio signal to obtain a second digital gain parameter. The near-end gain determination strategy and the far-end gain determination strategy can be manually set in advance.
[0126] For example, the near-end gain determination strategy is: when the volume is greater than the first preset value, the digital gain parameter is the fifth digital gain parameter, wherein the fifth digital gain parameter is greater than 1; when the volume is less than the second preset value, the digital gain parameter is the sixth digital gain parameter, and when the volume is not greater than the first preset value and not less than the second preset value, the digital gain parameter is determined to be 1, wherein the fifth digital gain parameter is less than 1, the sixth digital gain parameter is greater than 1, the first preset value is greater than the maximum value of the preset standard volume interval, and the second preset value is less than the minimum value of the preset standard volume interval. The far-end gain determination strategy is: when the volume is greater than the third preset value, the digital gain parameter is determined to be the seventh digital gain parameter, wherein the seventh digital gain parameter is less than 1. When the volume of the played audio signal is greater than the third preset value, it indicates that the echo is large, and the volume needs to be reduced at this time. The seventh digital gain parameter being less than 1 will reduce the volume, thereby reducing the echo.
[0127] For example, the near-end gain determination strategy is: when the volume is greater than 80, the digital gain parameter is determined to be 0.8, and when the volume is less than 20, the digital gain parameter is determined to be 1.2. The far-end gain determination strategy is: when the volume is greater than 30, the digital gain parameter is determined to be 0.8. If the volume of the first output audio signal is 60 and the volume of the played audio signal is 40, at this time, the third digital gain parameter is 1, the fourth digital gain parameter is 0.8, and the second digital gain parameter is 1*0.6+0.8*0.4=0.92.
[0128] 403. Perform gain processing on the first output audio signal based on the second digital gain parameter to obtain a gained audio signal.
[0129] Specifically, each signal value of the first output audio signal is multiplied by the second digital gain parameter to obtain a gain audio signal.
[0130] 404. Determine a third output audio signal based on the gain audio signal.
[0131] In a specific embodiment, the gained audio signal is determined as the third output audio signal.
[0132] In another specific embodiment, determining the third output audio signal based on the gain audio signal includes: performing enhancement processing on the gain audio signal to obtain the third output audio signal.
[0133] For further information, please refer to Figure 6 , Figure 6 FIG. 1 is a flow chart of another embodiment of the method for processing an audio signal provided in an embodiment of the present application. Figure 6 As shown, in the embodiment of the present application, the method for processing an audio signal includes:
[0134] 501. Obtain a first output audio signal output by an audio acquisition device in a current cycle.
[0135] The audio collection device processes the collected input audio signal based on a preset system gain parameter to obtain a first output audio signal.
[0136] In the embodiment of the present application, the audio acquisition device may be an acquisition device such as a microphone. When a person speaks to the audio acquisition device, the audio acquisition device can acquire the input audio signal, and process the acquired input audio signal based on the preset system gain parameter to obtain the first output audio signal. Specifically, the audio acquisition device acquires and outputs the first output audio signal according to a preset period, and obtains the first output audio signal output by the audio acquisition device in the current period, wherein the preset period may be 1s, 0.1s, etc., depending on the specific setting.
[0137] Among them, the preset system gain parameter is used to increase or decrease the sound collected by the microphone. For example, the preset system gain coefficient is 0-100. The user can manually adjust the preset system gain coefficient on the microphone setting page. Generally speaking, there is a power amplifier in the microphone. The task of the power amplifier is to amplify the weak electrical signal from the signal source to drive the speaker to make sound. The preset system gain coefficient acts on the power amplifier in the microphone. By adjusting the power of the power amplifier, the sound collected by the microphone is adjusted.
[0138] 502. Determine whether the volume of the first output audio signal belongs to a preset standard volume range.
[0139] In the embodiment of the present application, it is determined whether the volume of the first output audio signal belongs to a preset standard volume range. If the volume of the first output audio signal does not belong to the preset standard volume range, it indicates that the volume of the first output audio signal does not meet the requirements and needs further processing, then 503 is executed. If the volume of the first output audio signal belongs to the preset standard volume range, it indicates that the volume of the first output audio signal meets the requirements, then the first output audio signal is input into the audio playback device for playback.
[0140] 503. Obtain the audio signal input to the audio playback device for playback in the previous cycle.
[0141] In the embodiment of the present application, the played audio signal is an audio signal played in the past by the audio playback device, which is an echo relative to the first output audio signal obtained in the current cycle. If the volume of the first output audio signal does not belong to the preset standard volume range, it indicates that the volume of the first output audio signal does not meet the requirements, and the played audio signal input to the audio playback device for playback in the previous cycle is obtained, and then the gain control is performed according to the played audio signal.
[0142] 504. Determine a second digital gain parameter based on the volume of the played audio signal and the volume of the first output audio signal.
[0143] In the embodiment of the present application, the specific step of 504 can refer to the specific step of 402 in the previous embodiment, which will not be repeated here. Considering the playing audio signal to perform gain control on the current first output audio signal can improve the adjustment accuracy.
[0144] 505. Perform gain processing on the first output audio signal based on the second digital gain parameter to obtain a gained audio signal.
[0145] Specifically, each signal value of the first output audio signal is multiplied by the second digital gain parameter to obtain a gain audio signal.
[0146] 506. Perform enhancement processing on the gain audio signal to obtain a third output audio signal.
[0147] 507. Determine whether the digital gain parameter corresponding to the third output audio signal is greater than a preset gain value.
[0148] In the embodiment of the present application, the digital gain parameter corresponding to the third output audio signal is determined based on the volume and volume gain mapping relationship of the third output audio signal. Specifically, the specific steps of determining the digital gain parameter corresponding to the third output audio signal based on the volume and volume gain mapping relationship of the third output audio signal can refer to the specific steps of 302 in the previous embodiment, which will not be repeated here.
[0149] The preset gain value may be 1. In other embodiments, the preset gain value may be set according to specific conditions and is not limited here. The preset gain value of 1 indicates that no gain processing is performed on the signal.
[0150] Specifically, it is determined whether the digital gain parameter corresponding to the third output audio signal is greater than a preset gain value. If the digital gain parameter corresponding to the third output audio signal is greater than the preset gain value, it indicates that the digital gain parameter corresponding to the third output audio signal will increase the volume. If the third output audio signal contains echo or noise, the echo or noise will be amplified synchronously. To avoid this situation, it is necessary to first determine whether the third output audio signal contains echo or noise, and execute 508. If the digital gain parameter corresponding to the third output audio signal is not greater than the preset gain value, it indicates that the digital gain parameter corresponding to the third output audio signal will reduce the volume. At this time, even if the third output audio signal contains echo or noise, it will not be affected. At this time, the digital gain parameter corresponding to the third output audio signal is determined as the first digital gain parameter.
[0151] 508. Determine whether the sound scene type of the first output audio signal belongs to a noise scene type or an echo scene type.
[0152] In an embodiment of the present application, if the digital gain parameter corresponding to the third output audio signal is greater than a preset gain value, the first output audio signal is subjected to acoustic scene classification to obtain the sound scene type of the first output audio signal, and it is determined whether the sound scene type of the first output audio signal belongs to a noise scene type or an echo scene type.
[0153] If the sound scene type of the first output audio signal belongs to the noise scene type or the echo scene type, execute 509. If the sound scene type of the first output audio signal does not belong to the noise scene type and does not belong to the echo scene type, execute 510.
[0154] 509. Determine the preset gain value as the first digital gain parameter.
[0155] In an embodiment of the present application, if the sound scene type of the first output audio signal belongs to the noise scene type or the echo scene type, it indicates that the first output audio signal contains noise or echo. If the gain is performed according to the first digital gain parameter greater than the preset gain value, the noise or echo will also be amplified, which is what we do not want to see. Therefore, in order to avoid the noise or echo being amplified to a large extent, the preset gain value is determined as the first digital gain parameter. In this way, the first output audio signal with echo or noise is not amplified. Of course, in other embodiments, the digital gain parameter less than the preset gain value can also be determined as the first digital gain parameter to reduce the first output audio signal with echo or noise.
[0156] 510. Determine a digital gain parameter corresponding to the third output audio signal as a first digital gain parameter.
[0157] In the embodiment of the present application, if the sound scene type of the first output audio signal does not belong to the noise scene type and does not belong to the echo scene type, the digital gain parameter corresponding to the third output audio signal is determined as the first digital gain parameter.
[0158] 511. Perform gain processing on the third output audio signal based on the first digital gain parameter to obtain a second output audio signal.
[0159] After the first digital gain parameter is acquired, gain processing is performed on the third output audio signal based on the first digital gain parameter to obtain a second output audio signal.
[0160] 512. Determine whether the volume of the second output audio signal belongs to a preset standard volume range.
[0161] In the embodiment of the present application, it is determined whether the volume of the second output audio signal belongs to the preset standard volume range. If the volume of the second output audio signal does not belong to the preset standard volume range, it indicates that the volume of the audio signal cannot be adjusted to the preset standard volume range through the digital gain control at the software level, and needs to be adjusted through the system gain control at the hardware level, then 513 is executed. When the volume of the second output audio signal belongs to the preset standard volume range, the second output audio signal is input into the audio playback device for playback.
[0162] 513. Adjust a preset system gain parameter until the volume of the second output audio signal falls within a preset standard volume range.
[0163] 514. Detect whether the input gain parameter input by the user is received.
[0164] In the embodiment of the present application, after adjusting the preset system gain parameter to the volume of the second output audio signal belonging to the preset standard volume range, the adjusted second output audio signal may not meet the user's requirements, and the user may manually input the input gain parameter to detect whether the input gain parameter input by the user is received. The user may input the gain parameter to the electronic device through text input, voice input, etc.
[0165] If the input gain parameter input by the user is not received, indicating that the user is satisfied with the currently adjusted second output audio signal, then execute 515. If the input gain parameter input by the user is received, indicating that the user wants to manually adjust the adjusted second output audio signal again, then execute 516.
[0166] 515. Inputting the second output audio signal whose volume belongs to the preset standard volume range into the audio playback device for playback.
[0167] If the input gain parameter input by the user is not received, the second output audio signal whose volume belongs to the preset standard volume range is input into the audio playback device for playback.
[0168] 516. Perform gain processing on the second output audio signal whose volume belongs to the preset standard volume range based on the input gain parameter, and input the second output audio signal into the audio playback device for playback.
[0169] If an input gain parameter input by the user is received, the second output audio signal whose volume belongs to the preset standard volume range is gain-processed based on the input gain parameter, and is input into the audio playback device for playback.
[0170] In order to better implement the audio signal processing method provided in the embodiment of the present application, the embodiment of the present application also provides an audio signal processing device based on the above audio signal processing method. The meanings of the terms are the same as those in the above audio signal processing method. For specific implementation details, please refer to the description in the above method embodiment.
[0171] Please refer to Figure 7 , Figure 7 The structure diagram of the audio signal processing device provided in the embodiment of the present application, the audio signal processing device may include a signal acquisition module 801, a digital gain adjustment module 802, a system gain adjustment module 803, and a signal playback module 804, wherein:
[0172] The signal acquisition module 801 is used to acquire a first output audio signal output by the audio acquisition device, wherein the audio acquisition device processes the collected input audio signal based on a preset system gain parameter to obtain the first output audio signal;
[0173] A digital gain adjustment module 802, configured to process the first output audio signal based on a preset first digital gain parameter to obtain a second output audio signal when the volume of the first output audio signal does not belong to a preset standard volume range;
[0174] The system gain adjustment module 803 is used to adjust the preset system gain parameter so that the volume of the second output audio signal belongs to the preset standard volume range when the volume of the second output audio signal does not belong to the preset standard volume range;
[0175] The signal playing module 804 is used to input the second output audio signal whose volume belongs to the preset standard volume range into the audio playing device for playing.
[0176] In an optional embodiment, the digital gain adjustment module is used to:
[0177] When the volume of the first output audio signal does not belong to the preset standard volume range, processing the first output audio signal to obtain a third output audio signal;
[0178] The third output audio signal is processed based on a preset first digital gain parameter to obtain a second output audio signal.
[0179] Please refer to Figure 8 , Figure 8Another structural schematic diagram of an audio signal processing device provided in an embodiment of the present application, the audio signal processing device may include a signal acquisition module 901, a digital gain adjustment module, a system gain adjustment module 906, a custom adjustment module 907, and a signal playback module 908. The digital gain adjustment module includes a scene detection module 902, a first digital gain adjustment module 903, a noise reduction and acoustic echo cancellation module 904, and a second digital gain adjustment module 905. The scene detection module 902 is used to detect the sound scene type of the first output audio signal, wherein,
[0180] The signal acquisition module 901 is used to acquire a first output audio signal output by the audio acquisition device, wherein the audio acquisition device processes the collected input audio signal based on a preset system gain parameter to obtain the first output audio signal;
[0181] A digital gain adjustment module, used for processing the first output audio signal based on a preset first digital gain parameter to obtain a second output audio signal when the volume of the first output audio signal does not belong to a preset standard volume range;
[0182] A system gain adjustment module 906, configured to adjust a preset system gain parameter to make the volume of the second output audio signal fall within the preset standard volume range when the volume of the second output audio signal does not fall within the preset standard volume range;
[0183] The signal playing module 908 is used to input the second output audio signal whose volume belongs to the preset standard volume range into the audio playing device for playing.
[0184] In an optional embodiment, the second digital gain adjustment module 905 is used to:
[0185] Get the preset volume gain mapping relationship;
[0186] Determine a digital gain parameter corresponding to the third output audio signal based on a mapping relationship between the volume and the volume gain of the third output audio signal;
[0187] determining a first digital gain parameter based on a digital gain parameter corresponding to the third output audio signal;
[0188] The third output audio signal is gain-processed based on the first digital gain parameter to obtain a second output audio signal.
[0189] In an optional embodiment, the volume gain mapping relationship includes at least two preset non-standard volume intervals and corresponding digital gain parameters, and each preset non-standard volume interval does not overlap with the preset standard volume interval;
[0190] The second digital gain adjustment module 905 is used to:
[0191] determining, based on at least two preset non-standard volume intervals, a preset non-standard volume interval into which the volume of the third output audio signal falls;
[0192] determining a preset non-standard volume interval within which the volume of the third output audio signal falls as a target volume interval;
[0193] Determine a digital gain parameter corresponding to a target volume interval based on a volume gain mapping relationship;
[0194] The digital gain parameter corresponding to the target volume interval is determined as the digital gain parameter corresponding to the third output audio signal.
[0195] In an optional embodiment, the second digital gain adjustment module 905 is used to:
[0196] Determining whether the digital gain parameter corresponding to the third output audio signal is greater than a preset gain value;
[0197] If the digital gain parameter corresponding to the third output audio signal is greater than the preset gain value, obtaining the sound scene type of the first output audio signal;
[0198] If the sound scene type of the first output audio signal does not belong to the noise scene type and does not belong to the echo scene type, the digital gain parameter corresponding to the third output audio signal is determined as the first digital gain parameter; if the sound scene type of the first output audio signal belongs to the noise scene type or the echo scene type, the preset gain value is determined as the first digital gain parameter.
[0199] In an optional embodiment, the first digital gain adjustment module 903:
[0200] Acquire a playback audio signal that is historically input into an audio playback device for playback;
[0201] determining a second digital gain parameter based on the volume of the played audio signal and the volume of the first output audio signal;
[0202] Performing gain processing on the first output audio signal based on the second digital gain parameter to obtain a gain audio signal;
[0203] A third output audio signal is determined based on the gain audio signal.
[0204] In an optional embodiment, the noise reduction and acoustic echo cancellation module 904 is used to:
[0205] The gain audio signal is enhanced to obtain a third output audio signal.
[0206] In an optional embodiment, the custom adjustment module 907 is used to detect whether the input gain parameter input by the user is received;
[0207] The signal playback module 908 is used to input the second output audio signal belonging to the preset standard volume range into the audio playback device for playback if the input gain parameter is not detected; if the input gain parameter is detected, the second output audio signal whose volume belongs to the preset standard volume range is gain processed based on the input gain parameter, and input it into the audio playback device for playback.
[0208] The specific implementation of each of the above modules can be found in the previous embodiments and will not be described in detail here.
[0209] In this embodiment, the signal acquisition module 801 first acquires the first output audio signal output by the audio acquisition device, wherein the audio acquisition device processes the collected input audio signal based on the preset system gain parameter to obtain the first output audio signal; then, when the volume of the first output audio signal does not belong to the preset standard volume range, the digital gain adjustment module 802 processes the first output audio signal based on the preset first digital gain parameter to obtain the second output audio signal; then, when the volume of the second output audio signal does not belong to the preset standard volume range, the system gain adjustment module 803 adjusts the preset system gain parameter until the volume of the second output audio signal belongs to the preset standard volume range; finally, the signal playback module 804 inputs the second output audio signal whose volume belongs to the preset standard volume range into the audio playback device for playback. Compared with the related art, after obtaining the first output audio signal output by the audio acquisition device, the first output audio signal is first processed by a preset first digital gain parameter to obtain a second output audio signal. When the volume of the second output audio signal processed by the first digital gain parameter from the software level does not belong to the preset standard volume range, the preset system gain parameter of the audio acquisition device is adjusted, and a secondary adjustment is performed through the audio acquisition device from the hardware level, so that the volume of the final second output audio signal belongs to the preset standard volume range, and then the final second output audio signal is played. The audio signal is processed by a comprehensive adjustment method at both the software level and the hardware level, which can overcome the bottleneck of unilateral adjustment at the software level, ensure that the volume of the final second output audio signal belongs to the preset standard volume range, so that the played sound will not be too loud or too soft, and the playback effect of the audio signal can be improved.
[0210] For further information, see Fig. 9 , Fig. 9 It is a schematic diagram of signal processing in the audio signal processing method provided in an embodiment of the present application.
[0211] Combination Figure 8 and Fig. 9, the signal processing process in the audio signal processing method provided in the present application is as follows: the audio acquisition device 300 acquires the input audio signal, and the audio acquisition device 300 processes the acquired input audio signal based on the preset system gain parameter to obtain the first output audio signal. The scene detection module 902 performs scene and volume detection on the first output audio signal, obtains the sound scene type and volume of the first output audio signal, and transmits them to the first digital gain adjustment module 903 and the second digital gain adjustment module 905. The first digital gain adjustment module 903 obtains the playback audio signal played by the historical input audio playback device 400 in the cache. The first digital gain adjustment module 903 performs remote volume detection on the playback audio signal played by the historical input audio playback device 400 to obtain the volume of the playback audio signal. The first digital gain adjustment module 903 determines the second digital gain parameter based on the volume of the playback audio signal and the volume of the first output audio signal; and performs gain processing on the first output audio signal based on the second digital gain parameter to obtain a gain audio signal. The noise reduction and acoustic echo cancellation module 904 obtains the remote signal, performs noise reduction and acoustic echo cancellation processing on the gain audio signal according to the remote signal, and obtains the third output audio signal. The second digital gain adjustment module 905 determines the digital gain parameter corresponding to the third output audio signal based on the volume and volume gain mapping relationship of the third output audio signal; determines the first digital gain parameter based on the digital gain parameter corresponding to the third output audio signal; performs gain processing on the third output audio signal based on the first digital gain parameter to obtain the second output audio signal. The second digital gain adjustment module 905 sends the second output audio signal to the remote end, that is, the audio playback device 400 side, through codec network transmission and other methods. The remote end performs signal buffering for the first digital gain adjustment module 903 to call when performing remote volume detection, and for the noise reduction and acoustic echo cancellation module 904 to obtain the remote signal. The second output audio signal is input into the audio playback device 400 for playback after being adjusted by the user.
[0212] Please refer to Fig.10 , Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0213] The electronic device may include components such as a processor 101 with one or more processing cores, a memory 102 with one or more computer-readable storage media, a power supply 103, and an input unit 104. Those skilled in the art will appreciate that Fig.10 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0214] The processor 101 is the control center of the electronic device, which uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 102, and calling data stored in the memory 102. Optionally, the processor 101 may include one or more processing cores; optionally, the processor 101 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 101.
[0215] The memory 102 can be used to store software programs and modules. The processor 101 executes various functional applications and data processing by running the software programs and modules stored in the memory 102. The memory 102 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 102 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 102 may also include a memory controller to provide the processor 101 with access to the memory 102.
[0216] The electronic device also includes a power supply 103 for supplying power to each component. Optionally, the power supply 103 can be logically connected to the processor 101 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 103 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0217] The electronic device may further include an input unit 104, which may 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.
[0218] Although not shown, the electronic device may also include a display unit, an image acquisition element, etc., which will not be described in detail here. Specifically in this embodiment, the processor 101 in the electronic device will load the executable code corresponding to one or more computer programs into the memory 102 according to the following instructions, and the processor 101 will execute the steps in the audio signal processing method provided in the present application, such as:
[0219] A first output audio signal output by an audio acquisition device is obtained, wherein the audio acquisition device processes the collected input audio signal based on a preset system gain parameter to obtain a first output audio signal; when the volume of the first output audio signal does not belong to a preset standard volume range, the first output audio signal is processed based on a preset first digital gain parameter to obtain a second output audio signal; when the volume of the second output audio signal does not belong to the preset standard volume range, the preset system gain parameter is adjusted until the volume of the second output audio signal belongs to the preset standard volume range; and the second output audio signal whose volume belongs to the preset standard volume range is input into an audio playback device for playback.
[0220] It should be noted that the electronic device provided in the embodiment of the present application and the method for processing audio signals in the above embodiment belong to the same concept, and its specific implementation process is detailed in the above related embodiments and will not be repeated here.
[0221] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program stored therein is executed on a processor of an electronic device provided in an embodiment of the present application, the processor of the electronic device executes the steps in the audio signal processing method provided in the present application. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0222] The present application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes various optional implementations of the above-mentioned audio signal processing method.
[0223] The above is a detailed introduction to an audio signal processing method and device provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technicians in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
[0224] It should be noted that when the above embodiments of the present application are applied to specific products or technologies, the relevant data of the user is involved, and the user's permission or consent is required, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
Claims
1. A method for processing an audio signal, characterized in that: include: Acquire a first output audio signal output by an audio acquisition device, wherein the audio acquisition device processes the collected input audio signal based on a preset system gain parameter to obtain the first output audio signal; When the volume of the first output audio signal does not belong to the preset standard volume range, the first output audio signal is processed based on a preset first digital gain parameter to obtain a second output audio signal; When the volume of the second output audio signal does not belong to the preset standard volume range, adjusting the preset system gain parameter until the volume of the second output audio signal belongs to the preset standard volume range; The second output audio signal whose volume belongs to the preset standard volume range is input into the audio playing device for playing.
2. The method for processing an audio signal according to claim 1, characterized in that: When the volume of the first output audio signal does not belong to the preset standard volume range, the first output audio signal is processed based on a preset first digital gain parameter to obtain a second output audio signal, including: When the volume of the first output audio signal does not belong to the preset standard volume range, processing the first output audio signal to obtain a third output audio signal; The third output audio signal is processed based on a preset first digital gain parameter to obtain a second output audio signal.
3. The method for processing an audio signal according to claim 2, characterized in that: The step of processing the third output audio signal based on a preset first digital gain parameter to obtain a second output audio signal includes: Get the preset volume gain mapping relationship; Determining a digital gain parameter corresponding to the third output audio signal based on the volume of the third output audio signal and the volume gain mapping relationship; determining the first digital gain parameter based on the digital gain parameter corresponding to the third output audio signal; The third output audio signal is subjected to gain processing based on the first digital gain parameter to obtain a second output audio signal.
4. The method for processing an audio signal according to claim 3, characterized in that: The volume gain mapping relationship includes at least two preset non-standard volume intervals and corresponding digital gain parameters, and each of the preset non-standard volume intervals does not overlap with the preset standard volume interval; The determining the digital gain parameter corresponding to the third output audio signal based on the volume of the third output audio signal and the volume gain mapping relationship includes: determining, based on at least two of the preset non-standard volume intervals, a preset non-standard volume interval into which the volume of the third output audio signal falls; determining a preset non-standard volume interval within which the volume of the third output audio signal falls as a target volume interval; Determine the digital gain parameter corresponding to the target volume interval based on the volume gain mapping relationship; The digital gain parameter corresponding to the target volume interval is determined as the digital gain parameter corresponding to the third output audio signal.
5. The method for processing an audio signal according to claim 3, characterized in that: The determining the first digital gain parameter based on the digital gain parameter corresponding to the third output audio signal includes: Determining whether the digital gain parameter corresponding to the third output audio signal is greater than a preset gain value; If the digital gain parameter corresponding to the third output audio signal is greater than a preset gain value, obtaining the sound scene type of the first output audio signal; If the sound scene type of the first output audio signal does not belong to the noise scene type and does not belong to the echo scene type, the digital gain parameter corresponding to the third output audio signal is determined as the first digital gain parameter; if the sound scene type of the first output audio signal belongs to the noise scene type or the echo scene type, the preset gain value is determined as the first digital gain parameter.
6. The method for processing an audio signal according to claim 2, characterized in that: The processing of the first output audio signal to obtain a third output audio signal includes: Acquire a playback audio signal that is historically input into the audio playback device for playback; determining a second digital gain parameter based on the volume of the played audio signal and the volume of the first output audio signal; Performing gain processing on the first output audio signal based on the second digital gain parameter to obtain a gained audio signal; The third output audio signal is determined based on the gain audio signal.
7. The method for processing an audio signal according to claim 6, characterized in that: The determining the third output audio signal based on the gain audio signal comprises: The gain audio signal is enhanced to obtain the third output audio signal.
8. The method for processing an audio signal according to claim 1, characterized in that: Before inputting the second output audio signal whose volume belongs to the preset standard volume range into the audio playback device for playback, the method includes: Detect whether the input gain parameter input by the user is received; If the input gain parameter is not detected, the second output audio signal belonging to the preset standard volume range is input into the audio playback device for playback; if the input gain parameter is detected, the second output audio signal whose volume belongs to the preset standard volume range is gain processed based on the input gain parameter and is input into the audio playback device for playback.
9. An audio signal processing device, characterized in that: include: A signal acquisition module, configured to acquire a first output audio signal output by an audio acquisition device, wherein the audio acquisition device processes the collected input audio signal based on a preset system gain parameter to obtain the first output audio signal; a digital gain adjustment module, configured to process the first output audio signal based on a preset first digital gain parameter to obtain a second output audio signal when the volume of the first output audio signal does not belong to a preset standard volume range; a system gain adjustment module, configured to adjust the preset system gain parameter so that the volume of the second output audio signal falls within the preset standard volume range when the volume of the second output audio signal does not fall within the preset standard volume range; The signal playing module is used to input the second output audio signal whose volume belongs to the preset standard volume range into the audio playing device for playing.
10. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the steps in the method for processing an audio signal according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the audio signal processing method according to any one of claims 1 to 8.
12. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps in the method for processing an audio signal according to any one of claims 1 to 8 are implemented.
