Volume adjusting method and related device
By mixing ultrasonic signals with sound signals, using reflected ultrasonic signals to determine the energy ratio, and automatically adjusting the volume, the problem of poor user experience caused by improper volume adjustment in the existing technology is solved, adaptive volume adjustment is achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202410390522.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-01
- Publication Date
- 2025-10-14
AI Technical Summary
Existing volume adjustment methods, when adjusted manually or adaptively, can easily cause the volume to be too loud or too quiet, affecting the user experience. In addition, adaptive adjustment cannot provide effective feedback based on the user's actual auditory perception.
By mixing ultrasonic signals with sound signals, using the reflected ultrasonic signals to determine the energy ratio, and adjusting the volume according to the energy ratio, adaptive adjustment is achieved to improve user experience.
No manual adjustment is required. The larger the energy ratio, the closer the target object is to the microphone, and the volume is automatically increased, improving the user experience and avoiding problems with excessive or insufficient volume.
Smart Images

Figure CN120780263A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a volume adjustment method and related devices. Background Art
[0002] With the development of computer technology, two volume adjustment methods are provided in related technologies. One volume adjustment method is that the user manually adjusts the volume of the device using the device's volume adjustment key according to their own needs; the other volume adjustment method is that the device adaptively adjusts the volume of the device according to the noise level in the environment.
[0003] However, when adjusting the volume manually, the volume may be too loud or too soft due to misoperation by the user, thereby affecting the user's user experience; when adjusting the volume through adaptive adjustment, when the noise level in the environment is high, the volume needs to be adjusted to a higher level, which may cause the volume of the device to exceed the physical volume, thereby affecting the user's user experience. Summary of the Invention
[0004] The embodiments of the present application provide a volume adjustment method and related devices, aiming to solve the problem of poor user experience caused by improper volume adjustment.
[0005] A first aspect of the present application provides a volume adjustment method, comprising:
[0006] Acquiring an ultrasonic signal and a reflected ultrasonic signal; the ultrasonic signal indicates a signal sent after being mixed with the sound signal; the reflected ultrasonic signal indicates a signal received after the ultrasonic signal is sent;
[0007] determining an energy ratio based on the ultrasonic signal and the reflected ultrasonic signal; the energy ratio indicating a distance between the target microphone and the target object;
[0008] When the energy ratio is greater than a preset energy ratio, the volume of the sound signal is adjusted based on the energy ratio.
[0009] A second aspect of the present application provides a volume adjustment device, comprising:
[0010] An acquisition module, configured to acquire an ultrasonic signal and a reflected ultrasonic signal; the ultrasonic signal indicates a signal sent after being mixed with a sound signal; the reflected ultrasonic signal indicates a signal received after the ultrasonic signal is sent;
[0011] an energy ratio determination module, configured to determine an energy ratio based on the ultrasonic signal and the reflected ultrasonic signal; the energy ratio indicating a distance between the target microphone and the target object;
[0012] The volume adjustment module is used to adjust the volume of the sound signal based on the energy ratio when the energy ratio is greater than a preset energy ratio.
[0013] Optionally, the volume adjustment module includes:
[0014] A Fourier transform unit, used to perform Fourier transform on the sound signal to obtain multiple frequency points corresponding to the sound signal;
[0015] A gain coefficient acquisition unit is used to obtain the gain coefficient corresponding to each frequency point; the gain coefficient is obtained based on the perceptual weighting coefficient and the gain factor of the corresponding frequency point; the gain factor is obtained based on the energy ratio value;
[0016] A first volume adjustment unit is used to adjust the corresponding frequency points based on each gain coefficient to obtain a plurality of adjusted frequency points;
[0017] The inverse Fourier transform unit is used to perform inverse Fourier transform on the multiple adjusted frequency points to obtain a sound signal with adjusted volume.
[0018] Optionally, the volume adjustment unit is specifically configured to:
[0019] Determine the frequency domain complex value corresponding to each frequency point;
[0020] Multiplying each gain coefficient by the frequency domain complex value of the corresponding frequency point to obtain the adjusted frequency domain complex value corresponding to each frequency point;
[0021] The inverse Fourier transform unit is specifically used to:
[0022] The multiple adjusted frequency domain complex values are subjected to inverse Fourier transform to obtain a sound signal with adjusted volume.
[0023] Optionally, the perceptual weighting coefficient is obtained by:
[0024] A loudness value determination module is used to determine the loudness value corresponding to each frequency point;
[0025] The perceptual weighting coefficient determination module is used to determine the perceptual weighting coefficient of the corresponding frequency point based on each loudness value.
[0026] Optionally, the loudness value is obtained by:
[0027] An equal loudness parameter determination module is used to determine the equal loudness parameter corresponding to a target frequency point; the target frequency point is any frequency point among multiple frequency points; the equal loudness parameter is obtained based on the equal loudness curve; the equal loudness curve indicates the relationship between frequency and sound intensity level;
[0028] The loudness value determination module is used to determine the loudness value corresponding to the target frequency point according to the equal loudness parameter.
[0029] Optionally, the volume adjustment module includes:
[0030] A volume gain determining unit, configured to determine a corresponding volume gain according to the energy ratio;
[0031] The second volume adjustment unit is used to perform a multiplication operation on the volume gain and the sound signal to obtain a sound signal after volume adjustment.
[0032] Optionally, the energy ratio determination module is specifically configured to determine the energy ratio based on the ultrasonic signal and the reflected ultrasonic signal by any one of time difference measurement, amplitude measurement, frequency modulation or phase measurement.
[0033] A third aspect of the present application provides a volume adjustment device, the device comprising a processor and a memory:
[0034] The memory is used to store program code and transmit the program code to the processor;
[0035] The processor is configured to execute the steps of the volume adjustment method provided in the first aspect according to the instructions in the program code.
[0036] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the steps of the volume adjustment method provided in the first aspect.
[0037] A fifth aspect of the present application provides a computer program product, including a computer program or instructions, which, when executed, implements the steps of the volume adjustment method provided in the first aspect.
[0038] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0039] In the technical solution of the present application, an ultrasonic signal and a sound signal are mixed and sent, and a reflected ultrasonic signal corresponding to the ultrasonic signal is received, and an energy ratio is further determined based on the ultrasonic signal and the reflected ultrasonic signal, wherein the energy ratio can reflect the distance between the target microphone and the target object, without the need for manual adjustment, thereby improving the user experience, and when the energy ratio is greater than a preset value, the volume of the sound signal is adjusted according to the energy ratio, that is, the larger the energy ratio, the closer the target object is to the target microphone, and the volume of the sound signal needs to be increased, thereby achieving adaptive adjustment and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of an application scenario of a volume adjustment method provided in an embodiment of the present application;
[0041] Figure 2A flow chart of a volume adjustment method provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of a microphone and a speaker of a mobile phone provided in an embodiment of the present application;
[0043] Figure 4 A schematic diagram of a terminal device provided in an embodiment of the present application being close to the ear of a user;
[0044] Figure 5 A schematic diagram of a perceptual weighting coefficient provided in an embodiment of the present application;
[0045] Figure 6 A schematic diagram of an acoustic equal loudness curve provided in an embodiment of the present application;
[0046] Figure 7 A flow chart of another volume adjustment method provided in an embodiment of the present application;
[0047] Figure 8 A schematic structural diagram of a volume adjustment device provided in an embodiment of the present application;
[0048] Figure 9 A schematic diagram of a server structure provided in an embodiment of the present application;
[0049] Figure 10 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] Currently, the volume adjustment methods in the related art are mainly divided into two methods: manual volume adjustment and adaptive volume adjustment.
[0051] Manual volume adjustment refers to the user increasing or decreasing the volume using the volume adjustment buttons on the terminal device or the volume adjustment buttons on the software interface. After the user increases or decreases the volume using the volume adjustment buttons on the terminal device or the volume adjustment buttons on the software interface, the terminal device's software (sound playback software, audio call software, etc.) will adjust the sound signal gain according to a specific volume adjustment algorithm design logic to achieve the desired volume.
[0052] Among them, the volume adjustment algorithm design mainly includes fixed gain adjustment and adaptive gain adjustment. Fixed gain adjustment is that the software of the terminal device multiplies the fixed gain value preset or sent from the background with the amplitude of each sample point of the sound signal to obtain the sound signal after volume adjustment. Adaptive gain adjustment is based on the target sound level value (such as the target energy dB value) preset or sent from the background, and makes a valid signal judgment on the current input sound signal. For example, VAD (Voice Activity Detection, voice activity detection algorithm) determines whether the current frame signal is a voice or non-voice category, and performs a level value detection on the valid signal, and further calculates the multiple relationship between the level detection value and the target sound level value as the adaptive gain value. Then, by multiplying the input sound signal with the adaptive gain value, the level value of the input sound signal is dynamically close to the target sound level value, so that the volume of the input sound signal meets the expected effect of the software.
[0053] Adaptive volume adjustment adjusts the volume based on the noise level of the listener's current acoustic environment. As an example, assume that the user is in a listening state (such as listening to the radio, making calls, etc.). If the environment in which the user is located is relatively noisy, the terminal device will collect external sounds through the microphone while playing the sound, and first remove the echo component in the collected signal through the echo cancellation algorithm. Then, the noise level of each frequency band of the collected signal after the echo is removed is measured. When the noise level in the frequency band exceeds the playback signal, that is, the playback signal is masked by the noise signal, the masked frequency band will be amplified through the frequency band volume adjustment method, so that the user can avoid the masking of the playback content by the environmental noise and can hear the playback content clearly without interference.
[0054] However, the manual volume adjustment method requires the user to manually operate the volume adjustment button for control. On the one hand, the user needs to know the physical location of the volume adjustment button in advance, or needs to check the virtual volume adjustment button on the screen for control, which may interrupt the user's call or listening process, and further may miss the normal listening content when adjusting the volume, affecting the user experience; on the other hand, if the user triggers the wrong adjustment without understanding the direction of the volume adjustment, the volume may be abnormal. For example, the user expects to adjust the volume of the sound being played from 12 to 1, but if the user does not understand the direction of the volume adjustment, the volume of the sound being played may be adjusted from 12 to 15, resulting in the volume being too loud, thus affecting the user experience.
[0055] At the same time, the volume adjustment algorithm design provided in the related art mainly performs algorithm tuning operations based on the characteristics of the sound signal itself. Although it can play a certain role in signal amplification or reduction, the adaptive volume adjustment method cannot be based on effective feedback from the user's real auditory perception, but can only be based on approximation and adjustment of the preset target of the signal. If an adaptive adjustment algorithm is added and the actual playback volume effect of the terminal device is ignored, the original signal may be amplified in order to achieve the preset signal target. The final played sound will be too loud, which will cause the user to feel uncomfortable in hearing and lead to a poor user experience.
[0056] The adaptive volume adjustment method only considers acoustic environmental factors. The microphone used to pick up ambient sound may not be consistent with the ambient noise actually heard by the human ear. For example, the noise is close to one side of the microphone, and the noise heard by the human ear is smaller. However, the microphone will adjust the volume based on the larger noise collected, resulting in the adjusted volume heard by the human ear not meeting expectations, affecting the user experience.
[0057] In view of the above problems, a volume adjustment method and related devices are provided in the present application, which include: after mixing the ultrasonic signal and the sound signal and sending them, receiving the reflected ultrasonic signal corresponding to the ultrasonic signal, and further determining the energy ratio based on the ultrasonic signal and the reflected ultrasonic signal, wherein the energy ratio can reflect the distance between the target microphone and the target object, without the need for manual adjustment, thereby improving the user experience, and when the energy ratio is greater than a preset value, adjusting the volume of the sound signal according to the energy ratio, that is, the larger the energy ratio, the closer the target object is to the target microphone, and the volume of the sound signal needs to be increased to achieve adaptive adjustment and improve the user experience.
[0058] See also Figure 1 , this figure is a schematic diagram of an application scenario of a volume adjustment method provided in an embodiment of the present application, and the application scenario includes a volume adjustment device 101 and a server 102.
[0059] The volume adjustment device 101 and the server 102 can transmit a signal that is a mixture of an ultrasonic signal and a sound signal, and obtain a reflected ultrasonic signal after the ultrasonic signal is transmitted. As an example, assume that a call comes in on the mobile phone of target subject A, and target subject A answers the call using the handset. At this time, the mobile phone can output and play a mixture of ultrasonic signal X and sound signal Y. After the ultrasonic signal X is played, part of the ultrasonic signal X will be reflected by the target subject's face or ear, and the target microphone of the mobile phone can receive this part of the signal (i.e., the reflected ultrasonic signal X').
[0060] Volume adjustment device 101 and server 102 can determine an energy ratio based on the ultrasonic signal and the reflected ultrasonic signal. The energy ratio indicates the distance between the target microphone and the target object. For example, assuming the energy of ultrasonic signal X is 100 and the energy of reflected ultrasonic signal X' is 50, the energy ratio is the ratio of reflected ultrasonic signal X' to ultrasonic signal X, i.e., an energy ratio of 0.5.
[0061] When the energy ratio is greater than a preset energy ratio, the volume adjustment device 101 or the server 102 adjusts the volume of the sound signal based on the energy ratio.
[0062] The volume adjustment method provided in the embodiment of the present application is achieved by mixing an ultrasonic signal with a sound signal and sending the mixed signal, receiving a reflected ultrasonic signal corresponding to the ultrasonic signal, and further determining an energy ratio based on the ultrasonic signal and the reflected ultrasonic signal, wherein the energy ratio can reflect the distance between the target microphone and the target object, without the need for manual adjustment, thereby improving the user experience, and when the energy ratio is greater than a preset value, the volume of the sound signal is adjusted according to the energy ratio, that is, the larger the energy ratio is, the closer the target object is to the target microphone, and the volume of the sound signal needs to be increased, thereby achieving adaptive adjustment and improving the user experience.
[0063] The volume adjustment method provided in the embodiment of the present application can be applied to a terminal device or server with data processing capabilities. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal device includes but is not limited to mobile phones, tablets, computers, computers, intelligent voice interaction devices, smart home appliances, car terminals, etc., but is not limited to these. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
[0064] The volume adjustment method provided in the embodiments of the present application involves artificial intelligence.
[0065] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also involves studying the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0066] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, pre-trained models, operating / interaction systems, and mechatronics. Pre-trained models, also known as large models or basic models, can be fine-tuned and widely applied to downstream tasks across various AI disciplines. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0067] The collection and processing of relevant data in this application should be strictly in accordance with the requirements of relevant national laws and regulations when applied in practice, and the informed consent or separate consent of the subject of personal information should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the subject of personal information.
[0068] See also Figure 2 , which is a flow chart of a volume adjustment method provided in an embodiment of the present application.
[0069] Combine Figure 2 As shown, the volume adjustment method provided in the embodiment of the present application may include:
[0070] S201: Acquire an ultrasonic signal and a reflected ultrasonic signal.
[0071] The ultrasonic signal indicates a signal sent after being mixed with a sound signal, wherein the ultrasonic signal may be an ultrasonic wave signal, which refers to a sound wave with a frequency higher than the upper limit of human hearing (about 20KHz).
[0072] It should be understood that if Figure 3 As shown, Figure 3A schematic diagram of a mobile phone's microphone and speaker is shown. When the user listens to content in handset mode, the user's face and ear are close to the speaker. When the playback volume is low, the user moves closer to the speaker to hear the content clearly. Therefore, the user's current call behavior (such as unclear hearing or too loud) can be judged to determine whether the user needs to adjust the volume. As an example, if the user feels that the speaker volume is not loud enough, the user will hold the phone's speaker as close to their ear as possible to hear the content played by the phone. If the acoustic environment is relatively noisy, the user will also hold the phone close to their face or ear to bring their ear closer to the speaker to reduce the interference of ambient noise on the playback content. Furthermore, since ultrasonic signals are sound waves above the upper limit of human hearing, the ultrasonic signal can be mixed with the sound signal to be played and played back, so that the user's current call behavior can be judged based on the signal reflected by the ultrasonic signal (i.e., the reflected ultrasonic signal). The ultrasonic signal and the sound signal can be played together through the speaker on the mobile phone, and the user will only hear the played sound and not the ultrasonic signal.
[0073] The reflected ultrasonic signal indicates the signal received after the ultrasonic signal was transmitted. After the ultrasonic signal reflects off the user's face or ear, part of the signal (the reflected ultrasonic signal) returns to the phone's microphone, which then collects the reflected ultrasonic signal.
[0074] S202: Determine an energy ratio based on the ultrasonic signal and the reflected ultrasonic signal.
[0075] The energy ratio refers to the ratio between the reflected ultrasonic signal and the ultrasonic signal, and the energy ratio indicates the distance between the target microphone and the target object, such as Figure 4 As shown. The target microphone refers to the microphone of the terminal device used by the target object. The target object refers to the object listening to the sound of the terminal device, and can also be called the user object. The distance between the target microphone and the target object refers to the shortest distance between the target microphone and the face or ear of the target object. In some cases, this distance can indicate the distance between the target microphone and other parts of the target object (such as hands, shoulders, etc.), which is not specifically limited here.
[0076] In some possible implementations, the energy ratio may be determined based on the ultrasonic signal and the reflected ultrasonic signal through any one of time difference measurement, amplitude measurement, frequency modulation, or phase measurement.
[0077] Time difference measurement refers to sending an ultrasonic signal, recording the first time of sending the ultrasonic signal and the second time of receiving the reflected ultrasonic signal, calculating the time difference between the first time and the second time, and then calculating the distance between the target microphone and the target object based on the speed of sound and the time difference. That is, the energy ratio can be calculated by the speed of sound and the time difference.
[0078] Frequency modulation refers to calculating the distance between the target microphone and the target object by using the frequency change of the received reflected ultrasonic signal. It should be understood that since the transmitted ultrasonic signal has a certain frequency, when the ultrasonic signal is reflected by the target object, a Doppler response is generated, thereby calculating the distance between the target microphone and the target object based on the change between the frequency of the ultrasonic signal and the frequency of the reflected ultrasonic signal. That is, the energy ratio can be calculated by the frequency of the reflected ultrasonic signal.
[0079] Phase measurement refers to calculating the distance between the target microphone and the target object by using the phase difference between the transmitted ultrasonic signal and the received reflected ultrasonic signal. In other words, the energy ratio can be calculated from the phase difference.
[0080] Amplitude measurement refers to measuring the amplitude of the ultrasonic signal and the reflected ultrasonic signal using the attenuation of the ultrasonic signal propagating in the air, and determining the distance between the target microphone and the target object based on the two amplitude values. In other words, the energy ratio can be determined by the amplitude value.
[0081] As an example, taking amplitude measurement as an example, the ultrasonic signal played by the speaker of a mobile phone can be a single-frequency sound above 20kHz. For example, the generation formula of a 21kHz signal is: x(i) = A*sin(2*pi*21000*i), where i represents the audio sample point number value and A is the ultrasonic amplitude. The final played signal is x(i) + x0(i), where x0(i) is the original sound signal to be played and x(i) is the ultrasonic signal. While playing the mixed sound signal, the mixed sound signal is collected through the microphone of the mobile phone, and the 21kHz signal in the mixed sound signal is extracted (specifically, the signal in the ultrasonic frequency band can be extracted through high-pass filtering or high-frequency spectrum analysis of the signal), and the component energy of the extracted reflected ultrasonic signal (that is, the 21kHz signal) is analyzed.
[0082] It should be understood that any of the following processing methods, including time difference measurement, amplitude measurement, frequency modulation, or phase measurement, has high measurement accuracy, typically reaching millimeter-level accuracy. It can also measure over a wide range of distances, typically several meters or even further. Ultrasonic waves have good reflection properties on most objects, effectively detecting the position and distance of objects. In other words, using any of these processing methods, the energy ratio can be determined with high precision, and thus the distance between the target microphone and the target object can be determined with high accuracy, facilitating subsequent precise adjustment of the sound signal volume and improving the user experience.
[0083] S203: When the energy ratio is greater than a preset energy ratio, the volume of the sound signal is adjusted based on the energy ratio.
[0084] The preset energy ratio refers to the maximum energy ratio at which the volume of the sound signal is not adjusted. For example, the preset energy ratio is 0.6. When the energy ratio is greater than 0.6, the volume of the sound signal needs to be adjusted according to the energy ratio.
[0085] It should be understood that if the energy ratio is less than the preset energy ratio, it can be considered that the distance between the target microphone and the target object is far, and the target object can hear the played sound clearly. In this case, there is no need to adjust the volume of the sound signal.
[0086] The volume adjustment method provided in the embodiment of the present application receives a reflected ultrasonic signal corresponding to the ultrasonic signal after mixing the ultrasonic signal and sending the mixed signal, and further determines an energy ratio based on the ultrasonic signal and the reflected ultrasonic signal, wherein the energy ratio can reflect the distance between the target microphone and the target object, without the need for manual adjustment, thereby improving the user experience. When the energy ratio is greater than a preset value, the volume of the sound signal is adjusted according to the energy ratio, that is, the larger the energy ratio, the closer the target object is to the target microphone, and the volume of the sound signal needs to be increased, thereby achieving adaptive adjustment and improving the user experience.
[0087] Based on the volume adjustment method provided in the above embodiment, in a possible implementation, step S203 may include:
[0088] A1: Determine the corresponding volume gain based on the energy ratio.
[0089] Volume gain refers to the process or operation of amplifying a sound signal. In audio processing, volume gain can be achieved by adjusting the gain value of the sound signal. The gain value indicates the degree of amplification and is expressed in decibels (dB). Positive gain values increase the volume of the sound signal, while negative gain values decrease it.
[0090] It should be understood that in the embodiment of the present application, the value of the volume gain can be mapped by the energy ratio, and the volume of the sound signal can be further adjusted according to the value of the volume gain.
[0091] A2: Multiply the volume gain by the sound signal to obtain a sound signal with adjusted volume.
[0092] It should be understood that by multiplying the volume gain with the sound signal, the volume of the sound signal can be adjusted. The volume gain can increase the amplitude of the sound signal to make it louder or clearer, that is, the audibility and quality of the sound signal can be improved by the volume gain.
[0093] However, since the overall volume gain adjustment may cause distortion due to the signal being amplified to exceed the upper limit of the digital signal amplitude, in order to achieve a greater gain adjustment for the frequency band sensitive to the human ear without distortion, in another possible implementation, step S203 may include:
[0094] B1: Perform Fourier transform on the sound signal to obtain multiple frequency points corresponding to the sound signal.
[0095] The Fourier transform is a mathematical tool that converts a time-domain signal into a frequency-domain signal. It can decompose a continuous time-domain signal into a superposition of a series of sine and cosine waves of different frequencies. The frequencies of these sine and cosine waves are the frequencies corresponding to the sound signal.
[0096] It should be understood that the Fourier transform can decompose a sound signal into components of different frequencies, thereby obtaining information about each frequency contained in the sound signal. These frequency components correspond to different tones or frequency characteristics in the sound signal. In the Fourier transform result, each frequency point corresponds to an amplitude and phase. The amplitude represents the intensity or energy of the frequency point in the original signal, while the phase represents the starting phase of the frequency point.
[0097] B2: Get the gain coefficient corresponding to each frequency point.
[0098] The gain coefficient refers to the ratio between the pre- and post-modulation signals at a given frequency. The gain coefficient indicates the degree of amplification or attenuation of the sound signal after processing by the system or device. The gain coefficient can be derived based on the perceptual weighting coefficient and the gain factor for the corresponding frequency.
[0099] The perceptual weighting coefficient is a measure of human perception of sound. It can be used to assess a subject's auditory sensitivity and hearing ability. In one possible implementation, the perceptual weighting coefficient can be obtained by determining the loudness value corresponding to each frequency point and, based on each loudness value, determining the perceptual weighting coefficient for the corresponding frequency point.
[0100] As an example, combining Figure 5 As shown, Figure 5 This is a schematic diagram of a perceptual weighting coefficient provided in an embodiment of the present application. In this embodiment of the present application, the perceptual weighting coefficient at each frequency can be determined by the following formula (1):
[0101] cof(freq)=(10^loud / 20) / 1000; formula (1)
[0102] Wherein, cof(freq) represents the perceptual weighting coefficient corresponding to the target frequency, freq represents the value of the target frequency, and loud represents the loudness value corresponding to the target frequency.
[0103] Among them, by using the perceptual weighting coefficient to quantify the auditory perception, the human auditory perception of different audio signals can be quantified, so as to facilitate subsequent equalization processing based on the auditory perception and further improve the user experience.
[0104] "Loudness" varies primarily with the intensity of the sound, but is also affected by frequency. Sounds of the same intensity but different frequencies have different auditory perceptions in the human ear. Loudness refers to a person's subjective perception of sound intensity, and can also be understood as the subjective loudness of a sound. Loudness is related to the amplitude of the sound's physical parameter; the larger the amplitude, the louder the sound. Therefore, the volume of a sound signal can be adjusted by increasing the "loudness," making it clearer. In one possible implementation, the loudness value can be obtained in the following way:
[0105] C1: Determine the equal loudness parameters corresponding to the target frequency.
[0106] The target frequency is any frequency among the multiple frequency points; the equal loudness parameter is obtained based on the equal loudness curve; and the equal loudness curve indicates the relationship between frequency and sound intensity level.
[0107] See also Figure 6 , which is a schematic diagram of an acoustic equal loudness curve provided in an embodiment of the present application. An equal loudness curve is a curve that describes the relationship between the sound pressure level and the sound wave frequency under equal loudness conditions. It is called an equal loudness curve and is one of the important auditory characteristics. That is, what sound pressure level does pure tone at different frequencies need to reach in order to obtain the same auditory loudness for the listener. As an example, Figure 6From any equal loudness curve on the graph, it can be seen that the lower the frequency of the mid-low frequency (below 1kHz), the greater the sound pressure intensity (energy) required for equal loudness, that is, a greater sound energy is required to give the human ear the same auditory experience, while different frequency bands of the mid-high frequency (above 1kHz) have different acoustic auditory perception characteristics.
[0108] Therefore, in the embodiment of the present application, it is necessary to determine the equal loudness parameter corresponding to the target frequency point, and determine the loudness value corresponding to the target frequency point based on the equal loudness parameter.
[0109] C2: Determine the loudness value corresponding to the target frequency based on the equal loudness parameters.
[0110] As an example, in the embodiment of the present application, loudness can be calculated based on the psychoacoustic equal-loudness curve data of the BS3383 standard "BS 3383 Specification for normal equal-loudness level contours for pure tones under free-field listening conditions". Specifically, the loudness value can be calculated using the following formulas (2) to (5):
[0111] afy=af(j-1)+(freq-ff(j-1))*(af(j)-af(j-1)) / (ff(j)-ff(j-1)); formula (2);
[0112] bfy=bf(j-1)+(freq-ff(j-1))*(bf(j)-bf(j-1)) / (ff(j)-ff(j-1)); Formula (3);
[0113] cfy=cf(j-1)+(freq-ff(j-1))*(cf(j)-cf(j-1)) / (ff(j)-ff(j-1)); Formula (4);
[0114] loud=4.2+afy*(dB-cfy) / (1+bfy*(dB-cfy)); formula (5);
[0115] Among them, freq is the value of the target frequency point, ff, af, bf, and cf correspond to the data in the equal loudness curve data disclosed in BS3383. That is, ff, af, bf, and cf are equal loudness parameters, loud represents the loudness value of the target frequency, and dB represents the sound intensity or volume corresponding to the target frequency.
[0116] In the embodiment of the present application, a linear interpolation method may be used to interpolate the equal loudness curve data, thereby obtaining a loudness value corresponding to a target frequency point.
[0117] The gain factor is a parameter used to describe the gain relationship between the input signal and the output signal. The gain factor represents the amplification or reduction of the output sound signal relative to the input sound signal. The gain factor is usually used to measure the amplification or attenuation capability of the system and can be a real value or a complex value. In one implementation, the gain factor can be obtained based on the energy ratio. It should be noted that there is a positive correlation between the gain factor and the energy ratio. In some possible implementations, the energy ratio can be used to search a pre-set mapping table to obtain the gain factor; in other possible implementations, a function can be constructed based on the energy ratio and the gain factor, in which the energy ratio is positively correlated with the gain factor. Then, when there is an energy ratio, the energy ratio can be substituted into the function to obtain the gain factor.
[0118] B3: Adjust the corresponding frequency points based on each gain coefficient to obtain multiple adjusted frequency points.
[0119] In one possible implementation, step B2 may include: determining a frequency domain complex value corresponding to each frequency point; and multiplying each gain coefficient by the frequency domain complex value corresponding to the frequency point to obtain an adjusted frequency domain complex value corresponding to each frequency point. Furthermore, the adjusted frequency domain complex values may be inverse Fourier transformed to obtain a sound signal after volume adjustment.
[0120] As an example, assuming that the gain factor a corresponds to the energy ratio, the perceptual weighting coefficient corresponding to each frequency point is cof(freq), and the gain factor a is multiplied by the perceptual weighting coefficient cof(freq) corresponding to each frequency point to obtain the gain coefficient fac(freq) = a*cof(freq), and then the gain coefficient of each frequency point is multiplied by the frequency domain complex value corresponding to each frequency point. For example, the frequency domain complex value of the i-th frequency point of the sound signal after Fourier transform is v0+v1*i, and the center frequency value corresponding to the i-th frequency point is f0. Then the final frequency domain complex value after the volume of the i-th frequency point is fac(f0)*v0+fac(f0)*v1*i.
[0121] It should be understood that in the embodiment of the present application, the corresponding frequency points are adjusted by various gain coefficients.
[0122] B4: Perform inverse Fourier transform on the multiple adjusted frequency points to obtain a sound signal with adjusted volume.
[0123] Inverse Fourier transform is the inverse operation of Fourier transform, which is used to convert the frequency domain signal back to the time domain signal, that is, to convert the plurality of adjusted frequency points to the sound signal with volume adjustment. Fourier transform is a mathematical tool for converting signal from time domain to frequency domain, while inverse Fourier transform converts the frequency domain signal back to the original time domain signal.
[0124] In the embodiments of the present application, by converting the sound signal into a plurality of frequency points through Fourier transform and adjusting the corresponding frequency points by using the respective gain coefficients, the problem of breaking sound caused by signal amplification exceeding the upper limit of digital signal amplitude after overall volume gain adjustment can be avoided, and greater gain adjustment of the human ear sensitive frequency band can be obtained without breaking sound.
[0125] Based on the volume adjustment method provided in the above embodiments, referring to Figure 7 , the figure is a flowchart of another volume adjustment method provided in the embodiments of the present application.
[0126] In combination with Figure 7 , the volume adjustment method provided in the embodiments of the present application can include:
[0127] S701: Collecting the reflected ultrasonic signal through the microphone.
[0128] It should be understood that after the terminal device plays the mixed sound signal, the mixed playing signal can be collected through the microphone, and the reflected ultrasonic signal can be extracted from the playing signal, the reflected ultrasonic signal being part of the signal returned through the face or ear of the target object after the ultrasonic signal is played.
[0129] S702: Determining the energy ratio based on the ultrasonic signal and the reflected ultrasonic signal.
[0130] The process of determining the energy ratio in step S702 is the same as the process of determining the energy ratio in step S202 of the above embodiments, and the related explanation and description can be referred to the explanation and description of step S202, which will not be repeated here.
[0131] S703: Judging whether the energy ratio exceeds the preset energy ratio.
[0132] It should be understood that the energy ratio can reflect the distance between the target microphone and the target object. That is, the larger the energy ratio, the further the distance between the target microphone and the target object, and the more likely it is that the target object cannot clearly hear the sound played by the terminal device. When the energy ratio is greater than the preset energy ratio, the volume of the sound signal needs to be adjusted so that the target object can clearly hear the content played, that is, step S704 is executed. Conversely, if the energy ratio is less than or equal to the preset energy ratio, it is considered that the target object can clearly hear the sound played by the terminal device, and the volume of the sound signal does not need to be adjusted, and step S701 can be repeated.
[0133] S704: Mapping a volume gain or a gain factor according to the energy ratio.
[0134] The volume gain refers to the absolute volume adjustment of the sound signal, and the gain factor is used to adjust the perceived volume of the sound signal.
[0135] S705: Perform absolute volume adjustment or perceptual volume adjustment on the sound signal.
[0136] It should be understood that the embodiment of the present application may include two volume adjustment methods, one is to adjust the volume of the sound signal absolutely based on the volume gain, and the other is to adjust the volume of the sound signal perceptually through the gain factor.
[0137] The process of absolute volume adjustment is the same as the volume adjustment process of steps A1 to A2 in the above embodiment, and the process of perceived volume adjustment is the same as the implementation process of steps B1 to B4 in the above embodiment, which will not be repeated here.
[0138] S706: Mix the ultrasonic signal with the adjusted sound signal and play them.
[0139] It should be understood that after adjusting the sound signal, the adjusted sound signal needs to be mixed with the ultrasonic signal and played, and the reflected ultrasonic signal corresponding to the ultrasonic signal needs to be reacquired to determine whether the adjusted volume meets the needs of the target object, so as to further adjust the volume of the sound signal.
[0140] Based on the volume adjustment method provided in the above embodiment, the present application also provides a volume adjustment device, see Figure 8 , which is a structural schematic diagram of a volume adjustment device provided in an embodiment of the present application.
[0141] Combine Figure 8 As shown, the volume adjustment device 800 provided in the embodiment of the present application may include:
[0142] An acquisition module 801 is configured to acquire an ultrasonic signal and a reflected ultrasonic signal; the ultrasonic signal indicates a signal sent after being mixed with a sound signal; the reflected ultrasonic signal indicates a signal received after the ultrasonic signal is sent;
[0143] an energy ratio determination module 802 for determining an energy ratio based on the ultrasonic signal and the reflected ultrasonic signal; the energy ratio indicates the distance between the target microphone and the target object;
[0144] The volume adjustment module 803 is configured to adjust the volume of the sound signal based on the energy ratio when the energy ratio is greater than a preset energy ratio.
[0145] Optionally, the volume adjustment module 803 includes:
[0146] A Fourier transform unit, used to perform Fourier transform on the sound signal to obtain multiple frequency points corresponding to the sound signal;
[0147] A gain coefficient acquisition unit is used to obtain the gain coefficient corresponding to each frequency point; the gain coefficient is obtained based on the perceptual weighting coefficient and the gain factor of the corresponding frequency point; the gain factor is obtained based on the energy ratio value;
[0148] A first volume adjustment unit is used to adjust the corresponding frequency points based on each gain coefficient to obtain a plurality of adjusted frequency points;
[0149] The inverse Fourier transform unit is used to perform inverse Fourier transform on the multiple adjusted frequency points to obtain a sound signal with adjusted volume.
[0150] Optionally, the volume adjustment unit is specifically configured to:
[0151] Determine the frequency domain complex value corresponding to each frequency point;
[0152] Multiplying each gain coefficient by the frequency domain complex value of the corresponding frequency point to obtain the adjusted frequency domain complex value corresponding to each frequency point;
[0153] The inverse Fourier transform unit is specifically used to:
[0154] The multiple adjusted frequency domain complex values are subjected to inverse Fourier transform to obtain a sound signal with adjusted volume.
[0155] Optionally, the perceptual weighting coefficient is obtained by:
[0156] A loudness value determination module is used to determine the loudness value corresponding to each frequency point;
[0157] The perceptual weighting coefficient determination module is used to determine the perceptual weighting coefficient of the corresponding frequency point based on each loudness value.
[0158] Optionally, the loudness value is obtained by:
[0159] An equal loudness parameter determination module is used to determine the equal loudness parameter corresponding to a target frequency point; the target frequency point is any frequency point among multiple frequency points; the equal loudness parameter is obtained based on the equal loudness curve; the equal loudness curve indicates the relationship between frequency and sound intensity level;
[0160] The loudness value determination module is used to determine the loudness value corresponding to the target frequency point according to the equal loudness parameter.
[0161] Optionally, the volume adjustment module 803 includes:
[0162] A volume gain determining unit, configured to determine a corresponding volume gain according to the energy ratio;
[0163] The second volume adjustment unit is used to perform a multiplication operation on the volume gain and the sound signal to obtain a sound signal after volume adjustment.
[0164] Optionally, the energy ratio determination module 802 is specifically configured to determine the energy ratio based on the ultrasonic signal and the reflected ultrasonic signal by any one of time difference measurement, amplitude measurement, frequency modulation or phase measurement.
[0165] The volume adjustment device provided in the embodiment of the present application has the same beneficial effects as the volume adjustment method provided in the above embodiment, and will not be described in detail here.
[0166] The following describes the structures in terms of server and terminal device forms respectively.
[0167] Figure 9 : This is a schematic diagram of a server structure provided by an embodiment of the present application. The server 900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 922 (for example, one or more processors) and memories 932, and one or more storage media 930 (for example, one or more mass storage devices) for storing application programs 942 or data 944. Among them, the memories 932 and the storage media 930 can be temporary storage or permanent storage. The program stored in the storage medium 930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 922 can be configured to communicate with the storage medium 930 to execute a series of instruction operations in the storage medium 930 on the server 900.
[0168] The server 900 may also include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input and output interfaces 958, and / or one or more operating systems 941, such as Windows Server 2003 or Windows Server 2003R. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.
[0169] The CPU 922 is configured to execute the following steps:
[0170] Acquiring an ultrasonic signal and a reflected ultrasonic signal; the ultrasonic signal indicates a signal sent after being mixed with the sound signal; the reflected ultrasonic signal indicates a signal received after the ultrasonic signal is sent;
[0171] determining an energy ratio based on the ultrasonic signal and the reflected ultrasonic signal; the energy ratio indicating a distance between the target microphone and the target object;
[0172] When the energy ratio is greater than a preset energy ratio, the volume of the sound signal is adjusted based on the energy ratio.
[0173] The present application also provides another volume adjustment device, such as Figure 10 For ease of explanation, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. The terminal can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (English full name: Personal Digital Assistant, English abbreviation: PDA), a sales terminal (English full name: Point of Sales, English abbreviation: POS), a car computer, etc., taking the mobile phone as an example:
[0174] Figure 10 The block diagram shows a partial structure of a mobile phone related to the terminal provided in the embodiment of the present application. Figure 10 The mobile phone includes components such as a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, a processor 1080, and a power supply 1090. Those skilled in the art will appreciate that Figure 10 The mobile phone structure shown in the figure does not constitute a limitation to the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0175] The following will be described in detail Figure 10 The various components of the mobile phone will be described in detail:
[0176] The RF circuit 1010 can be used for receiving and sending signals in the process of information or communication, in particular, receiving the downlink information of the base station and processing it by the processor 1080; in addition, sending the uplink data to the base station. Generally, the RF circuit 1010 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 1010 can also communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), Email, Short Messaging Service (SMS), etc.
[0177] The memory 1020 can be used to store software programs and modules, and the processor 1080 executes various functions of the mobile phone and data processing by running the software programs and modules stored in the memory 1020. The memory 1020 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1020 can include a high-speed random access memory, and can also include a non-volatile memory, for example, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device.
[0178] The input unit 1030 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by the user using any suitable object or accessory such as a finger, stylus, etc. on or near the touch panel 1031) and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 1031 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction and detects the signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 1080. It can also receive commands sent by the processor 1080 and execute them. In addition, the touch panel 1031 can be implemented using various types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch panel 1031, the input unit 1030 may further include other input devices 1032. Specifically, the other input devices 1032 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick.
[0179] The display unit 1040 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 1040 may include a display panel 1041. Optionally, the display panel 1041 may be configured in the form of a liquid crystal display (English full name: Liquid Crystal Display, English abbreviation: LCD), an organic light-emitting diode (English full name: Organic Light-Emitting Diode, English abbreviation: OLED), etc. Further, the touch panel 1031 may cover the display panel 1041. When the touch panel 1031 detects a touch operation on or near it, it is transmitted to the processor 1080 to determine the type of touch event. Subsequently, the processor 1080 provides corresponding visual output on the display panel 1041 according to the type of touch event. Although in Figure 10 In the embodiment, the touch panel 1031 and the display panel 1041 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 1031 and the display panel 1041 can be integrated to realize the input and output functions of the mobile phone.
[0180] The mobile phone may also include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 1041 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that the mobile phone can also be configured with, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be described here.
[0181] Audio circuit 1060, speaker 1061, and microphone 1062 provide an audio interface between the user and the phone. Audio circuit 1060 converts received audio data into electrical signals and transmits them to speaker 1061, which then converts them into sound signals for output. Microphone 1062, on the other hand, converts collected sound signals into electrical signals, which are then received by audio circuit 1060 and converted into audio data. The audio data is then processed by processor 1080 and transmitted to, for example, another phone via RF circuit 1010, or stored in memory 1020 for further processing.
[0182] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse the web and access streaming media through the WiFi module 1070. It provides users with wireless broadband Internet access. Figure 10 A WiFi module 1070 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.
[0183] Processor 1080 is the control center of the phone, connecting all parts of the phone using various interfaces and circuits. By running or executing software programs and / or modules stored in memory 1020 and accessing data stored in memory 1020, it executes various phone functions and processes data, thereby collecting data and information about the phone as a whole. Optionally, processor 1080 may include one or more processing units; preferably, processor 1080 may integrate an application processor and a modem processor, where the application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 1080.
[0184] The mobile phone also includes a power supply 1090 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 1080 through a power management system, thereby managing charging, discharging, and power consumption through the power management system.
[0185] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0186] In the embodiment of the present application, the processor 1080 included in the terminal further has the following functions:
[0187] Acquiring an ultrasonic signal and a reflected ultrasonic signal; the ultrasonic signal indicates a signal sent after being mixed with the sound signal; the reflected ultrasonic signal indicates a signal received after the ultrasonic signal is sent;
[0188] determining an energy ratio based on the ultrasonic signal and the reflected ultrasonic signal; the energy ratio indicating a distance between the target microphone and the target object;
[0189] When the energy ratio is greater than a preset energy ratio, the volume of the sound signal is adjusted based on the energy ratio.
[0190] An embodiment of the present application further provides a computer-readable storage medium for storing program code, wherein the program code is used to execute any one of the implementations of the volume adjustment method described in the aforementioned embodiments.
[0191] The embodiments of the present application further provide a computer program product including instructions, which, when executed on a computer, enables the computer to execute any one of the implementations of the volume adjustment method described in the aforementioned embodiments.
[0192] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems and devices can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0193] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the system is merely a logical function division. In actual implementation, there may be other division methods, such as multiple systems can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0194] The systems described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the objectives of this embodiment as needed.
[0195] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0196] 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 computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English full name: Read-Only Memory, English abbreviation: ROM), random access memory (English full name: Random Access Memory, English abbreviation: RAM), disk or optical disk and other media that can store program code.
[0197] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A volume adjustment method, characterized in that: The method comprises: Acquiring an ultrasonic signal and a reflected ultrasonic signal; the ultrasonic signal indicates a signal sent after being mixed with a sound signal; the reflected ultrasonic signal indicates a signal received after the ultrasonic signal is sent; determining an energy ratio based on the ultrasonic signal and the reflected ultrasonic signal; the energy ratio indicating a distance between a target microphone and a target object; When the energy ratio is greater than a preset energy ratio, the volume of the sound signal is adjusted based on the energy ratio.
2. The method according to claim 1, characterized in that The adjusting the volume of the sound signal based on the energy ratio includes: Performing Fourier transform on the sound signal to obtain multiple frequency points corresponding to the sound signal; Obtaining a gain coefficient corresponding to each of the frequency points; the gain coefficient is obtained based on a perceptual weighting coefficient and a gain factor of the corresponding frequency point; the gain factor is obtained based on the energy ratio; Adjusting the corresponding frequency points based on each of the gain coefficients to obtain a plurality of adjusted frequency points; Performing inverse Fourier transform on the multiple adjusted frequency points to obtain a sound signal with adjusted volume.
3. The method according to claim 2, characterized in that The step of adjusting the corresponding frequency points based on the gain coefficients to obtain a plurality of adjusted frequency points includes: Determine the frequency domain complex value corresponding to each of the frequency points; Performing a multiplication operation on each of the gain coefficients and the frequency domain complex value of the corresponding frequency point to obtain an adjusted frequency domain complex value corresponding to each of the frequency points; The step of performing an inverse Fourier transform on the multiple adjusted frequency points to obtain a sound signal with adjusted volume includes: The multiple adjusted frequency domain complex values are subjected to inverse Fourier transform to obtain a sound signal with adjusted volume.
4. The method according to claim 2, characterized in that The perceptual weighting coefficient is obtained in the following way: Determine the loudness value corresponding to each of the frequency points; A perception weighting coefficient of a corresponding frequency point is determined based on each of the loudness values.
5. The method according to claim 3, characterized in that The loudness value is obtained by: Determine an equal loudness parameter corresponding to a target frequency point; the target frequency point is any frequency point among the multiple frequency points; the equal loudness parameter is obtained based on an equal loudness curve; The equal loudness curve indicates the relationship between frequency and sound intensity level; The loudness value corresponding to the target frequency point is determined according to the equal loudness parameter.
6. The method according to claim 1, characterized in that The adjusting the volume of the sound signal based on the energy ratio includes: Determining a corresponding volume gain according to the energy ratio; The volume gain is multiplied by the sound signal to obtain a sound signal after volume adjustment.
7. The method according to claim 1, characterized in that The determining of the energy ratio based on the ultrasonic signal and the reflected ultrasonic signal includes: Based on the ultrasonic signal and the reflected ultrasonic signal, the energy ratio is determined by any one of time difference measurement, amplitude measurement, frequency modulation or phase measurement.
8. A volume adjustment device, characterized in that: The device comprises: an acquisition module, configured to acquire an ultrasonic signal and a reflected ultrasonic signal; the ultrasonic signal indicates a signal sent after being mixed with a sound signal; the reflected ultrasonic signal indicates a signal received after the ultrasonic signal is sent; an energy ratio determination module, configured to determine an energy ratio based on the ultrasonic signal and the reflected ultrasonic signal; the energy ratio indicating a distance between a target microphone and a target object; The volume adjustment module is configured to adjust the volume of the sound signal based on the energy ratio when the energy ratio is greater than a preset energy ratio.
9. A volume adjustment device, characterized in that: The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the steps of the volume adjustment method according to any one of claims 1 to 7 according to the instructions in the program code.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store program codes, and the program codes are used to execute the steps of the volume adjustment method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The method comprises a computer program or an instruction, which implements the steps of the volume adjustment method according to any one of claims 1 to 7 when the computer program or the instruction is executed.