Volume adjustment method, electronic equipment and storage medium
By identifying ambient audio and dynamically adjusting the volume and gain, the problem of inappropriate volume in different environments is solved, and a better auditory experience is achieved.
Patent Information
- Application Number
- CN202411806819.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-22
AI Technical Summary
In the prior art, the volume adjustment method statically adjusts the volume, making it difficult to effectively deal with the audio input changes in different environments, which may lead to insufficient volume in noisy environments or too loud in quiet environments.
By obtaining the target audio, identifying the ambient audio and the audio to be output, adjusting the volume according to the ambient audio, and making gain adjustments to the output audio to be output, obtaining the target volume and target intensity, and outputting the audio to be output according to these parameters.
It realizes dynamic adjustment of volume according to environmental changes and algorithm gain, adapting to different environments, improving auditory experience, and avoiding inappropriate volume in noisy or quiet environments.
Smart Images

Figure CN119865734A_ABST
Abstract
Description
Technical Field
[0001] The present application mainly relates to the field of computer technology, and in particular to a volume adjustment method, an electronic device and a storage medium. Background Art
[0002] Volume adjustment is an important part of audio processing, which involves adjusting the amplitude of the audio signal at different stages to achieve the purpose of changing the volume. In the current technological environment, volume adjustment of electronic devices (such as mobile phones) faces several key challenges.
[0003] Traditional methods usually adjust the volume statically, relying on manual settings by the user or simple automatic adjustments. This makes it difficult to effectively cope with changes in audio input in different environments, which may result in insufficient volume in noisy environments or too loud in quiet environments. Summary of the invention
[0004] The main purpose of the present application is to provide a volume adjustment method, an electronic device and a storage medium to solve the problem of static volume adjustment in existing solutions, relying on manual settings or simple automatic adjustment, so as to achieve dynamic adjustment of the volume according to different environmental changes and algorithm gain.
[0005] To solve the above problems, the present application provides a volume adjustment method, an electronic device and a storage medium. The volume adjustment method includes: obtaining a target audio, and identifying the ambient audio and the audio to be output in the target audio; adjusting the volume according to the ambient audio to obtain a target volume, and adjusting the gain of the audio to be output to obtain a target intensity; and outputting the audio to be output according to the target volume and the target intensity.
[0006] In one embodiment, adjusting the volume according to the ambient audio to obtain the target volume includes: identifying the ambient audio to obtain a noise level corresponding to the ambient audio; and adjusting the volume according to the noise level to obtain the target volume.
[0007] In one embodiment, identifying ambient audio and obtaining a noise level corresponding to the ambient audio includes: in response to the noise corresponding to the ambient audio being greater than or equal to a set threshold, determining that the noise level corresponding to the ambient audio is a first noise level; in response to the noise corresponding to the ambient audio being less than the set threshold, determining that the noise level corresponding to the ambient audio is a second noise level; wherein the first noise level is higher than the second noise level.
[0008] In one embodiment, the volume is adjusted according to the noise level to obtain the target volume, including: in response to the noise level corresponding to the ambient audio being a first noise level, setting it to a first mode and adjusting the volume intensity; in response to the noise level corresponding to the ambient audio being a second noise level, setting it to a second mode and adjusting the volume intensity; wherein the volume intensity corresponding to the first mode is greater than the volume intensity corresponding to the second mode.
[0009] In one embodiment, adjusting the volume according to the ambient audio to obtain the target volume includes: obtaining a current volume mode; and adjusting the volume in combination with the current volume mode and the ambient audio to obtain the target volume.
[0010] In one embodiment, the target volume is obtained by adjusting the volume in combination with the current volume mode and the ambient audio, including: in response to the current volume mode being a scene setting, obtaining a first volume parameter corresponding to the scene setting, and adjusting the volume in combination with the first volume parameter and the ambient audio to obtain the target volume; in response to the current volume mode being a preference setting, obtaining a second volume parameter corresponding to the preference setting, and adjusting the volume in combination with the second volume parameter and the ambient audio to obtain the target volume.
[0011] In one embodiment, the preference setting is set in the following manner: receiving a volume intensity interval set by a user; wherein each application corresponds to a volume intensity interval and / or each scene corresponds to a volume intensity interval.
[0012] In one embodiment, performing gain adjustment on the audio to be output to obtain a target intensity includes: extracting intensity information and spectrum information from the audio to be output; and performing gain adjustment on the intensity information and the spectrum information to obtain the target intensity.
[0013] To solve the above problems, the present application also provides an electronic device, which includes: a memory; a processor, connected to the memory, and the processor is configured to execute the volume adjustment method described in any one of the above embodiments.
[0014] To solve the above problems, the present application also provides a computer-readable storage medium, in which program data is stored. When the program data is executed by a processor, it is used to implement the volume adjustment method described in any of the above embodiments.
[0015] The present application provides a volume adjustment method, an electronic device, and a storage medium, which identify ambient audio and audio to be output in a target audio; adjust the volume according to the ambient audio to obtain a target volume, and adjust the gain of the audio to be output to obtain a target intensity; output the audio to be output according to the target volume and target intensity, so that the output audio to be output can adapt to the current environment, solve the problem of insufficient volume in a noisy environment or too loud in a quiet environment, and improve the listening experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0017] Figure 1 It is a schematic diagram of the steps of an embodiment of a volume adjustment method provided by the present application;
[0018] Figure 2 It is a schematic diagram of the steps of the second embodiment of the volume adjustment method provided by the present application;
[0019] Figure 3 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application;
[0020] Figure 4 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION
[0021] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It will be appreciated that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only some but not all structures related to the present application are shown in the drawings. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the art without making creative work are within the scope of protection of the present application.
[0022] The terms "first", "second", etc. in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0023] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0024] The volume adjustment function in smartphones is one of the functions that needs to be operated frequently in daily use. By understanding the principle of volume adjustment, we can better master the skills of volume control and optimize the user experience. In the current technical environment, mobile phone volume adjustment faces several key challenges. Traditional methods usually adjust the volume statically, relying on manual settings by users or simple automatic adjustments. It is difficult to effectively cope with changes in audio input in different environments, which may result in insufficient volume in noisy environments or too loud in quiet environments.
[0025] Therefore, the present application provides a volume adjustment method, an electronic device and a storage medium to solve the above problems.
[0026] See also Figure 1 , Figure 1 1 is a flow chart of steps of an embodiment of a volume adjustment method provided by the present application; wherein the volume adjustment method specifically comprises the following steps:
[0027] Step S10: Acquire target audio, and identify ambient audio and audio to be output in the target audio.
[0028] In one embodiment, the target audio is analyzed in real time by a digital signal processing analysis algorithm, that is, a DSP (Digital Signal Processor) is used to process the audio, wherein the DSP chip has high-speed digital signal processing capabilities and can quickly perform complex mathematical operations. The audio data is processed using digital signal processing technology, including real-time audio gain adjustment, environmental noise estimation, volume control algorithms, etc. This usually involves the use of algorithms such as filtering, equalizers, and compressors to optimize audio quality and response speed.
[0029] In another embodiment, the AGC algorithm is used to dynamically adjust the gain or level according to the strength of the audio input signal to ensure that the audio output maintains the appropriate strength in various sound scenes. AGC is the abbreviation of "Automatic Gain Control", which means automatic gain control, which is used to adjust the gain of an amplifier or similar component to maintain a constant level of the output signal even if the strength of the input signal changes. When the input signal strength changes, the system adjusts the gain of the amplifier through a feedback mechanism so that the output signal remains at a relatively stable level.
[0030] Step S20: adjusting the volume according to the ambient audio to obtain a target volume, and adjusting the gain of the audio to be output to obtain a target intensity.
[0031] The obtained ambient audio is used to adjust the required volume to obtain the target volume that adapts to the current environment, and the gain of the output audio is adjusted to obtain the target intensity, thereby satisfying the optimization of the output audio and improving the quality of the output audio and the user's auditory experience.
[0032] Step S30: output the audio to be output according to the target volume and target intensity.
[0033] After completing the above adjustments, the target volume and the audio to be output can be output, and the audio can be dynamically adjusted to meet the user's usage experience in different environments.
[0034] Through the above method, by identifying the ambient audio and the audio to be output in the target audio; adjusting the volume according to the ambient audio to obtain the target volume, and adjusting the gain of the audio to be output to obtain the target intensity; outputting the audio to be output according to the target volume and target intensity, so that the output audio to be output can adapt to the current environment, solve the problem of insufficient volume in a noisy environment or too loud in a quiet environment, and improve the listening experience.
[0035] There are different specific solutions for “adjusting the volume according to the ambient audio to obtain the target volume”. The first solution specifically includes:
[0036] In one embodiment, adjusting the volume according to the ambient audio to obtain the target volume includes: identifying the ambient audio to obtain a noise level corresponding to the ambient audio; and adjusting the volume according to the noise level to obtain the target volume.
[0037] After the ambient audio is recognized, the ambient noise level corresponding to the current environment is confirmed by analyzing the ambient audio, and then the volume is adjusted according to the current ambient noise level to obtain the target volume. In this way, the volume matching the current ambient noise can be obtained, so the target volume can be dynamically adjusted according to the change of ambient noise.
[0038] Solution 1: In one embodiment, ambient audio is identified and the noise level corresponding to the ambient audio is obtained, including: in response to the noise corresponding to the ambient audio being greater than or equal to a set threshold, determining that the noise level corresponding to the ambient audio is a first noise level; in response to the noise corresponding to the ambient audio being less than the set threshold, determining that the noise level corresponding to the ambient audio is a second noise level; wherein the first noise level is higher than the second noise level.
[0039] It can be understood that in the above embodiment, the ambient noise is detected and evaluated, and the noise intensity of the current ambient noise is determined by comparing it with the preset ambient noise setting threshold, and then different degrees of adjustment can be performed on different noise environments according to the noise intensity of the ambient noise. Therefore, according to the noise level evaluation of the noise, the detected noise is divided into multiple levels, so that the volume can be adjusted later with reference to the evaluated noise level.
[0040] In other embodiments, the noise level can be divided into multiple different noise levels and is not limited to the division of two noise levels. Multiple noise levels can correspond to multiple different noise scenes. The more corresponding noise levels there are, the more adjustable schemes there are, and more specific volume adjustments can be made according to the environment.
[0041] Solution 2: In one embodiment, the volume is adjusted according to the noise level to obtain a target volume, including: in response to the noise level corresponding to the ambient audio being a first noise level, setting it to a first mode and adjusting the volume intensity; in response to the noise level corresponding to the ambient audio being a second noise level, setting it to a second mode and adjusting the volume intensity; wherein the volume intensity corresponding to the first mode is greater than the volume intensity corresponding to the second mode.
[0042] It can be understood that by analyzing the audio data received from the microphone, the system identifies and evaluates the background noise level in the current environment. This includes measuring the quietness and noisiness of the environment. The noise level is divided into different noise levels, and the volume level corresponding to the noise level can be adjusted step by step in a gradient manner to obtain the target volume.
[0043] Among them, corresponding to different noise levels, different setting modes are set accordingly, and the volume intensity of the device is adjusted through different modes, and the range of the output volume is dynamically adjusted to meet the volume level in different environments. For example, in a relatively quiet environment, the noise level is low, so the output volume is gradually reduced, or in a noisy environment, the noise level is high, so the output volume is gradually increased. Through different degrees of adjustment, normal auditory perception can be met, avoiding excessive noise in a quiet environment or too low volume in a noisy environment to meet hearing needs, thereby satisfying the user's auditory experience during use.
[0044] The second solution of “adjusting the volume according to the ambient audio to obtain the target volume” specifically includes:
[0045] In one embodiment, adjusting the volume according to the ambient audio to obtain the target volume includes: obtaining a current volume mode; and adjusting the volume in combination with the current volume mode and the ambient audio to obtain the target volume.
[0046] Among them, when adjusting the volume according to the ambient audio to obtain the target volume, the device may be in other volume modes. Therefore, before adjusting the volume according to the ambient audio, it is necessary to obtain the corresponding volume mode and adjust the volume in combination with the volume mode and the ambient audio to obtain the target volume.
[0047] Further, in the setting of how to "adjust the volume in combination with the current volume mode and the ambient audio to obtain the target volume", the present application also provides the following solution:
[0048] In one embodiment, the target volume is obtained by adjusting the volume in combination with the current volume mode and the ambient audio, including: in response to the current volume mode being a scene setting, obtaining a first volume parameter corresponding to the scene setting, and adjusting the volume in combination with the first volume parameter and the ambient audio to obtain the target volume; in response to the current volume mode being a preference setting, obtaining a second volume parameter corresponding to the preference setting, and adjusting the volume in combination with the second volume parameter and the ambient audio to obtain the target volume.
[0049] The scene modes can correspond to the use in different scene requirements, for example, the family mode after returning home, the work mode at work, the bookstore mode in the bookstore, the bar mode in the bar, etc. Users can set the volume range required for different environments in a targeted manner to quickly adjust the appropriate volume range to meet the use requirements of the current environment. The preference settings can include the user's commonly used customary volume range mode, or set different volume ranges for the use of different applications, for example, set a commonly used volume range for a music application, and set another volume range for a game application.
[0050] In one embodiment, the preference setting is set in the following manner: receiving a volume intensity interval set by a user; wherein each application corresponds to a volume intensity interval and / or each scene corresponds to a volume intensity interval.
[0051] The system supports the storage and application of user preferences, and users can set specific volume preferences or scene modes. The system automatically adjusts volume parameters based on the stored preferences and provides personalized audio output settings, such as the user's commonly used mute settings or preset volumes for different environments.
[0052] In another embodiment, the scenario of scene mode and preference setting can be combined for execution. For example, in response to the current volume mode being a scene setting, after obtaining the first volume parameter corresponding to the scene setting, when a volume intensity interval corresponding to the application conflicts with the volume intensity interval corresponding to the scene setting during the use of a separate application, the volume intensity interval corresponding to the priority scene mode is used as the priority, that is, the corresponding first volume parameter is still used during the use of the application.
[0053] It can be understood that in the above-mentioned embodiments, how to obtain the target volume is specifically described, and different adjustment schemes are implemented by setting different volume modes, such as the scene settings and preference settings described above.
[0054] Corresponding to the above embodiment, in another embodiment, the gain of the audio to be output is adjusted to obtain the target intensity, including: extracting intensity information and spectrum information in the audio to be output; and gain adjusting the intensity information and spectrum information to obtain the target intensity.
[0055] It can be understood that the audio input is monitored in real time, for example, a high-sensitivity microphone is used to capture the target audio, wherein the target audio may include audio input signals in the environment and audio input signals of the user's voice, wherein the audio signal includes sound intensity and spectral characteristics, and the acquired input signal is used as the basic information for subsequent audio signal processing analysis and control adjustment.
[0056] Among them, sound intensity and spectrum characteristics are two important parameters for describing sound characteristics. They are widely used in acoustics, audio processing, speech recognition and other fields. Specifically, the magnitude of sound intensity is related to the amplitude and frequency of the sound wave. The larger the amplitude and the higher the frequency, the greater the sound intensity. The spectrum characteristics describe the distribution of the sound signal in the frequency domain, which reflects the amplitude and phase information of each frequency component in the sound signal. Through Fourier transform, the sound signal in the time domain can be converted to the frequency domain to obtain its spectrum. Spectrogram is a commonly used visualization method. It uses images to show the changes of the frequency components of the sound signal over time. The horizontal axis represents time, the vertical axis represents frequency, and the color or brightness represents the amplitude. Spectral features are very important for analyzing the timbre and pitch of the sound, as well as for tasks such as sound classification and recognition. For example, in speech processing, key information such as formants and fundamental frequencies can be extracted by analyzing the spectrum characteristics of the speech signal.
[0057] In the above solution, it is implemented through a combination of software and hardware: the entire execution process involves close cooperation between the mobile phone hardware (microphone, DSP chip) and software (audio processing module, user interface). The hardware is responsible for real-time data acquisition and processing, while the software is responsible for algorithm execution and user interaction, ensuring the accuracy and user-friendliness of volume adjustment.
[0058] Through the above method, when using a mobile phone or other electronic device for calls or media playback in different environments, the system can dynamically adjust the output volume according to the environmental noise level and user needs, thereby providing a better audio experience. The technical solution is to provide users with a high-quality audio experience through real-time audio input monitoring and intelligent control of the volume adjustment of mobile phones or other electronic devices. It uses a highly sensitive microphone and a dedicated audio processing chip, which is suitable for scenarios when users use mobile phones or other electronic devices for calls or media playback in different environments. The method realizes automatic gain control (AGC) and environmental noise detection by real-time monitoring of the audio input signal strength and spectral characteristics of the environment and user voice, and combining digital signal processing (DSP) algorithm for real-time analysis. The system dynamically adjusts the output volume based on the analysis results to adapt to the noise level of the current environment and user preferences.
[0059] See also Figure 2 , Figure 2 1 is a flow chart of the steps of the second embodiment of the volume adjustment method provided by the present application; specifically, the solution includes the following steps:
[0060] It can be understood that the system controls the execution of the operation options through step S0, the execution of the three steps of user preference mode through step S1, environmental noise detection through step S2, and audio input detection through step S3, so as to set the user's preferred mode, such as the scheme described in the above embodiment, and analyze the input audio, including the environmental audio and the user's input audio, and automatically determine and adjust to the appropriate output mode according to the detection of the environmental noise, such as Figure 2 The first mode of step S2a or the second mode of step S2b, wherein the first mode can be a bass mode and the second mode can be a treble mode, after completing the mode setting, combined with the user preference setting of step S1, the setting of the volume intensity interval adjustment of step S4 is completed. Further, after receiving the user's input audio, the input audio is gain processed by using the digital signal gain dynamic adjustment of step S5, and finally, after completing the setting of the volume intensity interval adjustment of step S4 and the setting of the digital signal gain dynamic adjustment of step S5, step S6 is executed to output the adjusted audio signal.
[0061] The user preference settings may be the preference schemes set by the user himself as described in the above embodiments, or independent preference settings for each application in combination with separate applications. The adjustment of the volume intensity range may be based mainly on environmental noise detection or on user preference mode. The main adjustment scheme may be adjusted in combination with specific settings without specific limitation.
[0062] See also Figure 3 , Figure 3It is a structural diagram of an embodiment of an electronic device provided in the present application; the electronic device 100 includes: a memory 110; a processor 120, connected to the memory 110, and the processor 120 is configured to execute the volume adjustment method described in any one of the above embodiments.
[0063] See also Figure 4 , Figure 4 2 is a schematic diagram of the structure of an embodiment of a computer-readable storage medium provided in the present application; the computer-readable storage medium 200 stores program data 210, and when the program data 210 is executed by the processor, it is used to implement the volume adjustment method described in any one of the above embodiments.
[0064] The present application provides a volume adjustment method, an electronic device and a storage medium. The volume adjustment method includes: obtaining a target audio, and identifying an ambient audio and an audio to be output in the target audio; adjusting the volume according to the ambient audio to obtain a target volume, and performing a gain adjustment on the audio to be output to obtain a target intensity; and outputting the audio to be output according to the target volume and the target intensity.
[0065] Through the above method, the ambient audio and the audio to be output are obtained, and the volume intensity is adjusted accordingly according to the ambient audio or the user's own preferences, and the gain of the output audio is adjusted to achieve dynamic adjustment of the target volume and enhance the listening experience.
[0066] The embodiments of the present application are introduced in detail above. 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 and core idea of the present application. At the same time, for technical personnel 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.
Claims
1. A volume adjustment method, characterized in that: The volume adjustment method comprises: Acquire target audio, and identify ambient audio and audio to be output in the target audio; Adjusting the volume according to the ambient audio to obtain a target volume, and adjusting the gain of the audio to be output to obtain a target intensity; The to-be-output audio is output according to the target volume and the target intensity.
2. The volume adjustment method according to claim 1, characterized in that: The step of adjusting the volume according to the ambient audio to obtain a target volume includes: Identify the ambient audio and obtain a noise level corresponding to the ambient audio; The volume is adjusted according to the noise level to obtain a target volume.
3. The volume adjustment method according to claim 2, characterized in that: The identifying the ambient audio and obtaining the noise level corresponding to the ambient audio includes: In response to the noise corresponding to the ambient audio being greater than or equal to a set threshold, determining that the noise level corresponding to the ambient audio is a first noise level; In response to the noise corresponding to the ambient audio being less than the set threshold, determining the noise level corresponding to the ambient audio to be a second noise level; wherein the first noise level is higher than the second noise level.
4. The volume adjustment method according to claim 2, characterized in that: The step of adjusting the volume according to the noise level to obtain a target volume includes: In response to the noise level corresponding to the ambient audio being a first noise level, setting the first mode and adjusting the volume intensity; In response to the noise level corresponding to the ambient audio being a second noise level, setting the second mode and adjusting the volume intensity; wherein the volume intensity corresponding to the first mode is greater than the volume intensity corresponding to the second mode.
5. The volume adjustment method according to claim 1, characterized in that: The step of adjusting the volume according to the ambient audio to obtain a target volume includes: Get the current volume mode; The current volume mode and the ambient audio are combined to adjust the volume to obtain a target volume.
6. The volume adjustment method according to claim 5, characterized in that: The step of adjusting the volume in combination with the current volume mode and the ambient audio to obtain a target volume includes: In response to the current volume mode being a scene setting, obtaining a first volume parameter corresponding to the scene setting, and adjusting the volume in combination with the first volume parameter and the ambient audio to obtain a target volume; In response to the current volume mode being a preference setting, a second volume parameter corresponding to the preference setting is acquired, and the volume is adjusted in combination with the second volume parameter and the ambient audio to obtain a target volume.
7. The volume adjustment method according to claim 6, characterized in that: The preference settings are set in the following way: Receive a volume intensity interval set by a user; wherein each application corresponds to one of the volume intensity intervals and / or each scene corresponds to one of the volume intensity intervals.
8. The volume adjustment method according to claim 1, characterized in that: The step of performing gain adjustment on the audio to be output to obtain a target intensity includes: Extracting intensity information and spectrum information from the audio to be output; Gain adjustment is performed on the intensity information and the spectrum information to obtain a target intensity.
9. An electronic device, characterized in that: The electronic device comprises: Memory; A processor is connected to the memory, and the processor is configured to execute the volume adjustment method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program data, and when the program data is executed by the processor, it is used to implement the volume adjustment method according to any one of claims 1 to 8.