[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN118433607A - Volume control method, volume control device, electronic equipment and computer storage medium - Google Patents

Volume control method, volume control device, electronic equipment and computer storage medium Download PDF

Info

Publication number
CN118433607A
CN118433607A CN202410509865.4A CN202410509865A CN118433607A CN 118433607 A CN118433607 A CN 118433607A CN 202410509865 A CN202410509865 A CN 202410509865A CN 118433607 A CN118433607 A CN 118433607A
Authority
CN
China
Prior art keywords
volume
adjusted
control gain
gain
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410509865.4A
Other languages
Chinese (zh)
Inventor
范俊民
邢梁梁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Awinic Technology Co Ltd
Original Assignee
Shanghai Awinic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Awinic Technology Co Ltd filed Critical Shanghai Awinic Technology Co Ltd
Priority to CN202410509865.4A priority Critical patent/CN118433607A/en
Publication of CN118433607A publication Critical patent/CN118433607A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2430/00Signal processing covered by H04R, not provided for in its groups

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

The embodiment of the invention provides a volume control method, a volume control device, electronic equipment and a computer storage medium. The method comprises the following steps: if the audio data played by the loudspeaker are changed, determining the volume change trend of the loudspeaker as volume reduction, volume increase, volume first reduction and then increase or volume first increase and then decrease according to the changed audio data; in the volume reduction process, controlling the volume reduction according to the first control gain in the first stage and controlling the volume reduction according to the second control gain in the second stage; during the volume increase, the volume increase is controlled in the first phase according to the third control gain, and then the audio volume increase is controlled according to the fourth control gain. The invention can smoothly adjust the volume of the loudspeaker, thereby ensuring the smooth hearing of the user and improving the user experience.

Description

Volume control method, volume control device, electronic equipment and computer storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a volume control method, a volume control device, electronic equipment and a computer storage medium.
Background
When the audio played by the loudspeaker changes, a ramp gain is usually required to be added to the loudspeaker, so that the volume of the audio played by the loudspeaker changes from large to small, and the listening smoothness is ensured. For example, when audio played by a speaker of a mobile terminal is switched from music to a call, a ramp gain needs to be added to the speaker.
The added slope gain in the prior art is a single slope control gain, and the change speed of the volume of the audio played by the loudspeaker is constant in the process of controlling the volume of the audio played by the loudspeaker to change from big to small.
Because of the sensitivity of the human ear to sound, the volume of the audio played by the loudspeaker is required to be reduced rapidly in the process of changing from big to small, so that the human ear is prevented from being damaged, and the volume of the audio played by the loudspeaker is reduced slowly, so that the hearing smoothness is ensured. However, in the prior art, the added single slope control gain cannot ensure that the volume of the audio played by the loudspeaker is firstly reduced rapidly and then reduced slowly, and thus the human ear is easily damaged.
Disclosure of Invention
In view of the above, embodiments of the present invention provide a volume control method, a volume control device, an electronic device, and a computer storage medium, which are used for solving at least some of the problems in the prior art.
According to a first aspect of an embodiment of the present invention, there is provided a volume control method, including:
If the audio data played by the loudspeaker are changed, determining the volume change trend of the loudspeaker as volume reduction, volume increase, volume first reduction and then increase or volume first increase and then decrease according to the changed audio data;
Controlling the volume reduction according to a first control gain in a first stage and controlling the volume reduction according to a second control gain in a second stage in a volume reduction process, wherein the volume reduction process comprises the volume reduction, the volume reduction in which the volume is reduced first and then increased and the volume reduction in which the volume is reduced first and then increased, and the first control gain is larger than the second control gain;
And in the process of increasing the volume, controlling the volume to be increased according to a third control gain in a first stage, and then controlling the audio volume to be increased according to the fourth control gain, wherein the process of increasing the volume comprises increasing the volume, increasing the volume after decreasing the volume, and increasing the volume before increasing the volume, and increasing the volume before decreasing the volume, and the third control gain is smaller than the fourth control gain.
In some embodiments, the controlling the volume reduction according to the first control gain in the first phase and the controlling the volume reduction according to the second control gain in the second phase during the volume reduction includes:
Acquiring a first initial volume of the loudspeaker, wherein if the volume reduction process is the volume reduction in which the volume is reduced and the volume is reduced first and then increased, the first initial volume is the volume when the audio data of the loudspeaker is unchanged, and if the volume reduction process is the volume reduction in which the volume is increased first and then reduced, the first initial volume is the volume of the loudspeaker after the volume is increased first and then increased;
Determining a first adjusted volume according to the first initial volume and the first control gain to control volume reduction in the first stage;
and determining a second adjustment volume according to the first adjustment volume and the second control gain so as to control volume reduction in the second stage.
In some embodiments, if the first control gain includes two first reduced sub-gains;
the determining a first adjusted volume according to the first initial volume and the first control gain includes:
Determining a first intermediate adjusted volume of the first adjusted volume based on the first initial volume and a first one of the first reduced sub-gains;
Determining the first adjusted volume according to the first intermediate adjusted volume and the second first reduced sub-gain of the first adjusted volume;
if the second control gain includes two second reduced sub-gains;
Determining a second adjusted volume according to the first adjusted volume and the second control gain, comprising:
Determining a first intermediate adjusted volume of the second adjusted volume based on the first adjusted volume and a first one of the second reduced sub-gains;
And determining the second adjusted volume according to the first intermediate adjusted volume and the second reduced sub-gain of the second adjusted volume, wherein the first reduced sub-gain is greater than the second reduced sub-gain.
In some embodiments, if the first control gain includes at least three first reduced sub-gains;
the determining a first adjusted volume according to the first initial volume and the first control gain includes:
determining the first intermediate adjusted volume of the first adjusted volume based on the first initial volume and the first one of the first reduced sub-gains;
determining a second adjusted volume of the first adjusted volume according to a first intermediate adjusted volume of the first adjusted volume and a second first reduced sub-gain;
Determining the first adjustment volume according to the H-1 intermediate adjustment volume and the H first reduced sub-gain of the first adjustment volume, wherein H is the number of the first reduced sub-gains, and H is more than or equal to 3;
If the second control gain includes at least three of the second reduced sub-gains;
Determining a first intermediate adjusted volume of the second adjusted volume based on the first adjusted volume and a first one of the second reduced sub-gains;
determining a second intermediate adjusted volume of the second adjusted volume based on the first intermediate adjusted volume of the second adjusted volume and the second reduced sub-gain;
and determining the second regulation volume according to the M-1 middle regulation volume and the M second reduced sub-gain of the second regulation volume, wherein M is the number of the second reduced sub-gains, and M is more than or equal to 3.
In some embodiments, during the increasing of the volume, controlling the increasing of the volume according to a third control gain and then controlling the increasing of the audio volume according to a fourth control gain in a first stage comprises:
Acquiring a second initial volume of the loudspeaker, wherein if the volume increasing process is that the volume is increased firstly and then the volume is increased firstly, the second initial volume is that the volume of the loudspeaker is not changed when the audio data of the loudspeaker is unchanged, and if the volume increasing process is that the volume is increased after the volume is increased firstly and then, the second initial volume is that the volume of the loudspeaker is that the volume is decreased firstly and then, the volume is decreased after the volume is decreased;
Determining a third adjusted volume according to the second initial volume and the third control gain to control volume increase in the third stage;
and determining a fourth adjusting volume according to the third adjusting volume and the fourth control gain so as to control volume increase in the fourth stage.
In some embodiments, if the third control gain includes two first increased sub-gains;
determining a third adjusted volume based on the second initial volume and the third control gain, comprising:
determining a first intermediate adjusted volume of the third adjusted volume based on the second initial volume and a first of the first increased sub-gains;
determining the third adjusted volume according to the first intermediate adjusted volume and the second first increased sub-gain of the third adjusted volume;
If the fourth control gain includes two second increased sub-gains;
Determining a fourth adjusted volume according to the third adjusted volume and the fourth control gain, including:
determining a first adjusted intermediate volume of the fourth adjusted volume based on the third adjusted volume and the first one of the second increased sub-gains;
And determining the fourth adjustment volume according to the first adjustment intermediate volume and the second increase sub-gain of the fourth adjustment volume, wherein the first increase sub-gain is smaller than the second increase sub-gain.
In some embodiments, if the third control gain includes at least three of the first increased sub-gains;
determining a third adjusted volume based on the second initial volume and the third control gain, comprising:
determining a first intermediate adjusted volume of said third adjusted volume based on said second initial volume and said first one of said first increased sub-gains;
Determining a second intermediate adjusted volume of the third adjusted volume according to the first intermediate adjusted volume of the third adjusted volume and the second first increased sub-gain;
determining the third regulation volume according to the Q-1 middle regulation volume and the Q-1 first increment sub-gain of the third regulation volume, wherein Q is the number of the first increment sub-gains, Q=M, and Q is more than or equal to 3;
If the fourth control gain includes at least three of the second increased sub-gains;
Determining a fourth adjusted volume according to the third adjusted volume and the fourth control gain, including:
determining a first adjusted intermediate volume of the fourth adjusted volume based on the third adjusted volume and the first one of the second increased sub-gains;
Determining a second adjusted intermediate volume of the fourth adjusted volume based on the first adjusted intermediate volume of the fourth adjusted volume and the second increased sub-gain;
And according to the P-1 th adjusting intermediate volume and the P second increasing sub-gain of the fourth adjusting volume, determining the fourth adjusting volume, wherein P is the number of the second increasing sub-gains, P=H, and P is more than or equal to 3.
According to a second aspect of an embodiment of the present invention, there is provided a volume control device, the device comprising:
the determining module is used for determining that the volume change trend of the loudspeaker is volume reduction, volume increase, volume first reduction and then increase or volume first increase and then decrease according to the changed audio data if the audio data played by the loudspeaker are changed;
A first adjustment module, configured to control, in a volume reduction process, a volume reduction according to a first control gain in a first stage, and control, in a second stage, a volume reduction according to a second control gain, where the volume reduction process includes the volume reduction, a volume first reduction in the volume first reduction and then an increase in the volume, and a volume second reduction in the volume first increase and then the decrease, and the first control gain is greater than the second control gain;
And the second adjusting module is used for controlling the volume to be increased according to a third control gain in the first stage in the volume increasing process and then controlling the audio volume to be increased according to the fourth control gain, wherein the volume increasing process comprises the volume increase, the volume increase in the process of firstly decreasing the volume and then increasing the volume and the volume increase in the process of firstly increasing the volume and then decreasing the volume, and the third control gain is smaller than the fourth control gain.
According to a third aspect of an embodiment of the present invention, there is provided an electronic apparatus including: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus; the memory is configured to store at least one executable instruction, where the executable instruction causes the processor to perform an operation corresponding to the volume control method according to the first aspect.
According to a fourth aspect of embodiments of the present invention, there is provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the volume control method as described in the first aspect.
According to the volume control scheme provided by the embodiment of the invention, the change trend of the volume of the loudspeaker is determined according to the change of the audio data played by the loudspeaker, the second audio volume is controlled to be reduced according to the first control gain in the first stage during the volume reduction process, the second audio volume is controlled to be reduced according to the second control gain in the second stage during the volume increase process, the second audio volume is controlled to be increased according to the third control gain in the first stage during the volume increase process, and then the second audio volume is controlled to be increased according to the fourth control gain. According to the embodiment of the invention, under the condition that the audio data played by the loudspeaker of the terminal is changed, the corresponding control gain is selected according to the change trend of the loudspeaker volume, the loudspeaker volume is adjusted by adjusting in stages, and the loudspeaker volume can be adjusted smoothly, so that the hearing smoothness of a user is ensured, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present invention, and other drawings may be obtained according to these drawings for a person having ordinary skill in the art.
Fig. 1 is a flow chart of steps of a volume control method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a preset control gain according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of another preset control gain according to an embodiment of the present invention;
fig. 4 is a block diagram of a volume control device according to an embodiment of the present invention;
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to better understand the technical solutions in the embodiments of the present invention, the following description will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which are derived by a person skilled in the art based on the embodiments of the present invention, shall fall within the scope of protection of the embodiments of the present invention.
When the audio played by the speaker of the terminal (mobile phone, tablet computer, etc.) changes, it is generally necessary to add a ramp gain to the speaker, so that the volume of the audio played by the speaker changes from large to small, so as to ensure a smooth hearing. For example, when the audio played by the speaker of the terminal is switched from music to conversation, a slope gain needs to be added to the speaker, so that the volume of the audio played by the speaker is ensured to be changed from large to small, and the ears of a person are ensured to be not damaged.
At present, when the volume of the loudspeaker is controlled to be changed from big to small, the control gain which is usually added is a single slope control gain, but the slope of the single slope control gain is fixed, and when the volume of the loudspeaker is controlled to be changed from big to small, the change amount of the volume of the loudspeaker is fixed, so that the volume of the loudspeaker is firstly quickly reduced and slowly reduced in the process of changing the volume of the loudspeaker from big to small, and further, the smoothness of the hearing feeling of a user cannot be ensured. Meanwhile, when the playing audio of the loudspeaker is changed rapidly, the single-slope control gain cannot respond, so that the volume of the loudspeaker cannot be adjusted.
In order to solve the above problems, an embodiment of the present invention provides a volume control method, which is applied to a terminal, where the terminal in this embodiment may include a mobile phone, a tablet computer, a phone watch, etc., and steps of the volume control method in this embodiment are as shown in fig. 1, and include:
S101, if the audio data played by the loudspeaker changes, determining the volume change trend of the loudspeaker as volume reduction, volume increase, volume first reduction and then increase or volume first increase and then decrease according to the changed audio data.
In the embodiment of the invention, when the terminal plays the audio through the loudspeaker, the audio data played by the terminal through the loudspeaker is obtained, and the change trend of the volume of the loudspeaker is determined under the condition that the audio data played by the loudspeaker of the terminal is detected to change.
In an example, the audio data played by the speaker in the embodiment of the present invention may be changed from the first audio to the second audio, or from the first audio to the second audio, and then changed to the first audio, so that the volume change trend may be determined according to the above change process. Specifically, in the process of changing the first audio to the second audio, if the volume of the first audio is smaller than that of the second audio, the volume change trend is that the volume is increased, and if the volume of the first audio is smaller than that of the second audio, the volume change trend is that the volume is reduced; in the process of changing from the first audio to the second audio and then from the first audio, if the volume of the first audio is smaller than that of the second audio, the volume change trend is that the volume is firstly increased and then decreased, and if the volume of the first audio is larger than that of the second audio, the volume change trend is that the volume is firstly decreased and then increased.
In one example, audio played by speakers of embodiments of the present invention may include music play, talk play, short video play, etc.
In one example, the audio played by the speaker of the embodiment of the present invention may be music playing, talking playing, and short video playing, the first audio may be music playing, talking playing, and short video playing, and the second audio may be music playing, talking playing, and short video playing.
S102, in the process of volume reduction, volume reduction is controlled according to the first control gain in the first stage, and volume reduction is controlled according to the second control gain in the second stage.
In the embodiment of the invention, in the process of volume reduction, the volume reduction is controlled in stages according to a first control gain and a second control gain which are stored in advance, wherein the volume reduction process comprises volume reduction, volume reduction in the process of volume reduction first and then volume increase and volume reduction in the process of volume reduction first and then volume increase first and then volume reduction, and the first control gain is larger than the second control gain. Specifically, the volume reduction process is adjusted into a first stage and a second stage, wherein in the first stage, the second audio volume is controlled to be rapidly reduced according to the first control gain, and in the second stage, the second audio volume is controlled to be slowly reduced according to the second control gain, so that the second audio volume can be rapidly reduced first, and the second audio volume can be slowly reduced.
In one example, if the volume reduction process is a volume first reduction in which the volume is first reduced and then increased, the volume first reduction portion is divided into a first stage in which the second audio volume is controlled to be rapidly reduced according to the first control gain and a second stage in which the second audio volume is controlled to be slowly reduced according to the second control gain; if the volume reduction process is volume reduction in the process of volume first increasing and then reducing, the volume post-reduction is divided into a first stage and a second stage, wherein in the first stage, the second audio volume is controlled to be rapidly reduced according to the first control gain, and in the second stage, the second audio volume is controlled to be slowly reduced according to the second control gain.
In one example, as shown in fig. 2, a control gain schematic diagram is provided for an embodiment of the present invention, where the preset control gain in the embodiment of the present invention includes a first control gain and a second control gain, the target gain (target volume) is greater than the initial gain (initial volume), the first control gain is a portion t2-t3 shown in fig. 2, the second control gain is a portion t3-t4, as can be seen in fig. 2, in the first stage t2-t3, the second audio volume is controlled to decrease rapidly according to the first control gain, and in the second stage t3-t4, the second audio is controlled to decrease slowly according to the second control gain.
Specifically, the t1-t2 portion shown in fig. 2 is a stage of maintaining the speaker volume;
s103, in the process of increasing the volume, the volume is controlled to be increased according to the third control gain in the first stage, and then the audio volume is controlled to be increased according to the fourth control gain.
In the embodiment of the invention, the volume increase is controlled in stages according to the third control gain and the fourth control gain which are stored in advance, wherein the volume increase process comprises volume increase, volume increase in volume first decrease then increase and volume first increase in volume first increase then decrease, and the third control gain is smaller than the fourth control gain. Specifically, the volume adjustment is divided into a first stage and a second stage, wherein in the first stage, the second audio volume is controlled to be slowly increased according to the third control gain, and in the second stage, the second audio volume is controlled to be rapidly increased according to the second control gain, so that the second audio volume can be slowly increased first, and the second audio volume can be rapidly increased.
In one example, as shown in fig. 2, a control gain schematic diagram is provided in the embodiment of the present invention, where the preset control gain in the embodiment of the present invention includes a third control gain and a fourth control gain, the target gain (target volume) is greater than the initial gain (initial volume), the third control gain is a portion 0-t0 shown in fig. 2, the second control gain is a portion t0-t1, as can be seen in fig. 2, in the first portion 0-t0, the second audio volume is controlled to slowly increase according to the third control gain, in the second portion t0-t1, the second audio is controlled to rapidly increase according to the second control gain.
According to the volume control method provided by the embodiment of the invention, the change trend of the volume of the loudspeaker is determined when the audio data played by the loudspeaker is changed and the asking money is modified, the volume of the loudspeaker is reduced according to the first control gain in the first stage, the volume of the second audio is reduced according to the second control gain in the second stage, the volume of the second audio is increased according to the third control gain in the first stage in the volume increasing process, and then the volume of the second audio is increased according to the fourth control gain. According to the embodiment of the invention, under the condition that the audio data played by the loudspeaker of the terminal is changed, the corresponding control gain is selected according to the change trend of the loudspeaker volume, the loudspeaker volume is adjusted by adjusting in stages, and the loudspeaker volume can be adjusted smoothly, so that the hearing smoothness of a user is ensured, and the user experience is improved.
In an example, when audio played by a speaker is converted from music playing to call playing, by the method provided by the embodiment of the invention, the volume of the speaker when the speaker plays the call can be quickly reduced through the first control gain, so that the ear of a person is prevented from being damaged, the volume of the speaker when the speaker plays the call is further slowly reduced through the second control gain, the hearing smoothness of a user can be ensured, and the user experience is further improved.
Further, in the volume reduction process according to the embodiment of the present invention, the volume reduction is controlled according to the first control gain in the first stage, and the volume reduction is controlled according to the second control gain in the second stage, which may include the following steps:
s1021, a first initial volume of the loudspeaker is obtained.
In the embodiment of the invention, when the audio data played by the loudspeaker changes, a first initial volume of the loudspeaker is obtained, specifically, if the volume reduction process is volume reduction and volume reduction in which the volume is firstly reduced and then increased, the first initial volume is volume when the audio data of the loudspeaker does not change, and if the volume reduction process is volume reduction in which the volume is firstly increased and then reduced, the first initial volume is volume after the volume is firstly increased and then is increased.
In one example, if the speaker changes from music playing to talking playing and the volume of the music playing is greater than the volume of the talking playing, the first initial volume corresponding to the volume decrease is the volume of the music playing, if the speaker changes from music playing to talking playing and then changes to music playing and the volume of the music playing is greater than the volume of the talking playing, the first initial volume corresponding to the volume decrease after the volume decrease is the volume of the music playing, and the first initial volume corresponding to the volume decrease after the volume decrease is the volume of the talking playing.
S1022, determining a first adjusting volume according to the first initial volume and the first control gain, so as to control the volume reduction of the second audio in the first stage.
In the embodiment of the invention, after the first initial volume is determined, in the first stage of volume adjustment, the first adjustment volume is determined according to the first initial volume and the first control gain, so as to complete the volume adjustment in the first stage, and the volume of the loudspeaker is quickly reduced. Specifically, during the first phase adjustment, the first initial volume is multiplied by the first control gain, and the first adjusted volume may be determined.
In one example, if the first control gain includes two first reduced sub-gains, in determining the first adjusted volume, a first intermediate adjusted volume of the first adjusted volume may be determined based on the first initial volume and the first reduced sub-gain, and the first adjusted volume may be determined based on the first intermediate adjusted volume of the first adjusted volume and the second first reduced sub-gain to determine the first adjusted volume.
In one example, if the first control gain includes at least 3 first reduced sub-gains, when determining the first adjusted volume based on the first initial volume and the first control gain, determining a first intermediate adjusted volume of the first adjusted volume based on the first initial volume and the first reduced sub-gain, determining a second adjusted volume of the first adjusted volume based on the first intermediate adjusted volume of the first adjusted volume and the second first reduced sub-gain, determining the first adjusted volume based on the H-1 intermediate adjusted volume of the first adjusted volume and the H first reduced sub-gain, wherein H is the number of the first reduced sub-gains, and H is greater than or equal to 3.
In one example, as shown in fig. 3, another control gain schematic diagram provided in the embodiment of the invention, where the first control sub-gain includes a plurality of first reduced sub-gains, as shown in fig. 3, the target gain (target volume) is greater than the initial gain (initial volume), the first reduced sub-gain is-k_n segment in the diagram, the second first reduced sub-gain is-k_n-1 segment, and so on, the H first reduced sub-gain is-K-2 segment, when the first control gain includes 3 first reduced sub-gains, the first reduced sub-gain is t4-t5 segment in fig. 3, the second first reduced sub-gain is t5-t6 segment corresponding to fig. 3, the third first reduced sub-gain is t6-t7 segment in fig. 3, when determining the first adjusted volume, the first intermediate volume is determined according to the initial volume and the first reduced sub-gain (-k_n) segment, the first adjusted volume is determined according to the first intermediate volume, and the second intermediate volume is determined according to the first intermediate volume (-k_adjusted by the first reduced sub-gain) and the first reduced sub-gain (-k_2 segment.
In one example, where the first control gain includes a plurality of first reduced sub-gains, the magnitude between the plurality of first reduced sub-gains may be from large to small, i.e., the first reduced sub-gain is greater than the second first reduced sub-gain is greater than … … th first reduced sub-gain, or may be in other order, e.g., the first reduced sub-gain is greater than the second first reduced sub-gain, which is less than the 3 rd first reduced sub-gain.
S1023, determining a second adjusting volume according to the first adjusting volume and the second control gain, so as to control the volume reduction of the second audio in the second stage.
In the embodiment of the invention, after the volume adjustment in the first stage is performed, the second adjustment volume is determined according to the first adjustment volume and the second control gain in the first stage, so as to complete the volume adjustment in the second stage, and the volume of the second audio played by the loudspeaker is slowly reduced. Specifically, during the first phase adjustment, the first adjustment volume is multiplied by the second control gain, and the second adjustment volume may be determined.
In one example, if the second control gain includes two second reduced sub-gains, when determining the first adjusted volume according to the second control gain, determining a first intermediate adjusted volume of the second adjusted volume according to the first adjusted volume and the first second reduced sub-gain, and determining the second adjusted volume according to the first intermediate adjusted volume of the second adjusted volume and the second reduced sub-gain.
In one example, if the second control gain includes at least 3 second reduced sub-gains, determining a first intermediate adjusted volume of the second adjusted volume based on the first adjusted volume and the first second reduced sub-gains when determining the first adjusted volume based on the second control gain; determining a second intermediate adjusted volume of the second adjusted volume based on the first intermediate adjusted volume of the second adjusted volume and the second reduced sub-gain; and determining the second regulation volume according to the M-1 middle regulation volume and the M second reduced sub-gain of the second regulation volume, wherein M is the number of the second reduced sub-gains, and M is more than or equal to 3.
In one example, as shown in fig. 3, the number of the second control gains may be 1, and when the first adjustment volume is determined according to the second control gain, the first adjustment volume is multiplied by the second control gain, so that the second adjustment volume may be determined.
In one example, the first reduced sub-gain is greater than the second reduced sub-gain, i.e., the rate of reduction of the volume of the second audio of the speaker in the first phase is greater than the rate of reduction in the second phase.
When the volume change trend is volume reduction, the embodiment of the invention adjusts the second audio volume in stages through the first control gain and the second control gain, and can smoothly adjust the volume of the loudspeaker, thereby ensuring smooth hearing of a user and improving user experience.
Further, in the process of increasing the volume, the step of controlling the volume to increase according to the third control gain and then controlling the audio volume to increase according to the fourth control gain in the first stage may include the following steps:
S1031, obtaining the initial volume of the second audio.
In the embodiment of the invention, when the audio data played by the loudspeaker is changed, the second initial volume of the loudspeaker is obtained. Specifically, the volume increasing process is volume increasing and volume increasing in the process of volume increasing and volume decreasing after the volume increasing, the second initial volume is volume when the audio data of the loudspeaker is unchanged, and if the volume increasing process is volume increasing in the process of volume decreasing after the volume increasing, the second initial volume is volume after the volume decreasing in the process of volume decreasing after the volume increasing.
In one example, if the speaker changes from music playing to talking playing and the volume of the music playing is smaller than the volume of the talking playing, the second initial volume corresponding to the volume increase is the volume of the music playing, if the speaker changes from music playing to talking playing and then changes to music playing and the volume of the music playing is smaller than the volume of the talking playing, the second initial volume corresponding to the volume first increasing and then decreasing is the volume of the music playing, and the second initial volume corresponding to the volume first decreasing and then increasing is the volume of the talking, namely the volume first decreasing and then increasing is the volume after decreasing.
S1032, determining a third adjustment volume according to the second initial volume and the third control gain to control the second audio volume to increase in the third phase.
In the embodiment of the invention, after the second initial volume is determined, in the first stage of volume adjustment, the third adjustment volume is determined according to the second initial volume and the third control gain, so as to complete the volume adjustment in the first stage, and the volume played by the loudspeaker is slowly increased.
In one example, if the third control gain may include 2 first increased sub-gains, when determining the third adjusted volume according to the second initial volume and the third control gain, determining a first intermediate adjusted volume of the third adjusted volume according to the second initial volume and the first increased sub-gain; and determining the third adjusted volume according to the first intermediate adjusted volume and the second first increased sub-gain of the third adjusted volume.
In one example, if the third control gain may include at least 3 first increased sub-gains, determining a first intermediate adjusted volume of the third adjusted volume based on the second initial volume and the first increased sub-gain when determining the third adjusted volume based on the second initial volume and the third control gain; determining a second intermediate adjusted volume of the third adjusted volume based on the first intermediate adjusted volume of the third adjusted volume and the second first increased sub-gain; and determining the third regulation volume according to the Q-1 middle regulation volume and the Q first increase sub-gain of the third regulation volume, wherein Q is the number of the first increase sub-gains, Q=M, and Q is more than or equal to 3.
In one example, as shown in fig. 3, the number of the third control gains may be 1, and when determining the third adjustment volume according to the third control gain, the third adjustment volume may be determined by multiplying the initial volume by the third control gain.
S1033, determining a fourth adjusting volume according to the third adjusting volume and the fourth control gain, so as to control the second audio volume to be increased in the fourth stage.
In the embodiment of the invention, after the volume adjustment in the first stage is completed, the fourth adjustment volume is determined according to the third adjustment volume and the fourth control gain in the first stage, so as to complete the volume adjustment in the second stage, and the volume of the second audio played by the loudspeaker is rapidly increased.
In one example, if the fourth control gain includes 2 second increased sub-gains, when determining the fourth adjusted volume according to the third adjusted volume and the fourth control gain, a first adjusted intermediate volume of the fourth adjusted volume may be determined according to the third adjusted volume and the first second increased sub-gains; and determining the fourth adjusted volume according to the first adjusted intermediate volume and the second increased sub-gain of the fourth adjusted volume.
In one example, if the fourth control gain includes at least 3 second increased sub-gains, when determining the fourth adjusted volume according to the third adjusted volume and the fourth control gain, a first adjusted intermediate volume of the fourth adjusted volume may be determined according to the third adjusted volume and the first second increased sub-gains; determining a second adjusted intermediate volume of the fourth adjusted volume based on the first adjusted intermediate volume of the fourth adjusted volume and the second increased sub-gain; and according to the P-1 th adjusting intermediate volume and the P second increasing sub-gain of the fourth adjusting volume, determining the fourth adjusting volume, wherein the number of the P second increasing sub-gains, P=H, and P is more than or equal to 3. For example, as shown in fig. 3, the target gain (target volume) is greater than the initial gain (initial volume), and the fourth control gain includes a plurality of second increasing sub-gains, wherein the first second increasing sub-gain is k_2 segments, the second increasing sub-gain is k_n-1 segments, and the P second increasing sub-gain is k_n segments. When the fourth control sub-gain includes 3 second increased sub-gains, a first adjusted intermediate volume of the fourth adjusted volume is determined based on the third adjusted volume and the first second increased sub-gain (t 0-t 1) segment, a second adjusted intermediate volume of the fourth adjusted volume is determined based on the first adjusted intermediate volume of the fourth adjusted volume and the second increased sub-gain (t 1-t 2) segment, and a fourth adjusted volume is determined based on the second adjusted intermediate volume of the fourth adjusted volume and the third second increased sub-gain (t 2-t 3) segment.
In one example, where the fourth control gain includes a plurality of second increased sub-gains, the magnitudes between the plurality of second increased sub-gains may be from small to large, or in other orders.
In one example, the first increased sub-gain is less than the second increased sub-gain of embodiments of the present invention.
According to the embodiment of the invention, when the volume change trend is volume increase, the second audio volume is adjusted in stages through the third control gain and the fourth control gain, so that the volume of the loudspeaker can be smoothly adjusted, the hearing smoothness of a user is ensured, and the user experience is improved.
Further, an embodiment of the present invention provides a volume control device, which is applied to a terminal, and specifically as shown in fig. 4, including:
The determining module 401 is configured to determine, if audio data played by the speaker changes, that the volume change trend of the speaker is volume decrease, volume increase, volume decrease first and then increase or volume increase first and then decrease according to the changed audio data;
A first adjustment module 402, configured to control, during a volume reduction process, a volume reduction according to a first control gain in a first stage, and a volume reduction according to a second control gain in a second stage, where the volume reduction process includes a volume reduction, a volume reduction in which the volume is reduced first and then increased, and a volume reduction in which the volume is reduced first and then increased, the first control gain being greater than the second control gain;
The second adjusting module 403 is configured to control, in a first stage, an increase in volume according to a third control gain and then an increase in audio volume according to a fourth control gain during a volume increase process, where the volume increase process includes an increase in volume, a decrease in volume followed by an increase in volume, and the third control gain is smaller than the fourth control gain.
The volume control device in this embodiment is configured to implement the corresponding volume control method in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again. In addition, the functional implementation of each module in the volume control device of the present embodiment may refer to the description of the corresponding parts in the foregoing method embodiments, which is not repeated herein.
Referring to fig. 5, a schematic structural diagram of an electronic device according to an embodiment of the present invention is shown, and the specific embodiment of the present invention is not limited to the specific implementation of the electronic device.
As shown in fig. 5, the electronic device may include: a processor 502, a communication interface (CommuH icat ioHs I HTERFACE) 504, a memory 506, and a communication bus 508.
Wherein:
processor 502, communication interface 504, and memory 506 communicate with each other via communication bus 508.
A communication interface 504 for communicating with other electronic devices or servers.
The processor 502 is configured to execute the program 510, and may specifically perform relevant steps in the above-described embodiment of the volume control method.
In particular, program 510 may include program code including computer-operating instructions.
The processor 502 may be a central processing unit CPU, or a specific integrated circuit AS ic (App l icat ioH SPEC I F IC I HTEGRATED CI rcu it), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors comprised by the smart device may be the same type of processor, such as one or more CPUs; but may also be different types of processors such AS one or more CPUs and one or more AS ics.
A memory 506 for storing a program 510. Memory 506 may comprise high-speed RAM memory or may also include non-volatile memory (HoH-vo l at i l e memory), such as at least one disk memory.
The program 510 may be specifically operable to cause the processor 502 to:
In an alternative implementation manner, the program 510 is further configured to enable the specific implementation of each step of the processor 502 in the program 510 to refer to corresponding steps and corresponding descriptions in units in the foregoing embodiment of the volume control method, which are not described herein in detail. It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus and modules described above may refer to corresponding procedure descriptions in the foregoing method embodiments, which are not repeated herein.
The embodiments of the present invention also provide a computer program product, which includes computer instructions that instruct a computing device to perform operations corresponding to any one of the volume control methods in the above-described method embodiments.
It should be noted that, according to implementation requirements, each component/step described in the embodiments of the present invention may be split into more components/steps, or two or more components/steps or part of operations of the components/steps may be combined into new components/steps, so as to achieve the objects of the embodiments of the present invention.
The above-described methods according to embodiments of the present invention may be implemented in hardware, firmware, or AS software or computer code storable in a recording medium such AS a CD ROM, RAM, floppy disk, hard disk, or magneto-optical disk, or AS computer code originally stored in a remote recording medium or a non-transitory machine-readable medium and to be stored in a local recording medium downloaded through a network, so that the methods described herein may be processed by such software on a recording medium using a general purpose computer, a special purpose processor, or programmable or dedicated hardware such AS an AS ic or FPGA. It is understood that a computer, processor, microprocessor controller, or programmable hardware includes a memory component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code that, when accessed and executed by the computer, processor, or hardware, implements the methods of generating the check code described herein. Further, when the general-purpose computer accesses code for implementing the volume control method shown herein, execution of the code converts the general-purpose computer into a special-purpose computer for executing the volume control method shown herein.
Those of ordinary skill in the art will appreciate that the elements and method steps of the examples described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or as a combination of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present invention.
The above embodiments are only for illustrating the embodiments of the present invention, but not for limiting the embodiments of the present invention, and various changes and modifications may be made by one skilled in the relevant art without departing from the spirit and scope of the embodiments of the present invention, so that all equivalent technical solutions also fall within the scope of the embodiments of the present invention, and the scope of the embodiments of the present invention should be defined by the claims.

Claims (10)

1. A method of volume control, the method comprising:
If the audio data played by the loudspeaker are changed, determining the volume change trend of the loudspeaker as volume reduction, volume increase, volume first reduction and then increase or volume first increase and then decrease according to the changed audio data;
Controlling the volume reduction according to a first control gain in a first stage and controlling the volume reduction according to a second control gain in a second stage in a volume reduction process, wherein the volume reduction process comprises the volume reduction, the volume reduction in which the volume is reduced first and then increased and the volume reduction in which the volume is reduced first and then increased, and the first control gain is larger than the second control gain;
In the process of increasing the volume, controlling the volume to be increased according to a third control gain in a first stage, and then controlling the audio volume to be increased according to the fourth control gain, wherein the process of increasing the volume comprises increasing the volume, increasing the volume after decreasing the volume, and increasing the volume before increasing the volume, and increasing the volume before decreasing the volume, and the third control gain is smaller than the fourth control gain.
2. The method of claim 1, wherein during the volume reduction, controlling the volume reduction according to the first control gain in a first phase and controlling the volume reduction according to the second control gain in a second phase comprises:
Acquiring a first initial volume of the loudspeaker, wherein if the volume reduction process is the volume reduction in which the volume is reduced and the volume is reduced first and then increased, the first initial volume is the volume when the audio data of the loudspeaker is unchanged, and if the volume reduction process is the volume reduction in which the volume is increased first and then reduced, the first initial volume is the volume of the loudspeaker after the volume is increased first and then increased;
Determining a first adjusted volume according to the first initial volume and the first control gain to control volume reduction in the first stage;
and determining a second adjustment volume according to the first adjustment volume and the second control gain so as to control volume reduction in the second stage.
3. The method of claim 2, wherein if the first control gain comprises two first reduced sub-gains;
the determining a first adjusted volume according to the first initial volume and the first control gain includes:
Determining a first intermediate adjusted volume of the first adjusted volume based on the first initial volume and a first one of the first reduced sub-gains;
Determining the first adjusted volume according to the first intermediate adjusted volume and the second first reduced sub-gain of the first adjusted volume;
if the second control gain includes two second reduced sub-gains;
Determining a second adjusted volume according to the first adjusted volume and the second control gain, comprising:
Determining a first intermediate adjusted volume of the second adjusted volume based on the first adjusted volume and a first one of the second reduced sub-gains;
And determining the second adjusted volume according to the first intermediate adjusted volume and the second reduced sub-gain of the second adjusted volume, wherein the first reduced sub-gain is greater than the second reduced sub-gain.
4. The method of claim 2, wherein if the first control gain comprises at least three first reduced sub-gains;
the determining a first adjusted volume according to the first initial volume and the first control gain includes:
determining the first intermediate adjusted volume of the first adjusted volume based on the first initial volume and the first one of the first reduced sub-gains;
determining a second adjusted volume of the first adjusted volume according to a first intermediate adjusted volume of the first adjusted volume and a second first reduced sub-gain;
Determining the first adjustment volume according to the H-1 intermediate adjustment volume and the H first reduced sub-gain of the first adjustment volume, wherein H is the number of the first reduced sub-gains, and H is more than or equal to 3;
If the second control gain includes at least three of the second reduced sub-gains;
Determining a first intermediate adjusted volume of the second adjusted volume based on the first adjusted volume and a first one of the second reduced sub-gains;
determining a second intermediate adjusted volume of the second adjusted volume based on the first intermediate adjusted volume of the second adjusted volume and the second reduced sub-gain;
and determining the second regulation volume according to the M-1 middle regulation volume and the M second reduced sub-gain of the second regulation volume, wherein M is the number of the second reduced sub-gains, and M is more than or equal to 3.
5. The method of claim 1, wherein during the volume up, controlling the volume up according to a third control gain and then controlling the audio volume up according to the fourth control gain in a first phase comprises:
Acquiring a second initial volume of the loudspeaker, wherein if the volume increasing process is that the volume is increased firstly and then the volume is increased firstly, the second initial volume is that the volume of the loudspeaker is not changed when the audio data of the loudspeaker is unchanged, and if the volume increasing process is that the volume is increased after the volume is increased firstly and then, the second initial volume is that the volume of the loudspeaker is that the volume is decreased firstly and then, the volume is decreased after the volume is decreased;
Determining a third adjusted volume according to the second initial volume and the third control gain to control volume increase in the third stage;
and determining a fourth adjusting volume according to the third adjusting volume and the fourth control gain so as to control volume increase in the fourth stage.
6. The method of claim 5, wherein if the third control gain comprises two first increased sub-gains;
determining a third adjusted volume based on the second initial volume and the third control gain, comprising:
determining a first intermediate adjusted volume of the third adjusted volume based on the second initial volume and a first of the first increased sub-gains;
determining the third adjusted volume according to the first intermediate adjusted volume and the second first increased sub-gain of the third adjusted volume;
If the fourth control gain includes two second increased sub-gains;
Determining a fourth adjusted volume according to the third adjusted volume and the fourth control gain, including:
determining a first adjusted intermediate volume of the fourth adjusted volume based on the third adjusted volume and the first one of the second increased sub-gains;
And determining the fourth adjustment volume according to the first adjustment intermediate volume and the second increase sub-gain of the fourth adjustment volume, wherein the first increase sub-gain is smaller than the second increase sub-gain.
7. The method of claim 5, wherein if said third control gain comprises at least three of said first increased sub-gains;
determining a third adjusted volume based on the second initial volume and the third control gain, comprising:
determining a first intermediate adjusted volume of said third adjusted volume based on said second initial volume and said first one of said first increased sub-gains;
Determining a second intermediate adjusted volume of the third adjusted volume according to the first intermediate adjusted volume of the third adjusted volume and the second first increased sub-gain;
determining the third regulation volume according to the Q-1 middle regulation volume and the Q-1 first increment sub-gain of the third regulation volume, wherein Q is the number of the first increment sub-gains, Q=M, and Q is more than or equal to 3;
If the fourth control gain includes at least three of the second increased sub-gains;
Determining a fourth adjusted volume according to the third adjusted volume and the fourth control gain, including:
determining a first adjusted intermediate volume of the fourth adjusted volume based on the third adjusted volume and the first one of the second increased sub-gains;
Determining a second adjusted intermediate volume of the fourth adjusted volume based on the first adjusted intermediate volume of the fourth adjusted volume and the second increased sub-gain;
And according to the P-1 th adjusting intermediate volume and the P second increasing sub-gain of the fourth adjusting volume, determining the fourth adjusting volume, wherein P is the number of the second increasing sub-gains, P=H, and P is more than or equal to 3.
8. A volume control device, the device comprising:
the determining module is used for determining that the volume change trend of the loudspeaker is volume reduction, volume increase, volume first reduction and then increase or volume first increase and then decrease according to the changed audio data if the audio data played by the loudspeaker are changed;
A first adjustment module, configured to control, in a volume reduction process, a volume reduction according to a first control gain in a first stage, and control, in a second stage, a volume reduction according to a second control gain, where the volume reduction process includes the volume reduction, a volume first reduction in the volume first reduction and then an increase in the volume, and a volume second reduction in the volume first increase and then the decrease, and the first control gain is greater than the second control gain;
And the second adjusting module is used for controlling the volume to be increased according to a third control gain in the first stage in the volume increasing process and then controlling the audio volume to be increased according to the fourth control gain, wherein the volume increasing process comprises the volume increase, the volume increase in the process of firstly decreasing the volume and then increasing the volume and the volume increase in the process of firstly increasing the volume and then decreasing the volume, and the third control gain is smaller than the fourth control gain.
9. An electronic device, comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
The memory is configured to store at least one executable instruction, where the executable instruction causes the processor to perform operations corresponding to the volume control method according to any one of claims 1 to 7.
10. A computer storage medium having stored thereon a computer program which when executed by a processor implements a volume control method as claimed in any one of claims 1 to 7.
CN202410509865.4A 2024-04-25 2024-04-25 Volume control method, volume control device, electronic equipment and computer storage medium Pending CN118433607A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410509865.4A CN118433607A (en) 2024-04-25 2024-04-25 Volume control method, volume control device, electronic equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410509865.4A CN118433607A (en) 2024-04-25 2024-04-25 Volume control method, volume control device, electronic equipment and computer storage medium

Publications (1)

Publication Number Publication Date
CN118433607A true CN118433607A (en) 2024-08-02

Family

ID=92325847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410509865.4A Pending CN118433607A (en) 2024-04-25 2024-04-25 Volume control method, volume control device, electronic equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN118433607A (en)

Similar Documents

Publication Publication Date Title
CN105245195B (en) For the technology of distortion reduction multiband compressor reducer protected with sound quality
WO2017215657A1 (en) Sound effect processing method, and terminal device
US11201598B2 (en) Volume adjusting method and mobile terminal
CN107465824B (en) Volume adjusting method and device, mobile terminal and storage medium
CN104967960A (en) Voice data processing method, and voice data processing method and system in game live broadcasting
CN107799113B (en) Audio processing method and device, storage medium and mobile terminal
CN107526570B (en) Volume adjusting method and device, terminal equipment and storage medium
WO2019033942A1 (en) Volume adjustment method and apparatus, terminal device, and storage medium
CN112217486B (en) Audio playing control method and system, electronic equipment and storage medium
CN107483734B (en) Volume adjusting method and device, terminal equipment and storage medium
CN110928518A (en) Audio data processing method and device, electronic equipment and storage medium
WO2019033440A1 (en) Volume adjustment method and apparatus, terminal device, and storage medium
CN112188342B (en) Equalization parameter determining method, apparatus, electronic device and storage medium
CN112088353A (en) Dynamic processing effect architecture
CN107508983B (en) Volume adjusting method and device, storage medium and terminal equipment
WO2019033941A1 (en) Volume adjustment method and apparatus, terminal device, and storage medium
CN107506168B (en) Volume adjusting method and device, terminal equipment and storage medium
CN113360129A (en) Sound playing method and device, electronic equipment and readable storage medium
CN118433607A (en) Volume control method, volume control device, electronic equipment and computer storage medium
CN106331356B (en) Volume control method and terminal
CN106293607B (en) Method and system for automatically switching audio output modes
CN112307161B (en) Method and apparatus for playing audio
WO2019033939A1 (en) Volume adjustment method and apparatus, terminal device, and storage medium
CN110753919B (en) Volume adjusting method and device, storage medium and mobile terminal
CN112185414B (en) Audio play volume adjusting method and device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination