Volume adjustment method and device, electronic equipment and storage medium
By using the sound pressure level generated by the speaker to sound in volume adjustment to determine the gain, the problem of inconsistent sound size due to different speaker configurations in the prior art is solved, and the consistency of sound size during volume adjustment is achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202411650526.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-02-28
AI Technical Summary
When the prior art uses the amplifier output power to determine the gain for volume adjustment, the sound size at the same volume is inconsistent due to different speaker configurations, which affects the user experience.
By determining the gain based on the sound pressure level generated by the speaker sound, we ensure that the sound pressure level emitted by the speaker at the same volume under different speaker configurations is consistent, thereby ensuring the consistency of sound size.
It effectively avoids the problem of inconsistent sound size due to different speaker configurations during volume adjustment, greatly improving the user experience.
Smart Images

Figure CN119536682A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of audio processing technology, and in particular to a volume adjustment method, device, electronic device and storage medium. Background Art
[0002] The volume curve represents that when the volume changes, the internal gain of the SoC (System on Chip) also changes accordingly. Intuitively, the sound will change when the volume changes.
[0003] Since different gains in the SoC in an electronic device will affect the output power of the power amplifier, and the output power of the power amplifier is a measurable value, the prior art generally determines the gain of each volume by controlling the output power of the power amplifier of each volume. However, in the process of adjusting the volume using the gain determined by the output power of the power amplifier, since the output power of the power amplifier for each volume corresponding to each gain is the same on electronic devices with different speaker configurations, there is a situation where the sound volume is inconsistent at the same volume due to the different speaker configurations of the electronic devices. For example, an electronic device with a high speaker configuration will feel loud at a low volume, such as volume points 1 to 5, while an electronic device with a low speaker configuration will feel low at a low volume of 1 to 5 volume points, resulting in differences in the actual output size of the sound at the same volume, affecting the user experience. Summary of the invention
[0004] In view of this, the embodiments of the present invention provide a volume adjustment method, device, electronic device and storage medium, wherein gain is determined based on the sound pressure level generated by the sound of a speaker. This ensures that in the process of adjusting the volume using the gain, since the sound pressure level of each volume corresponding to each gain is the same on electronic devices with different speaker configurations, the sound pressure level emitted by the speaker at the same volume under different speaker configurations is the same, thereby ensuring that the output sound of each electronic device at the same volume is consistent, effectively avoiding the problem of inconsistent sound volume caused by the volume being affected by the speaker configuration during the process of adjusting the volume using the gain determined by the output power of the power amplifier, thereby greatly improving the user experience.
[0005] In a first aspect, an embodiment of the present invention provides a volume adjustment method, which is applied to an electronic device with a speaker, and the method includes:
[0006] Divide the volume range of the electronic device into multiple volume intervals according to different usage volume scenarios;
[0007] The following operations are performed for each volume interval segment: a plurality of preset volume points and a preset sound pressure level corresponding to each preset volume point are obtained from the volume interval segment;
[0008] Determining the sound pressure level of each first volume point in the volume interval according to each preset volume point and the preset sound pressure level corresponding to each preset volume point; wherein the first volume point is not a preset volume point;
[0009] Determine the gain of each volume point according to the sound pressure level of each first volume point in the volume interval and the preset sound pressure level of each preset volume point;
[0010] The audio volume is adjusted based on the gain of each volume point in each volume interval.
[0011] In a possible implementation, determining the sound pressure level of each first volume point in the volume interval according to each preset volume point and the preset sound pressure level corresponding to each preset volume point includes:
[0012] Determine the volume sound pressure function of the volume interval segment according to the usage volume scenario corresponding to the volume interval segment;
[0013] The sound pressure levels of the first volume points within the volume interval are determined according to the preset volume points, the preset sound pressure levels corresponding to the preset volume points, and the volume sound pressure level function.
[0014] In a possible implementation, the volume sound pressure function of the volume interval segment is determined according to the usage scenario corresponding to the volume interval segment;
[0015] The target usage volume scene matching the usage volume scene corresponding to the volume interval segment is searched from the volume sound pressure function query table; wherein the volume sound pressure function query table includes the correspondence between the usage volume scene and the volume sound pressure function:
[0016] The target volume sound pressure function corresponding to the target usage volume scenario is determined as the volume sound pressure function of the volume interval segment.
[0017] In a possible implementation, determining the sound pressure level of each first volume in the volume interval according to each preset volume point, the preset sound pressure level corresponding to each preset volume point, and the volume sound pressure level function includes:
[0018] Substituting each preset volume point and the preset sound pressure level corresponding to each preset volume point into the volume sound pressure level function, and solving to obtain the function coefficient of the volume sound pressure level function;
[0019] Substitute each first volume point and the function coefficient in the volume interval into the volume sound pressure level function to obtain the sound pressure level of each first volume point in the volume interval.
[0020] In a possible implementation, determining the gain of each volume point according to the sound pressure level of each first volume point in the volume interval and the preset sound pressure level of each preset volume point includes:
[0021] Set the maximum gain at the maximum volume point in the volume range;
[0022] The gain of each volume point is determined based on the maximum gain of the maximum volume point, the sound pressure level of each first volume point in the volume interval, and the preset sound pressure level of each preset volume point.
[0023] In a possible implementation, determining the gain of each volume point based on the maximum gain of the maximum volume point, the sound pressure level of each first volume point in the volume interval, and the preset sound pressure level of each preset volume point includes:
[0024] Determine the sound pressure difference between the sound pressure level at the maximum volume point and the sound pressure levels at each first volume point, and the preset sound pressure levels at each preset volume point;
[0025] The gain at each volume point is determined based on the maximum gain and the sound pressure difference.
[0026] In a possible implementation, adjusting the audio volume based on the gain of each volume point in each volume interval includes:
[0027] Get the target volume point;
[0028] Determine a target gain corresponding to a volume point matching the target volume point from each volume interval;
[0029] Adjust the audio volume based on the target gain.
[0030] In a second aspect, an embodiment of the present invention provides a volume adjustment device, which is applied to an electronic device with a speaker, and the device includes:
[0031] A division module, used to divide the volume range of the electronic device into multiple volume intervals according to different usage volume scenarios;
[0032] The acquisition module is used to perform the following operations for each volume interval: acquiring a plurality of preset volume points and a preset sound pressure level corresponding to each preset volume point from the volume interval;
[0033] A first determination module, configured to determine the sound pressure level of each first volume point in the volume interval according to each preset volume point and the preset sound pressure level corresponding to each preset volume point; wherein the first volume point is not a preset volume point;
[0034] A second determination module is used to determine the gain of each volume point according to the sound pressure level of each first volume point in the volume interval and the preset sound pressure level of each preset volume point;
[0035] The volume adjustment module is used to adjust the audio volume based on the gain of each volume point in each volume interval.
[0036] In a third aspect, an embodiment of the present invention provides an electronic device, which includes: a processor and a memory, wherein the processor is used to execute a volume adjustment program stored in the memory to implement the above-mentioned volume adjustment method.
[0037] In a fourth aspect, an embodiment of the present invention provides a storage medium, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above-mentioned volume adjustment method.
[0038] The volume adjustment method, device, electronic device and storage medium provided by the embodiment of the present invention include: dividing the volume range of the electronic device into multiple volume intervals according to different volume usage scenarios; performing the following operations for each volume interval: obtaining multiple preset volume points and the preset sound pressure level corresponding to each preset volume point from the volume interval; determining the sound pressure level of each first volume point in the volume interval according to each preset volume point and the preset sound pressure level corresponding to each preset volume point; determining the gain of each volume point according to the sound pressure level of each first volume point in the volume interval and the preset sound pressure level of each preset volume point; and adjusting the volume of the audio based on the gain of each volume point in each volume interval. The above technical scheme determines the gain based on the sound pressure level generated by the speaker, which makes it possible that in the process of adjusting the volume by gain, since the sound pressure level of each volume corresponding to each gain is the same on electronic devices with different speaker configurations, the sound pressure level emitted by the speaker at the same volume is the same under different speaker configurations, thereby ensuring that the output sound of each electronic device at the same volume is consistent, effectively avoiding the problem of inconsistent sound volume caused by the influence of the speaker configuration when the gain determined by the output power of the power amplifier is used to adjust the volume, thereby greatly improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A flow chart of an embodiment of a volume adjustment method provided by an embodiment of the present invention;
[0040] Figure 2 A schematic diagram of a volume sound pressure level curve provided by an embodiment of the present invention;
[0041] Figure 3 A flow chart of another volume adjustment method provided by an embodiment of the present invention;
[0042] Figure 4 A flow chart of another volume adjustment method provided by an embodiment of the present invention;
[0043] Figure 5 A flow chart of another volume adjustment method provided by an embodiment of the present invention;
[0044] Figure 6 A flow chart of another volume adjustment method provided by an embodiment of the present invention;
[0045] Figure 7 A block diagram of an embodiment of a volume adjustment device provided by an embodiment of the present invention;
[0046] Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] To facilitate understanding of the embodiments of the present invention, specific embodiments will be further explained below in conjunction with the accompanying drawings. The embodiments do not constitute a limitation on the embodiments of the present invention.
[0049] The embodiment of the present invention provides a volume adjustment method, which is applied to electronic devices with speakers, such as MP (Moving Picture Experts Group Audio Layer, dynamic image expert compression standard audio layer) 3, MP4, mobile phones, amplifiers, recorders, computers, televisions, etc., and is specifically applied to SoC implementation in the electronic device; see Figure 1 , Figure 1 The present invention provides a flow chart of a volume adjustment method according to an embodiment of the present invention. Figure 1 The process shown may include the following steps:
[0050] Step 101, dividing the volume range of the electronic device into a plurality of volume intervals according to different usage volume scenarios;
[0051] The volume ranges of different electronic devices are different. Take the volume range of electronic devices as 1-100 as an example. The usage volume scenario refers to the applicable scenario of the volume. Among them, the volume of 1-10 is a low volume area, and the general usage volume scenario is used in night environments. The volume of 10-50 is the volume range commonly used by users, and the general usage volume scenario is used in daily environments. The volume of 50-100 is a high volume interval, and the general usage volume scenario is used in lively environments such as karaoke and parties. Then, the volume range of 1-100 can be divided into three different volume intervals of 1-10, 10-50, and 50-100 according to the three different usage volume scenarios. It can be seen that the number of divided volume intervals corresponds to the number of usage volume scenarios. The setting of the specific volume scene can be set according to actual needs and is not limited here.
[0052] Step 102, performing the following operations for each volume interval: obtaining a plurality of preset volume points and a preset sound pressure level corresponding to each preset volume point from the volume interval;
[0053] The following process from step 102 to step 104 is performed for each volume interval segment to determine the gain of each volume point in each volume interval segment.
[0054] The preset volume point is a volume point in the volume interval. For example, in a volume interval of 1-10, volume point 1 and volume point 10 can be selected as preset volume points, in a volume interval of 10-50, volume points 10, 30 and 50 can be selected as preset volume points, and in a volume interval of 50-100, volume points 50 and 100 can be selected as preset volume points. The preset volume points in each volume interval are not limited, and the number of preset volume points in each volume interval is not limited, as long as the number of preset volume points obtained can be used to determine the sound pressure level of each first volume point in the volume interval.
[0055] The preset sound pressure level corresponding to each preset volume point is a suitable value determined based on comparative analysis of a large number of competing products and market research. In one embodiment, the preset sound pressure level corresponding to each preset volume point can be obtained by querying a sound pressure level query table, in which the correspondence between the preset sound pressure level and the preset volume point is pre-written, and the preset sound pressure level corresponding to the preset volume point is queried through the sound pressure level query table.
[0056] Step 103, determining the sound pressure level of each first volume point in the volume interval according to each preset volume point and the preset sound pressure level corresponding to each preset volume point; wherein the first volume point is not a preset volume point;
[0057] Since the preset sound pressure levels corresponding to the preset volume points are known, there is no need to determine the sound pressure levels. In this embodiment, the sound pressure levels of the first volume points other than the preset volume points in each volume interval can be determined based on the known preset sound pressure levels of the preset volume points in each volume interval to obtain the sound pressure levels of each first volume point.
[0058] Step 104, determining the gain of each volume point according to the sound pressure level of each first volume point in the volume interval and the preset sound pressure level of each preset volume point;
[0059] Since the sound pressure levels of all volume points in each volume interval are determined by step 103, the variation trend of the volume points and the sound pressure levels can be determined by the sound pressure levels corresponding to the volume points. For ease of understanding, Figure 2 As shown, the horizontal axis represents the volume range of the electronic device, the volume range is 1-100, and the vertical axis represents the sound pressure level generated by the electronic device at each volume point. Figure 2 It can be seen that the sound pressure level corresponding to the volume range of 1-10 is around 30-40dB (decibel), which is in the auditory quiet zone and is suitable for use in a quiet night environment. The sound pressure level corresponding to the volume range of 10-50 is around 40-70dB, which is in the auditory comfort zone and is suitable for use in daily environments. The sound pressure level corresponding to the volume range of 50-100 is around 70-90dB, which is in the auditory intense zone and is suitable for use in a lively environment.
[0060] Related research shows that for every 3dB increase in volume gain, the electrical power input to the speaker will double, and the sound pressure level produced by the speaker will also increase by 3dB. Therefore, there is a linear relationship between sound pressure level and gain. Therefore, the relationship between gain and volume also applies to Figure 2 As shown in the variation trend, since there is a linear relationship between the sound pressure level and the gain, the gain can be determined according to the sound pressure levels determined in different volume intervals.
[0061] Step 105: Adjust the audio volume based on the gain of each volume point in each volume interval.
[0062] The audio volume can be adjusted through the gain. The specific volume adjustment process is: obtaining a target volume point; determining a target gain corresponding to a volume point matching the target volume point from each volume interval; and adjusting the audio volume based on the target gain.
[0063] The target volume point can be understood as the volume point adjusted by the user. For example, if the current volume point is 10 and the user wants to lower the volume, then the volume point 10 is adjusted to the volume point 5, and the volume point 5 is the target volume point. Since the gain of each volume point in each volume interval is determined through steps 102 to 104, the volume point matching the target volume point is first determined from each volume interval, and then the gain corresponding to the volume point is determined as the target gain corresponding to the target volume point, so as to use the target gain to adjust the volume of the audio.
[0064] With the volume adjustment method provided in this embodiment, the gain is determined based on the sound pressure level generated by the sound of the speaker. This means that in the process of adjusting the volume using the gain, since the sound pressure level of each volume corresponding to each gain is the same on electronic devices with different speaker configurations, the sound pressure level emitted by the speaker at the same volume is the same under different speaker configurations, thereby ensuring that the output sound of each electronic device at the same volume is consistent, effectively avoiding the problem of inconsistent sound volume caused by the volume being affected by the speaker configuration during the process of adjusting the volume using the gain determined by the output power of the power amplifier, thereby greatly improving the user experience.
[0065] In an optional implementation manner of the embodiment of the present application, if Figure 3 As shown, as in step 103 of the aforementioned method, determining the sound pressure level of each first volume point in the volume interval according to each preset volume point and the preset sound pressure level corresponding to each preset volume point includes the following steps:
[0066] Step 301, determining a volume sound pressure function of a volume interval according to a usage volume scenario corresponding to the volume interval;
[0067] It can be understood that the volume sound pressure function used to determine the sound pressure level in different volume usage scenarios is different. Continuing with the previous example, the volume scenario used in the volume interval of 1-10 is used in a night environment. At this time, the sound pressure level output by the electronic device is required to be very small and the volume and sound pressure level in this volume interval must change slowly, that is, the sound pressure level will not increase significantly when the volume increases. In view of the sound pressure level change trend of this volume interval, it is necessary to use an exponential function with a slow sound pressure level change to determine the sound pressure level of each volume point in this volume interval; wherein, the volume sound pressure function corresponding to this volume interval is not limited to an exponential function, as long as the function satisfies the change trend of the volume and sound pressure level described above.
[0068] The volume scenario used in the volume range of 10-50 is daily use. At this time, it is required that the sound pressure level can be obviously changed when the volume is adjusted, and it is hoped that the sound pressure level output by the electronic equipment is in the human hearing comfort zone. According to ergonomic research, the sound pressure level of 50-70dB is the human hearing comfort zone, and 55-65dB is the most comfortable zone. Therefore, the volume of 10-50 requires the sound pressure level to be able to quickly enter and slowly exit the human hearing comfort zone. In view of this feature, a parabolic function with a larger opening and an opening facing downward is used to determine the sound pressure level of each volume point in this volume range; wherein, the volume sound pressure function corresponding to this volume range is not limited to a parabolic function, as long as the function that satisfies the above-described trend of volume and sound pressure level changes is sufficient.
[0069] The volume scenario used in the volume range of 50-100 is a lively environment. At this time, the sound pressure level is required to change rapidly when the volume is adjusted to achieve a relatively large loudness expected by the user. For this specific situation, a linear function that makes the sound pressure level rise linearly is required to determine the sound pressure level of each volume point in this volume range; wherein, the volume sound pressure function corresponding to this volume range is not limited to a linear function, as long as the function satisfies the above-described trend of volume and sound pressure level changes.
[0070] Step 302: determining the sound pressure level of each first volume point in the volume interval according to each preset volume point, the preset sound pressure level corresponding to each preset volume point, and the volume sound pressure level function.
[0071] In specific applications, when using the determined gain to adjust the volume, in order to avoid volume adjustment distortion, after determining the gain of each volume point, it is necessary to use the microphone module in the electronic device to actually measure the sound pressure level of the volume point of the speaker. When the actually measured sound pressure level is different from the sound pressure level determined by the volume sound pressure function, the gain is adjusted until the sound pressure level determined by the volume sound pressure function is the same as the actually measured sound pressure level, so that the gain corresponds to the actual sound pressure level of the speaker, effectively avoiding volume distortion, so as to achieve accurate adjustment of the volume through the gain.
[0072] The volume adjustment method provided in this embodiment can effectively avoid the problem that in the prior art, in the process of determining the gain of each volume point by using the power amplifier output power, the power amplifier output power of each volume point is determined by only using the power amplifier output power of several specific volume points and using a single power fitting function to determine the power amplifier output power, and then determining the gain according to the power amplifier output power. This gain determination method does not make different adjustments according to the actual use needs of each volume interval, which causes the problem that when the volume is adjusted according to the gain, the adjustment change of the volume cannot meet the actual use needs of different volume usage scenarios. In this embodiment, the sound pressure level of the volume point of each volume interval segment can be determined according to the volume sound pressure function determined by different volume usage scenarios, and then the volume gain is determined. This makes the adjustment change of the volume more in line with the actual use needs of different scenarios when the volume is adjusted by the gain.
[0073] In an optional implementation manner of the embodiment of the present application, if Figure 4 As shown, as in step 301 of the aforementioned method, determining the volume sound pressure function of the volume interval segment according to the usage volume scene corresponding to the volume interval segment includes the following steps:
[0074] Step 401, querying a volume sound pressure function query table for a target usage volume scenario that matches a usage volume scenario corresponding to a volume interval segment;
[0075] The volume sound pressure function query table includes the correspondence between the volume scene and the volume sound pressure function: According to the above description, a volume sound pressure function query table as shown in Table 1 below can be obtained, as shown in Table 1:
[0076] Table 1
[0077] Use volume scene Volume Sound Pressure Function Nighttime use Exponential function Daily use Parabolic function Use in busy environment Linear Function
[0078] It should be noted that Table 1 only shows an example of the correspondence between the volume scene and the volume sound pressure function. The specific correspondence between the volume scene and the volume sound pressure function can be set according to actual needs and is not limited here.
[0079] Step 402: determine the target volume sound pressure function corresponding to the target usage volume scene as the volume sound pressure function of the volume interval segment.
[0080] Based on Table 1, if the usage volume scenario corresponding to the current volume interval is daily environment use, it can be known by looking up Table 1 that it corresponds to the daily environment use in Table 1. Therefore, the volume sound pressure function corresponding to the current volume interval is a parabolic function.
[0081] The method in this embodiment can accurately and quickly query the volume sound pressure function that matches the current volume interval through the volume sound pressure function query table, so as to be used for determining the sound pressure level of each volume point.
[0082] In an optional implementation manner of the embodiment of the present application, if Figure 5 As shown, as in step 302 of the aforementioned method, determining the sound pressure level of each first volume point in the volume interval according to each preset volume point, the preset sound pressure level corresponding to each preset volume point, and the volume sound pressure level function includes the following steps:
[0083] Step 501, substituting each preset volume point and the preset sound pressure level corresponding to each preset volume point into a volume sound pressure level function, and solving to obtain function coefficients of the volume sound pressure level function;
[0084] Continuing with the previous example, if the volume scene is used in a night environment, the volume pressure function corresponding to the volume interval 1-10 is an exponential function Among them, y represents the sound pressure level, x represents the volume point, a1 and b1 represent the function coefficients. The function coefficients a1 and b1 of the current exponential function are unknown quantities and need to be solved. Therefore, it is necessary to substituted the preset sound pressure level corresponding to 1 preset volume point and 1 preset volume point, as well as the preset sound pressure level corresponding to 10 preset volume points and 10 preset volume points into the above exponential function respectively, and solve them to obtain the function coefficients a1 and b1 of the exponential function.
[0085] If the volume scenario is used in daily environment, the volume sound pressure function corresponding to the volume interval 10-50 is a parabolic function y=a2x 2 +b2x+c; wherein, y represents the sound pressure level, x represents the volume point, a2, b2 and c represent function coefficients, and the function coefficients a2, b2 and c of the current parabolic function are all unknown quantities and need to be solved. Therefore, the preset sound pressure level corresponding to the preset volume point of 10 and the preset sound pressure level corresponding to the preset volume point of 10, the preset sound pressure level corresponding to the preset volume point of 30 and the preset sound pressure level corresponding to the preset volume point of 30, and the preset sound pressure level corresponding to the preset volume point of 50 and the preset sound pressure level corresponding to the preset volume point of 50 are respectively substituted into the above parabolic function and solved to obtain the function coefficients a2, b2 and c of the parabolic function.
[0086] If the volume scene is used in a lively environment, the volume sound pressure function corresponding to the volume interval 50-100 is a linear function y=a3x+b3; wherein y represents the sound pressure level, x represents the volume point, a3 and b3 represent the function coefficients, and the function coefficients a3 and b3 of the current linear function are both unknown quantities and need to be solved. Therefore, the preset sound pressure level corresponding to the 50 preset volume point and the 50 preset volume point, as well as the preset sound pressure level corresponding to the 100 preset volume point and the 100 preset volume point need to be substituted into the above linear function respectively, and solved to obtain the function coefficients a3 and b3 of the linear function.
[0087] Step 502: Substitute each first volume point and function coefficient within the volume interval into the volume sound pressure level function to obtain the sound pressure level of each first volume point within the volume interval.
[0088] After solving step 501, the function coefficients of each volume sound pressure function are solved, then each first volume point in the volume interval except the preset volume point can be substituted into the corresponding volume sound pressure function to solve the sound pressure level y to obtain the sound pressure level of each first volume point in the volume interval.
[0089] The method in this embodiment can accurately calculate the sound pressure level of each first volume point in the volume interval through the volume sound pressure function corresponding to the volume interval segment, so as to be used for determining the gain of each volume point.
[0090] In an optional implementation manner of the embodiment of the present application, if Figure 6 As shown, as in step 104 of the aforementioned method, determining the gain of each volume point according to the sound pressure level of each first volume point in the volume interval and the preset sound pressure level of each preset volume point includes the following steps:
[0091] Step 601, setting the maximum gain of the maximum volume point in the volume range;
[0092] In order to ensure that the volume of the electronic device is the highest at the maximum volume point, the gain of the maximum volume point in the volume range may be set to the maximum gain.
[0093] Specifically, since it is known that the digital signal 0dB is the largest inside the SoC, the maximum gain corresponding to the maximum volume point in the volume range can be set to 0dB. For example, if the volume range is 1-100, where the preset volume point 100 is the maximum volume point, the maximum gain of the maximum volume point 100 is set to 0dB.
[0094] Step 602: determining the gain of each volume point based on the maximum gain of the maximum volume point, the sound pressure level of each first volume point in the volume interval, and the preset sound pressure level of each preset volume point.
[0095] The above step 602 can be specifically implemented through steps A1 to A2:
[0096] Step A1, determining the sound pressure difference between the sound pressure level of the maximum volume point and the sound pressure levels of each first volume point, and the preset sound pressure levels of each preset volume point;
[0097] The above step A1 is to calculate the sound pressure difference between the sound pressure level at the maximum volume point and the sound pressure level corresponding to each volume point in each volume interval segment.
[0098] For the sake of explanation, Figure 2 As shown, in the volume range of 1-100, the sound pressure level of the maximum volume point 100 is 93dB. If the preset sound pressure level of the preset volume point 1 in the volume interval of 1-10 is 34dB, and the sound pressure level of the first volume point 2 is 34.2dB, then the sound pressure difference between the maximum volume point 100 and the preset volume point 1 is 59dB, and the sound pressure difference between the maximum volume point 100 and the first volume point 2 is 58.8dB. The calculation process of the sound pressure level difference between the maximum volume point and the other preset volume points and the first volume point is the same as above, and will not be repeated here.
[0099] Step A2, determine the gain of each volume point based on the maximum gain and the sound pressure difference.
[0100] From the above, it can be seen that there is a linear relationship between the gain and the sound pressure level, that is, the gain changes accordingly as the sound pressure level changes. Continuing with the previous example, the sound pressure difference between the maximum volume point 100 and the preset volume point 1 is 59dB, and the gain difference between the maximum volume point 100 and the preset volume point 1 is also 59dB. Since it is known that the maximum gain of the maximum volume point 100 is 0dB, it can be determined that the gain of the preset volume point 1 is: 0-59=-59dB. Similarly, the gain of the first volume point 2 is 0-58.8=-58.8dB. The determination process of the gains of other preset volume points and the first volume point will not be repeated here.
[0101] The method in this embodiment can directly determine the gain of each volume point based on the linear relationship between gain and sound pressure level by using the maximum gain set at the maximum volume point and the sound pressure difference between the maximum volume point and each volume point.
[0102] The present invention provides a volume adjustment device, which is applied to an electronic device with a speaker. Figure 7 , is a block diagram of an embodiment of a volume adjustment device provided by an embodiment of the present invention. Figure 7 As shown, the device comprises:
[0103] A division module 701 is used to divide the volume range of the electronic device into a plurality of volume intervals according to different volume usage scenarios;
[0104] The acquisition module 702 is used to perform the following operations for each volume interval: acquiring a plurality of preset volume points and a preset sound pressure level corresponding to each preset volume point from the volume interval;
[0105] A first determination module 703, configured to determine the sound pressure level of each first volume point in the volume interval according to each preset volume point and the preset sound pressure level corresponding to each preset volume point; wherein the first volume point is not a preset volume point;
[0106] A second determination module 704 is used to determine the gain of each volume point according to the sound pressure level of each first volume point in the volume interval and the preset sound pressure level of each preset volume point;
[0107] The volume adjustment module 705 is used to adjust the audio volume based on the gain of each volume point in each volume interval.
[0108] Specifically, the specific process of each module in the device of the embodiment of the present invention realizing its function can be referred to the relevant description in the method embodiment, which will not be repeated here.
[0109] The volume adjustment device provided by the embodiment of the present invention includes: dividing the volume range of the electronic device into multiple volume intervals according to different volume usage scenarios; performing the following operations for each volume interval: obtaining multiple preset volume points and the preset sound pressure level corresponding to each preset volume point from the volume interval; determining the sound pressure level of each first volume point in the volume interval according to each preset volume point and the preset sound pressure level corresponding to each preset volume point; determining the gain of each volume point according to the sound pressure level of each first volume point in the volume interval and the preset sound pressure level of each preset volume point; and adjusting the volume of the audio based on the gain of each volume point in each volume interval. The above technical scheme determines the volume gain based on the sound pressure level generated by the sound of the speaker, which makes it possible that in the process of adjusting the volume by using the gain, since the sound pressure level of each volume corresponding to each gain is the same on the electronic device with different speaker configurations, the sound pressure level emitted by the speaker at the same volume is the same under different speaker configurations, thereby ensuring that the output sound of each electronic device at the same volume is consistent, effectively avoiding the problem of inconsistent sound volume caused by the influence of the speaker configuration when the gain determined by the output power of the power amplifier is used to adjust the volume, thereby greatly improving the user experience.
[0110] As an optional implementation manner, the first determining module 703 includes:
[0111] A third determination module, configured to determine a volume sound pressure function of a volume interval segment according to a usage volume scenario corresponding to the volume interval segment;
[0112] The fourth determination module is used to determine the sound pressure level of each first volume point in the volume interval according to each preset volume point, the preset sound pressure level corresponding to each preset volume point, and the volume sound pressure level function.
[0113] Specifically, the specific process of each module in the device of the embodiment of the present invention realizing its function can be referred to the relevant description in the method embodiment, which will not be repeated here.
[0114] As an optional implementation manner, the third determination module is further used to query a target usage volume scene matching the usage volume scene corresponding to the volume interval segment from a volume sound pressure function query table; wherein the volume sound pressure function query table includes a correspondence between the usage volume scene and the volume sound pressure function:
[0115] The target volume sound pressure function corresponding to the target usage volume scenario is determined as the volume sound pressure function of the volume interval segment.
[0116] Specifically, the specific process of each module in the device of the embodiment of the present invention realizing its function can be referred to the relevant description in the method embodiment, which will not be repeated here.
[0117] In a possible implementation manner, the fourth determination module is further used to substitute each preset volume point and the preset sound pressure level corresponding to each preset volume point into the volume sound pressure level function to solve and obtain the function coefficient of the volume sound pressure level function;
[0118] Substitute each first volume point and the function coefficient in the volume interval into the volume sound pressure level function to obtain the sound pressure level of each first volume point in the volume interval.
[0119] Specifically, the specific process of each module in the device of the embodiment of the present invention realizing its function can be referred to the relevant description in the method embodiment, which will not be repeated here.
[0120] In a possible implementation, the second determining module 704 includes:
[0121] A setting module, used to set the maximum gain of the maximum volume point in the volume range;
[0122] The fifth determination module is used to determine the gain of each volume point based on the maximum gain of the maximum volume point, the sound pressure level of each first volume point in the volume interval, and the preset sound pressure level of each preset volume point.
[0123] Specifically, the specific process of each module in the device of the embodiment of the present invention realizing its function can be referred to the relevant description in the method embodiment, which will not be repeated here.
[0124] In a possible implementation manner, the fifth determination module is further used to determine a sound pressure difference between the sound pressure level of the maximum volume point and the sound pressure levels of each first volume point, and the preset sound pressure levels of each preset volume point;
[0125] The gain at each volume point is determined based on the maximum gain and the sound pressure difference.
[0126] Specifically, the specific process of each module in the device of the embodiment of the present invention realizing its function can be referred to the relevant description in the method embodiment, which will not be repeated here.
[0127] In a possible implementation, the volume adjustment module 705 is further configured to obtain a target volume point;
[0128] A target gain corresponding to a volume point matching the target volume point is determined from each volume interval; and the audio volume is adjusted based on the target gain.
[0129] Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, Figure 8 The electronic device 1200 shown includes: at least one processor 1201, a memory 1202, at least one network interface 1204 and other user interfaces 1203. The various components in the electronic device 1200 are coupled together via a bus system 1205. It is understood that the bus system 1205 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 1205 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 1205 is not described in detail. Figure 8 Various buses are labeled as bus system 1205.
[0130] The user interface 1203 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).
[0131] It can be understood that the memory 1202 in the embodiment of the present invention can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The memory 1202 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0132] In some embodiments, the memory 1202 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 12021 and an application program 12022 .
[0133] The operating system 12021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 12022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present invention can be included in the application 12022.
[0134] In the embodiment of the present invention, by calling the program or instruction stored in the memory 1202, specifically, the program or instruction stored in the application 12022, the processor 1201 is used to execute the method steps provided by each method embodiment.
[0135] The method disclosed in the above embodiment of the present invention can be applied to the processor 1201, or implemented by the processor 1201. The processor 1201 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1201. The above processor 1201 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1202, and the processor 1201 reads the information in the memory 1202 and completes the steps of the above method in combination with its hardware.
[0136] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.
[0137] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0138] The electronic device provided in this embodiment may be Figure 8 The electronic device shown in FIG. 1 may perform the following steps: Figure 1 , 3 -6 volume adjustment method, and then achieve Figure 1 , 3 -6. For details, please refer to Figure 1 , 3 -6 Related descriptions are omitted here for the sake of brevity.
[0139] The embodiment of the present invention also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.
[0140] When one or more programs in the storage medium can be executed by one or more processors, the above volume adjustment method can be implemented.
[0141] The processor is used to execute the volume gain determination program stored in the memory to implement the steps of the volume adjustment method.
[0142] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0143] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0144] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A volume adjustment method, characterized in that: Applied to an electronic device with a speaker, the method comprises: Dividing the volume range of the electronic device into a plurality of volume intervals according to different usage volume scenarios; The following operations are performed for each of the volume intervals: a plurality of preset volume points and a preset sound pressure level corresponding to each of the preset volume points are acquired from the volume interval; Determine the sound pressure level of each first volume point in the volume interval according to each of the preset volume points and the preset sound pressure level corresponding to each of the preset volume points; wherein the first volume point is not the preset volume point; determining the gain of each volume point according to the sound pressure level of each first volume point within the volume interval and the preset sound pressure level of each preset volume point; The audio volume is adjusted based on the gain of each volume point in each volume interval.
2. The method according to claim 1, characterized in that The step of determining the sound pressure level of each first volume point in the volume interval according to each of the preset volume points and the preset sound pressure level corresponding to each of the preset volume points includes: Determining a volume sound pressure function of the volume interval according to the usage volume scenario corresponding to the volume interval; The sound pressure level of each first volume point in the volume interval is determined according to each of the preset volume points, the preset sound pressure levels corresponding to each of the preset volume points, and the volume sound pressure level function.
3. The method according to claim 2, characterized in that Determining the volume sound pressure function of the volume interval segment according to the usage scenario corresponding to the volume interval segment; A target usage volume scene matching the usage volume scene corresponding to the volume interval segment is searched from a volume sound pressure function query table; wherein the volume sound pressure function query table includes a correspondence between usage volume scenes and volume sound pressure functions: The target volume sound pressure function corresponding to the target usage volume scenario is determined as the volume sound pressure function of the volume interval segment.
4. The method according to claim 2, characterized in that: The determining the sound pressure level of each first volume in the volume interval according to each of the preset volume points, the preset sound pressure level corresponding to each of the preset volume points, and the volume sound pressure level function comprises: Substituting each of the preset volume points and the preset sound pressure levels corresponding to each of the preset volume points into the volume sound pressure level function, and solving to obtain function coefficients of the volume sound pressure level function; Substituting each of the first volume points within the volume interval and the function coefficient into the volume sound pressure level function, the sound pressure level of each of the first volume points within the volume interval is obtained.
5. The method according to claim 1, characterized in that The step of determining the gain of each volume point according to the sound pressure level of each of the first volume points within the volume interval and the preset sound pressure level of each of the preset volume points comprises: Setting the maximum gain of the maximum volume point in the volume range; The gain of each volume point is determined based on the maximum gain of the maximum volume point, the sound pressure level of each of the first volume points within the volume interval, and the preset sound pressure level of each of the preset volume points.
6. The method according to claim 5, characterized in that The determining the gain of each volume point based on the maximum gain of the maximum volume point, the sound pressure level of each of the first volume points in the volume interval, and the preset sound pressure level of each of the preset volume points includes: Determine a sound pressure difference between the sound pressure level of the maximum volume point and the sound pressure levels of each of the first volume points, and the preset sound pressure levels of each of the preset volume points; The gains of the respective volume points are determined based on the maximum gain and the sound pressure difference value.
7. The method according to claim 1, characterized in that The step of adjusting the audio volume based on the gain of each volume point in each volume interval includes: Get the target volume point; Determining a target gain corresponding to a volume point matching the target volume point from each of the volume intervals; The audio volume is adjusted based on the target gain.
8. A volume adjustment device, characterized in that: Applicable to an electronic device with a speaker, the device comprises: A division module, used to divide the volume range of the electronic device into a plurality of volume intervals according to different usage volume scenarios; An acquisition module is used to perform the following operations for each of the volume intervals: acquiring a plurality of preset volume points and a preset sound pressure level corresponding to each of the preset volume points from the volume interval; A first determining module, configured to determine the sound pressure level of each first volume point in the volume interval according to each of the preset volume points and the preset sound pressure level corresponding to each of the preset volume points; wherein the first volume point is not the preset volume point; a second determining module, configured to determine the gain of each volume point according to the sound pressure level of each of the first volume points within the volume interval and the preset sound pressure level of each of the preset volume points; The volume adjustment module is used to adjust the audio volume based on the gain of each volume point in each volume interval.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the processor is used to execute a volume gain determination program stored in the memory to implement the volume adjustment method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the volume adjustment method according to any one of claims 1 to 7.