CN107371094B - Volume adjusting method and device and processing equipment - Google Patents

Volume adjusting method and device and processing equipment Download PDF

Info

Publication number
CN107371094B
CN107371094B CN201710734461.5A CN201710734461A CN107371094B CN 107371094 B CN107371094 B CN 107371094B CN 201710734461 A CN201710734461 A CN 201710734461A CN 107371094 B CN107371094 B CN 107371094B
Authority
CN
China
Prior art keywords
volume
audio playing
audio
adjusting
adjustment operation
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.)
Active
Application number
CN201710734461.5A
Other languages
Chinese (zh)
Other versions
CN107371094A (en
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.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology 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 Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to CN201710734461.5A priority Critical patent/CN107371094B/en
Publication of CN107371094A publication Critical patent/CN107371094A/en
Application granted granted Critical
Publication of CN107371094B publication Critical patent/CN107371094B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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)
  • Control Of Amplification And Gain Control (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

The invention discloses a volume adjusting method, a volume adjusting device and processing equipment, wherein the method comprises the following steps: detecting a volume adjustment operation aiming at the audio playing equipment; in the process of the volume adjustment operation, acquiring the operation position of the volume adjustment operation at intervals of preset time; determining a target volume corresponding to the operation position; calculating the volume difference between the target volume and the current volume of the audio playing equipment; and adjusting the volume output by the audio playing equipment based on the volume difference. The embodiment of the invention can realize continuous adjustment of the volume and improve the sensitivity of the section so as to realize accurate adjustment.

Description

Volume adjusting method and device and processing equipment
Technical Field
The invention belongs to the technical field of electronics, and particularly relates to a volume adjusting method and device and processing equipment.
Background
In various types of electronic devices in which a volume adjustment device is installed, the volume adjustment device may be generally used to adjust the volume of the electronic device. The volume adjusting device mainly comprises a key adjusting device, a code adjuster, a touch panel and the like, and the volume adjusting device mainly adjusts the volume in a linear segmentation mode.
In the prior art, when volume is adjusted in a linear segmentation manner, sound is generally divided into volume segments with the same volume change from the minimum value to the maximum value in sequence, each volume segment corresponds to a corresponding volume, and when a certain position is adjusted, the volume segment corresponding to the position can be determined, so that the volume corresponding to the volume segment can be determined, and the corresponding volume can be adjusted. For example, when the volume is controlled by using the touch control panel, the user slides the sound adjustment control manually, and when the user slides from the start position to the end position, the volume segment corresponding to the start position and the volume segment corresponding to the end position can be determined, and then the volume can be adjusted from the start volume of the start volume segment to the end volume of the end volume segment.
As can be seen from the above description, the volume adjustment is performed by directly adopting a linear segment control manner, and in this process, the sound is directly adjusted from the initial volume to the final volume, the sound changes greatly, and the final volume that may be modulated is not the volume that the user needs, so that the volume change is not sensitive enough in the adjustment process, and the accuracy of the volume adjustment is low.
Disclosure of Invention
In view of this, the present invention provides a volume adjusting method, a volume adjusting device, and a processing device, which are mainly used to solve the problems in the prior art that a volume adjusting device directly adjusts a sound to an end volume, so that a sound response is not sensitive enough in a sound adjusting process, and an adjusting accuracy is low.
In order to solve the above technical problem, a first aspect of the present invention provides a volume adjustment method, including:
detecting a volume adjustment operation aiming at the audio playing equipment;
in the process of the volume adjustment operation, acquiring the operation position of the volume adjustment operation at intervals of preset time;
determining a target volume corresponding to the operation position;
calculating the volume difference between the target volume and the current volume of the audio playing equipment;
and adjusting the volume output by the audio playing equipment based on the volume difference.
Preferably, the adjusting the output volume of the audio playing device based on the volume difference comprises:
calculating the control gain of the audio coding and decoding chip based on the volume difference;
searching a coding and decoding data table of the audio coding and decoding chip to obtain a volume value corresponding to the control gain;
and adjusting the volume output by the audio playing equipment through an audio coding and decoding chip based on the volume value.
Preferably, the calculating the control gain of the audio codec chip based on the volume difference includes:
and calculating the control gain of the audio coding and decoding chip by using a PD algorithm based on the volume difference.
Preferably, the adjusting the output volume of the audio playing device based on the volume difference comprises:
judging whether the volume difference is zero or not;
if yes, stopping the volume increasing operation of the audio playing equipment;
and if not, adjusting the output volume of the audio playing equipment based on the volume difference.
Preferably, the detecting a volume adjustment operation for the audio playing device includes:
judging whether an adjusting control of the audio playing equipment is triggered or not;
if so, detecting an audio adjusting operation aiming at the audio playing equipment;
if not, the current volume is locked.
Preferably, the calculating the control gain of the audio codec chip by using the PD algorithm based on the volume difference includes:
determining a proportional parameter and a differential parameter;
inputting the volume difference, the proportional parameter and the differential parameter into a PD algorithm;
and calculating the output of the PD algorithm to obtain the control gain of the audio coding and decoding chip.
A second aspect of the present invention provides a volume adjustment device, including:
the adjustment detection module is used for detecting volume adjustment operation aiming at the audio playing equipment;
the position acquisition module is used for acquiring the operation position of the volume adjustment operation at intervals of preset time in the volume adjustment operation process;
the volume determining module is used for determining the target volume corresponding to the operation position;
the volume calculation module is used for calculating the volume difference between the target volume and the current volume of the audio playing equipment;
and the volume adjusting module is used for adjusting the volume output by the audio playing equipment based on the volume difference.
A third aspect of the invention provides a processing device comprising a memory and a processor;
the memory stores one or more sets of program instructions;
the processor calls and executes one or more groups of program instructions stored in the memory, and the following operations are executed:
detecting a volume adjustment operation aiming at the audio playing equipment;
in the process of the volume adjustment operation, acquiring the operation position of the volume adjustment operation at intervals of preset time;
determining a target volume corresponding to the operation position;
calculating the volume difference between the target volume and the current volume of the audio playing equipment;
and adjusting the volume output by the audio playing equipment based on the volume difference.
In the embodiment of the invention, when the volume adjustment operation aiming at the audio playing equipment is detected, the operation position of the volume adjustment operation is obtained at intervals of preset time, so that the operation position of the volume adjustment operation can be continuously obtained all the time in the volume adjustment operation process, and further, the target volume corresponding to the continuous operation position can be realized, and the continuous adjustment of the sound can be realized. And the volume difference is the volume difference between the target volume and the current volume, and the output volume of the audio playing device is actually adjusted through the volume difference. Because the target volume can be continuously obtained, the volume difference can also be continuously obtained, and then the output volume of the audio playing device can be continuously adjusted, the output volume can be continuously changed, when a user knows the continuous change of the sound, the final volume can be timely judged according to the continuous volume adjusting process, and accurate adjustment can be realized.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow chart of one embodiment of a method of volume adjustment of an embodiment of the present invention;
fig. 2 is a flow chart of yet another embodiment of a volume adjustment method of an embodiment of the present invention;
FIG. 3 is an adjustment diagram of an output volume adjustment according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an embodiment of a volume adjustment device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an embodiment of a processing apparatus according to an embodiment of the present invention.
Detailed Description
The following detailed description of the embodiments of the present invention will be provided with reference to the accompanying drawings and examples, so that how to implement the embodiments of the present invention by using technical means to solve the technical problems and achieve the technical effects can be fully understood and implemented.
The embodiment of the invention is mainly applied to electronic equipment provided with audio playing equipment, such as intelligent sound boxes, intelligent watches, intelligent televisions, mobile phones and the like, and mainly realizes continuous adjustment of the volume by continuously acquiring the target volume within a very short time interval, thereby realizing the volume adjustment process, realizing high sensitivity of the volume adjustment process and improving the adjustment accuracy.
With the continuous development of intelligent technology, more and more electronic products are provided with volume adjusting devices. In recent years, the volume adjustment methods are becoming more diversified, and the traditional single-button method has gradually evolved into a variety of novel interaction methods such as a touch panel and a rotary encoder adjuster. The key pressing mode is mainly used for realizing sound adjustment by pressing a sound adjusting key, and the mode has single performance. The adjustment of the sound realized by the touch panel, the rotary code adjuster and the like has wide application range and can be used on various products. The method mainly realizes the adjustment of the sound by means of linear piecewise adjustment of the sound.
However, when the volume is adjusted by a method such as a touch panel or a rotary encoder adjuster, the volume is adjusted by a linear segment method. Dividing the volume from the minimum value to the maximum value into volume sections with the same volume change, wherein each volume section corresponds to a volume with corresponding size, and the size of the sound corresponding to each volume section is fixed and cannot be adjusted. When a certain position is touched or rotated to a certain position, the sound can be correspondingly adjusted to the volume corresponding to the position. When the volume is changed, the sound is directly adjusted from the initial volume to the final volume. For example, a rotary encoder adjustor usually generates a pulse every 30 degrees of rotation, counts the output number of pulses during the rotation, determines a corresponding volume adjustment value according to the output number of pulses, and directly adjusts the volume to the volume of the ending pulse according to the volume adjustment value. The volume adjusting mode has large change, the volume of the ending position may not be needed by the user, the volume is not changed sensitively enough during volume adjustment, the user cannot know the middle volume in time, the adjusted ending volume may not be needed by the user, and the accuracy of volume adjustment is low.
Therefore, the inventor thinks whether the continuous adjustment of the volume of the audio playing device can be realized by continuously acquiring the operation position of the audio playing device in the process of sound adjustment. The inventors further propose a technical solution of the present invention.
In the embodiment of the invention, the operation position of the user is continuously acquired, the volume difference between the target volume corresponding to the operation position of the user and the current volume of the audio playing device is calculated, and the output volume of the audio playing device is continuously adjusted through the volume difference. The operation position is obtained once every preset time, so that the target volume corresponding to the operation position can be continuously obtained, the volume difference obtained by calculating the target volume and the current volume can be continuously obtained, the volume of the audio playing device can be continuously adjusted, continuous volume change is provided for a user, the user can timely know the volume change, and accurate adjustment can be achieved.
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
As shown in fig. 1, a flowchart of an embodiment of a volume adjusting method according to the present invention is provided, where the method includes the following steps:
101: detecting a volume adjustment operation aiming at the audio playing equipment.
The audio playing device may be a speaker, the audio playing device may be connected to a device having a sound adjusting function, such as a touch panel and a code adjuster, and the volume of the audio playing device may be adjusted by sliding or rotating the code adjuster on the touch panel.
The volume adjustment operation may be generated when it is detected that the user triggers the audio playing device, and specifically, it may be detected that the user performs a manual operation on the audio playing device, and the audio playing device starts to perform the volume adjustment operation in response to the manual operation triggered by the user.
102: and in the volume adjustment operation process, acquiring the operation position of the volume adjustment operation at preset time intervals.
Optionally, the operation process of the volume adjustment may be an operation of starting to perform the volume adjustment after the volume adjustment operation is triggered. The volume adjustment operation may be sliding on the touch panel or rotating the code adjuster. Each sliding position on the sliding panel can be detected when the touch panel slides; each rotational position may be detected when the code adjusters are rotated.
The preset time may be preset, and in order to achieve continuous adjustment of the volume, the preset time may be set to a short time, for example, the preset time may be 20ms (milliseconds). The operation position of the volume adjustment operation acquired every preset time may be an operation position of the volume adjustment operation acquired every short preset time.
103: and determining the target volume corresponding to the operation position.
The operation position is a volume adjustment position acquired at preset time intervals in the volume adjustment process. The volume level and the adjustment position are linearly corresponding, for example, the volume level and the adjustment position may be a linear function, and the volume target corresponding to the operation position may be determined through the linear corresponding relationship.
104: and calculating the volume difference between the target volume and the current volume of the audio playing equipment.
The current volume of the audio playing device refers to the volume of the audio playing device played before the audio playing device acquires the operation position of the volume adjusting operation at each preset time interval.
105: and adjusting the volume output by the audio playing equipment based on the volume difference.
The adjusting of the volume output by the audio playing device means adjusting the current volume of the audio playing device, wherein the current volume is changed in real time along with the operation position of the volume adjusting operation.
In the embodiment of the invention, the operation position of the volume adjustment operation is acquired at preset time intervals, so that the target volume corresponding to the continuous operation position can be realized, the continuous adjustment of sound can be realized, the output volume of the audio playing device can be continuously adjusted, the volume of the output can be continuously changed, when the user knows the continuous change of the volume, the user can timely judge whether the final current output volume meets the expectation according to the sound output in the continuous volume adjustment process, and timely stops adjusting, so that the accurate adjustment can be realized.
As shown in fig. 2, a flow chart of another embodiment of a volume adjustment method according to the present invention may include the following steps:
201: detecting a volume adjustment operation aiming at the audio playing equipment.
202: and in the volume adjustment operation process, acquiring the operation position of the volume adjustment operation at preset time intervals.
203: and determining the target volume corresponding to the operation position.
204: and calculating the volume difference between the target volume and the current volume of the audio playing equipment.
Alternatively, the volume difference may be calculated by the following formula:
volume difference is target volume-current volume.
205: and calculating the control gain of the audio coding and decoding chip based on the volume difference.
Optionally, the calculating the control gain of the audio codec chip based on the volume difference may include:
and calculating the control gain of the audio coding and decoding chip by using a PD algorithm based on the volume difference.
As a possible implementation manner, the calculating the control gain of the audio codec chip by using the PD algorithm based on the volume difference may include:
determining a proportional parameter and a differential parameter;
inputting the volume difference, the proportional parameter and the differential parameter into a PD algorithm;
and calculating the output of the PD algorithm to obtain the control gain of the audio coding and decoding chip.
The audio CODEC chip may be a CODEC (Coder-Decoder) chip, the CODEC chip supports video and audio compression and decompression, and may encode, compress, or decompress and decode a digital signal after analog-to-digital conversion.
The PD (proportional Differential) algorithm is a control loop, and can implement PD control, and select appropriate PD parameters according to needs, so as to implement PD control.
The PD algorithm implements the calculation of the control gain with the following formula:
VolSetOut=Err[0]*(VolSet_P)+Err[0]*(VolSet_D)
wherein, VolSetOut is the control gain obtained by calculation, Err [0] is the volume difference, VolSet _ P is the P parameter, and VolSet _ D is the D parameter.
The P (Proportion) parameter, that is, the Proportion link parameter, may be in a direct Proportion to the volume difference, and the magnitude of the control gain may be adjusted in time. The D (Differential) parameter, that is, the Differential link parameter, may be in direct proportion to the change speed of the volume difference, may reflect the change speed of the control gain, has an effect of adjusting the change size in time, and may implement advanced adjustment.
The P parameter and the D parameter are determined according to a preset adjustment requirement, where the adjustment requirement may mean that a gain error of a current volume control gain is smaller than an error threshold. Specifically, initial values of the P parameter and the D parameter may be set, a corresponding control gain VolSetOut is calculated according to the initial values, and a gain error is determined by the calculated control gain and an actual sound gain; in the process of controlling gain calculation, continuously adjusting the numerical values of the P parameter and the D parameter, iterating to the control gain formula to calculate VolSetOut, calculating corresponding gain errors until the obtained gain errors are smaller than a preset error threshold, and determining the optimal P parameter and D parameter.
As a possible implementation manner, after the P parameter and the D parameter determine an optimal set of parameters according to requirements, the P parameter and the D parameter may not be adjusted until the volume adjustment is finished, so as to implement stable calculation of the control gain. As another possible implementation manner, the P parameter and the D parameter may be adjusted in the process of controlling the gain of the volume, and the adjusted P parameter and D parameter are used in the subsequent process of calculating the control gain, so as to calculate the corresponding control gain by using the more accurate P parameter and D parameter, so that the calculation result is more accurate.
206: and searching a coding and decoding data table of the audio coding and decoding chip to obtain a volume value corresponding to the control gain.
The corresponding relation between the control gain and the volume value can comprise a linear corresponding relation and a nonlinear corresponding relation, in order to determine the accurate volume value corresponding to the control gain, a CODEC datasheet in the CODEC chip can be searched, namely, an encoding and decoding data table of the audio encoding and decoding chip is also searched, the control gain and the volume value are correspondingly stored in the data table, and the corresponding volume value can be determined by searching the encoding and decoding data table.
207: and adjusting the volume output by the audio playing equipment through an audio coding and decoding chip based on the volume value.
When the output volume of the audio playing device is adjusted through the audio coding and decoding chip based on the volume, the volume of the audio playing device is changed after the output volume is adjusted, when the operation position of the volume adjustment operation is collected again at the interval preset time, the current volume of the audio playing device is changed, and the output volume adjustment process is a negative feedback process.
For convenience of understanding, as shown in fig. 3, an adjustment diagram of output volume adjustment is provided, where 301 is a touch panel or a rotatable encoder adjuster, and during the volume adjustment operation, when a target volume is detected, a difference value is calculated from a current volume, that is, a corresponding volume difference may be generated, and the volume difference may be input to a PD controller 302 of a smart speaker, and the PD controller may obtain a control gain through calculation and output the control gain to a CODEC chip 303, that is, may determine a corresponding volume and adjust the volume output by the audio playing device 304 through the CODEC chip 303.
In the embodiment of the invention, the volume adjustment operation is realized through a PD algorithm, the control gain is continuously obtained in the adjustment operation process, the coding and decoding data table is searched, the volume value corresponding to the control gain is obtained, the output volume of the audio playing equipment is adjusted through the audio coding and decoding chip based on the volume value, the volume is adjusted, the volume adjusted in the volume adjustment process can be used as the calculation base number of the control gain, the negative feedback adjustment is realized, and the accurate adjustment of the volume can be realized. The operation position of the volume adjustment operation is acquired once every preset time, continuous volume adjustment operation is realized, continuous change of the volume can be realized, the phenomenon that the volume is suddenly increased or suddenly reduced is avoided, a user can timely know the volume adjustment, and the accuracy of the volume adjustment is improved.
As an embodiment, the adjusting the output volume of the audio playing device based on the volume difference may include:
judging whether the volume difference is zero or not;
if yes, stopping the volume increasing operation of the audio playing equipment;
and if not, adjusting the output volume of the audio playing equipment based on the volume difference.
The volume difference is a difference value between a target volume corresponding to an operation position of volume adjustment operation and a current volume, when the operation position is continuously changed, the target volume is also continuously changed, and further the volume difference is not zero. When the operation position is not changed any more, the target volume is the same as the current volume, the current volume is the final output volume, and the volume difference is zero, which represents that the volume is adjusted to the volume required by the user.
In the real-time example of the invention, whether the adjustment operation is stopped or not is judged by judging the volume difference in the volume adjustment process, the mode is more accurate, and the volume adjustment can be stopped in time so as to further improve the accuracy of the volume adjustment.
As an embodiment, the detecting a volume adjustment operation for an audio playing device may include:
judging whether the adjustment operation of the audio playing equipment is triggered or not;
if so, detecting an audio adjusting operation aiming at the audio playing equipment;
if not, the current volume is locked.
As a possible implementation manner, the audio playing device may be provided with an adjustment control, and when the adjustment control is opened, an adjustment operation is triggered. The adjusting control can be a volume adjusting sliding bar displayed on the control panel, and can also be an adjusting switch of the coding adjuster.
In the embodiment of the invention, before the volume adjustment operation is started, whether the volume adjustment operation occurs is detected, the volume adjustment operation is executed only when the volume adjustment operation is triggered, and if the volume adjustment operation is not triggered, the volume adjustment is not executed, the current volume can be locked, so that the stability of the volume is ensured.
As shown in fig. 4, a schematic structural diagram of an embodiment of a volume adjusting apparatus according to an embodiment of the present invention is provided, where the apparatus may include the following modules:
an adjustment detecting module 401 is configured to detect a volume adjustment operation for the audio playing device. The audio playing device may be a speaker, the audio playing device may be connected to a device having a sound adjusting function, such as a touch panel and a code adjuster, and the volume of the audio playing device may be adjusted by sliding or rotating the code adjuster on the touch panel.
The volume adjustment operation may be generated when it is detected that the user triggers the audio playing device, and specifically, it may be detected that the user performs a manual operation on the audio playing device, and the audio playing device starts to perform the volume adjustment operation in response to the manual operation triggered by the user.
A position obtaining module 402, configured to obtain, every preset time in the volume adjusting operation process, an operation position of the volume adjusting operation.
Optionally, the operation process of the volume adjustment may be an operation of starting to perform the volume adjustment after the volume adjustment operation is triggered. The volume adjustment operation may be sliding on the touch panel or rotating the code adjuster. Each sliding position on the sliding panel can be detected when the touch panel slides; each rotational position may be detected when the code adjusters are rotated.
The preset time may be preset, and in order to achieve continuous adjustment of the volume, the preset time may be set to a short time, for example, the preset time may be 20ms (milliseconds). The operation position of the volume adjustment operation acquired every preset time may be an operation position of the volume adjustment operation acquired every short preset time.
And a volume determining module 403, configured to determine a target volume corresponding to the operation position.
The operation position is a volume adjustment position acquired at preset time intervals in the volume adjustment process. The volume level and the adjustment position are linearly corresponding, for example, the volume level and the adjustment position may be a linear function, and the volume target corresponding to the operation position may be determined through the linear corresponding relationship.
A volume calculating module 404, configured to calculate a volume difference between the target volume and the current volume of the audio playing device.
The current volume of the audio playing device refers to the volume of the audio playing device played before the audio playing device acquires the operation position of the volume adjusting operation at each preset time interval.
A volume adjusting module 405, configured to adjust the volume output by the audio playing device based on the volume difference.
The adjusting of the volume output by the audio playing device means adjusting the current volume of the audio playing device, wherein the current volume is changed in real time along with the operation position of the volume adjusting operation.
In the embodiment of the invention, the operation position of the volume adjustment operation is acquired at preset time intervals, so that the target volume corresponding to the continuous operation position can be realized, the continuous adjustment of sound can be realized, the output volume of the audio playing device can be continuously adjusted, the volume of the output can be continuously changed, when the user knows the continuous change of the volume, the user can timely judge whether the final current output volume meets the expectation according to the sound output in the continuous volume adjustment process, and timely stops adjusting, so that the accurate adjustment can be realized.
As an embodiment, the volume adjustment module may include:
and the gain calculation unit is used for calculating the control gain of the audio coding and decoding chip based on the volume difference.
And the volume searching unit is used for searching the coding and decoding data table of the audio coding and decoding chip and acquiring the volume value corresponding to the control gain.
And the volume adjusting unit is used for adjusting the volume output by the audio playing equipment through an audio coding and decoding chip based on the volume value.
Alternatively, the volume difference may be calculated by the following formula:
volume difference is target volume-current volume.
Optionally, the gain calculating unit may be specifically configured to:
and calculating the control gain of the audio coding and decoding chip by using a PD algorithm based on the volume difference.
As a possible implementation, the gain calculating unit may include:
the determining subunit is used for determining a proportional parameter and a differential parameter;
the input subunit is used for inputting the volume difference, the proportional parameter and the differential parameter into a PD algorithm;
and the calculating subunit is used for calculating the output of the PD algorithm and obtaining the control gain of the audio coding and decoding chip.
The PD (proportional Differential) algorithm is a control loop, and can implement PD control, and select appropriate PD parameters according to needs, so as to implement PD control.
The PD algorithm implements the calculation of the control gain with the following formula:
VolSetOut=Err[0]*(VolSet_P)+Err[0]*(VolSet_D)
wherein, VolSetOut is the control gain obtained by calculation, Err [0] is the volume difference, VolSet _ P is the P parameter, and VolSet _ D is the D parameter.
The P (Proportion) parameter, that is, the Proportion link parameter, may be in a direct Proportion to the volume difference, and the magnitude of the control gain may be adjusted in time. The D (Differential) parameter, that is, the Differential link parameter, may be in direct proportion to the change speed of the volume difference, may reflect the change speed of the control gain, has an effect of adjusting the change size in time, and may implement advanced adjustment.
The P parameter and the D parameter are determined according to a preset adjustment requirement, where the adjustment requirement may mean that a gain error of a current volume control gain is smaller than an error threshold. Specifically, initial values of the P parameter and the D parameter may be set, a corresponding control gain VolSetOut is calculated according to the initial values, and a gain error is determined by the calculated control gain and an actual sound gain; and in the process of controlling gain calculation, continuously adjusting the numerical values of the P parameter and the D parameter, and iterating to the control gain formula to calculate VolSetOut until the obtained gain error is smaller than a preset error threshold value, and determining the optimal P parameter and D parameter.
As a possible implementation manner, after the P parameter and the D parameter determine an optimal set of parameters according to requirements, the P parameter and the D parameter may not be adjusted until the volume adjustment is finished, so as to implement stable calculation of the control gain. As another possible implementation manner, the P parameter and the D parameter may be adjusted during the process of controlling the gain until the volume adjustment is finished, so as to calculate the corresponding control gain by using the more accurate P parameter and D parameter, so that the calculation result is more accurate.
The corresponding relation between the control gain and the volume value can comprise a linear corresponding relation and a nonlinear corresponding relation, in order to determine the accurate volume value corresponding to the control gain, a CODEC datasheet in the CODEC chip can be searched, namely, an encoding and decoding data table of the audio encoding and decoding chip is also searched, the control gain and the volume value are correspondingly stored in the data table, and the corresponding volume value can be determined by searching the encoding and decoding data table.
207: and adjusting the volume output by the audio playing equipment through an audio coding and decoding chip based on the volume value.
When the output volume of the audio playing device is adjusted through the audio coding and decoding chip based on the volume, the volume of the audio playing device is changed after the output volume is adjusted, when the operation position of the volume adjustment operation is collected again at the interval preset time, the current volume of the audio playing device is changed, and the output volume adjustment process is a negative feedback process.
In the embodiment of the invention, the volume adjustment operation is realized through a PD algorithm, the control gain is continuously obtained in the adjustment operation process, the coding and decoding data table is searched, the volume value corresponding to the control gain is obtained, the output volume of the audio playing equipment is adjusted through the audio coding and decoding chip based on the volume value, the volume is adjusted, the volume adjusted in the volume adjustment process can be used as the calculation base number of the control gain, the negative feedback adjustment is realized, and the accurate adjustment of the volume can be realized. The operation position of the volume adjustment operation is acquired once every preset time, continuous volume adjustment operation is realized, continuous change of the volume can be realized, the phenomenon that the volume is suddenly increased or suddenly reduced is avoided, a user can timely know the volume adjustment, and the accuracy of the volume adjustment is improved.
As still another embodiment, the volume adjustment module may include:
a volume judgment unit for judging whether the volume difference is zero; if yes, stopping the volume increasing operation of the audio playing equipment; and if not, adjusting the output volume of the audio playing equipment based on the volume difference.
The volume difference is a difference value between a target volume corresponding to an operation position of volume adjustment operation and a current volume, when the operation position is continuously changed, the target volume is also continuously changed, and further the volume difference is not zero. When the operation position is not changed any more, the target volume is the same as the current volume, the current volume is the final output volume, and the volume difference is zero, which represents that the volume is adjusted to the volume required by the user.
In the real-time example of the invention, whether the adjustment operation is stopped or not is judged by judging the volume difference in the volume adjustment process, the mode is more accurate, and the volume adjustment can be stopped in time so as to further improve the accuracy of the volume adjustment.
As yet another embodiment, the adjustment detection module may include:
the adjustment judging unit is used for judging whether an adjustment control of the audio playing equipment is triggered or not; if so, detecting an audio adjusting operation aiming at the audio playing equipment; if not, the current volume is locked.
As a possible implementation manner, the audio playing device may be provided with an adjustment control, and when the adjustment control is opened, an adjustment operation is triggered. The adjustment control may be a volume adjustment slider displayed on the control panel, or may be an adjustment switch of the encoding adjuster.
In the embodiment of the invention, before the volume adjustment operation is started, whether the volume adjustment operation occurs is detected, the volume adjustment operation is executed only when the volume adjustment operation is triggered, and if the volume adjustment operation is not triggered, the volume adjustment is not executed, the current volume can be locked, so that the stability of the volume is ensured.
As shown in fig. 5, which is a schematic structural diagram of a processing device according to an embodiment of the present invention, the processing device may include a memory 501 and a processor 502;
the memory 501 stores one or more sets of program instructions;
the processor 502 invokes and executes one or more sets of program instructions stored in the memory to perform the following operations:
detecting a volume adjustment operation aiming at the audio playing equipment;
in the process of the volume adjustment operation, acquiring the operation position of the volume adjustment operation at intervals of preset time;
determining a target volume corresponding to the operation position;
calculating the volume difference between the target volume and the current volume of the audio playing equipment;
and adjusting the volume output by the audio playing equipment based on the volume difference.
In the embodiment of the invention, the operation position of the volume adjustment operation is acquired at preset time intervals, so that the target volume corresponding to the continuous operation position can be realized, the continuous adjustment of sound can be realized, the output volume of the audio playing device can be continuously adjusted, the volume of the output can be continuously changed, when the user knows the continuous change of the volume, the user can timely judge whether the final current output volume meets the expectation according to the sound output in the continuous volume adjustment process, and timely stops adjusting, so that the accurate adjustment can be realized.
As an embodiment, the adjusting, by the processor, the output volume of the audio playing device based on the volume difference may specifically be:
based on the volume difference, calculating the control gain of the audio coding and decoding chip by using a PD algorithm;
searching a coding and decoding data table of the audio coding and decoding chip to obtain a volume value corresponding to the control gain;
and adjusting the volume output by the audio playing equipment through an audio coding and decoding chip based on the volume value.
As a possible implementation manner, the processor, based on the volume difference, using a PD algorithm to calculate the control gain of the audio codec chip may specifically be:
determining a proportional parameter and a differential parameter;
inputting the volume difference, the proportional parameter and the differential parameter into a PD algorithm;
and calculating the output of the PD algorithm to obtain the control gain of the audio coding and decoding chip.
In the embodiment of the invention, the volume adjustment operation is realized through the PD algorithm, the final volume value audio coding and decoding chip can be output to the audio playing equipment, the volume adjustment is realized, and the accurate adjustment of the volume can be realized through the negative feedback adjustment process existing in the whole adjustment process. The operation position of the volume adjustment operation is acquired once every preset time, continuous volume adjustment operation is realized, continuous change of the volume can be realized, the phenomenon that the volume is suddenly increased or suddenly reduced is avoided, a user can timely know the volume adjustment, and the accuracy of the volume adjustment is improved.
As another embodiment, the adjusting, by the processor, the output volume of the audio playing device based on the volume difference may specifically be:
judging whether the volume difference is zero or not;
if yes, stopping the volume increasing operation of the audio playing equipment;
and if not, adjusting the output volume of the audio playing equipment based on the volume difference.
In the real-time example of the invention, whether the adjustment operation is stopped or not is judged by judging the volume difference in the volume adjustment process, the mode is more accurate, and the volume adjustment can be stopped in time so as to further improve the accuracy of the volume adjustment.
As another embodiment, the detecting, by the processor, the volume adjustment operation for the audio playing device may specifically be:
judging whether an adjusting control of the audio playing equipment is triggered or not;
if so, detecting an audio adjusting operation aiming at the audio playing equipment;
if not, the current volume is locked.
In the embodiment of the invention, before the volume adjustment operation is started, whether the volume adjustment operation occurs is detected, the volume adjustment operation is executed only when the volume adjustment operation is triggered, and if the volume adjustment operation is not triggered, the volume adjustment is not executed, the current volume can be locked, so that the stability of the volume is ensured.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
As used in the specification and in the claims, certain terms are used to refer to particular components. As one skilled in the art will appreciate, manufacturers may refer to a component by different names. This specification and claims do not intend to distinguish between components that differ in name but not function. In the following description and in the claims, the terms "include" and "comprise" are used in an open-ended fashion, and thus should be interpreted to mean "include, but not limited to. "substantially" means within an acceptable error range, and a person skilled in the art can solve the technical problem within a certain error range to substantially achieve the technical effect. Furthermore, the term "coupled" is intended to encompass any direct or indirect electrical coupling. Thus, if a first device couples to a second device, that connection may be through a direct electrical coupling or through an indirect electrical coupling via other devices and couplings. The following description is of the preferred embodiment for carrying out the invention, and is made for the purpose of illustrating the general principles of the invention and not for the purpose of limiting the scope of the invention. The scope of the present invention is defined by the appended claims.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such good or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a commodity or system that includes the element.
The foregoing description shows and describes several preferred embodiments of the invention, but as aforementioned, it is to be understood that the invention is not limited to the forms disclosed herein, but is not to be construed as excluding other embodiments and is capable of use in various other combinations, modifications, and environments and is capable of changes within the scope of the inventive concept as expressed herein, commensurate with the above teachings, or the skill or knowledge of the relevant art. And that modifications and variations may be effected by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (8)

1. A method of adjusting volume, comprising:
detecting a volume adjustment operation aiming at the audio playing equipment; the audio playing device responds to the manual operation triggered by the user, namely, the volume adjustment operation is started;
in the process of the volume adjustment operation, acquiring the operation position of the volume adjustment operation at intervals of preset time;
determining a target volume corresponding to the operation position;
calculating a volume difference between the target volume and a current volume of the audio playing device, wherein the current volume refers to a volume played by the audio playing device before an operation position of the volume adjustment operation is obtained at each preset time interval; the current volume is changed in real time with the operation position of the volume adjustment operation;
and adjusting the volume output by the audio playing equipment based on the volume difference.
2. The method of claim 1, wherein the adjusting the output volume of the audio playback device based on the volume difference comprises:
calculating the control gain of the audio coding and decoding chip based on the volume difference;
searching a coding and decoding data table of the audio coding and decoding chip to obtain a volume value corresponding to the control gain;
and adjusting the volume output by the audio playing equipment through an audio coding and decoding chip based on the volume value.
3. The method of claim 2, wherein the calculating the control gain of the audio codec chip based on the volume difference comprises:
and calculating the control gain of the audio coding and decoding chip by using a PD algorithm based on the volume difference.
4. The method of claim 1, wherein the adjusting the output volume of the audio playback device based on the volume difference comprises:
judging whether the volume difference is zero or not;
if yes, stopping the volume increasing operation of the audio playing equipment;
and if not, adjusting the output volume of the audio playing equipment based on the volume difference.
5. The method of claim 1, wherein detecting a volume adjustment operation for an audio playback device comprises:
judging whether an adjusting control of the audio playing equipment is triggered or not;
if so, detecting an audio adjusting operation aiming at the audio playing equipment;
if not, the current volume is locked.
6. The method of claim 3, wherein the calculating the control gain of the audio codec chip based on the volume difference by using the PD algorithm comprises:
determining a proportional parameter and a differential parameter;
inputting the volume difference, the proportional parameter and the differential parameter into a PD algorithm;
and calculating the output of the PD algorithm to obtain the control gain of the audio coding and decoding chip.
7. A volume adjustment device, comprising:
the adjustment detection module is used for detecting volume adjustment operation aiming at the audio playing equipment; the audio playing device responds to the manual operation triggered by the user, namely, the volume adjustment operation is started;
the position acquisition module is used for acquiring the operation position of the volume adjustment operation at intervals of preset time in the volume adjustment operation process;
the volume determining module is used for determining the target volume corresponding to the operation position;
the volume calculation module is used for calculating the volume difference between the target volume and the current volume of the audio playing device, wherein the current volume refers to the volume of the audio playing device played before the audio playing device acquires the operation position of the volume adjustment operation at each preset time interval; the current volume is changed in real time with the operation position of the volume adjustment operation;
and the volume adjusting module is used for adjusting the volume output by the audio playing equipment based on the volume difference.
8. A processing device comprising a memory and a processor;
the memory stores one or more sets of program instructions;
the processor calls and executes one or more groups of program instructions stored in the memory, and the following operations are executed:
detecting a volume adjustment operation aiming at the audio playing equipment; the audio playing device responds to the manual operation triggered by the user, namely, the volume adjustment operation is started;
in the process of the volume adjustment operation, acquiring the operation position of the volume adjustment operation at intervals of preset time;
determining a target volume corresponding to the operation position;
calculating a volume difference between the target volume and a current volume of the audio playing device, wherein the current volume refers to a volume played by the audio playing device before an operation position of the volume adjustment operation is obtained at each preset time interval; the current volume is changed in real time with the operation position of the volume adjustment operation;
and adjusting the volume output by the audio playing equipment based on the volume difference.
CN201710734461.5A 2017-08-24 2017-08-24 Volume adjusting method and device and processing equipment Active CN107371094B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710734461.5A CN107371094B (en) 2017-08-24 2017-08-24 Volume adjusting method and device and processing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710734461.5A CN107371094B (en) 2017-08-24 2017-08-24 Volume adjusting method and device and processing equipment

Publications (2)

Publication Number Publication Date
CN107371094A CN107371094A (en) 2017-11-21
CN107371094B true CN107371094B (en) 2020-10-09

Family

ID=60310631

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710734461.5A Active CN107371094B (en) 2017-08-24 2017-08-24 Volume adjusting method and device and processing equipment

Country Status (1)

Country Link
CN (1) CN107371094B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134361B (en) * 2019-05-06 2022-08-19 上海幻电信息科技有限公司 Volume adjusting method of device, computer device and computer-readable storage medium
CN110312146B (en) * 2019-06-06 2021-11-09 百度在线网络技术(北京)有限公司 Audio processing method and device, electronic equipment and storage medium
CN113497906B (en) * 2020-03-20 2022-09-23 海信视像科技股份有限公司 Volume adjusting method and device and terminal
CN114302298B (en) * 2021-12-31 2023-07-21 联想(北京)有限公司 Volume adjustment method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102695013A (en) * 2012-05-31 2012-09-26 天津三星电子有限公司 Method and system for regulating volume of intelligent TV
CN105072273A (en) * 2015-08-07 2015-11-18 广东欧珀移动通信有限公司 Method and system for adjusting volume of mobile terminal
CN105204761A (en) * 2015-08-27 2015-12-30 广东欧珀移动通信有限公司 Volume adjustment method and user terminal

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101800922A (en) * 2010-02-26 2010-08-11 中兴通讯股份有限公司 Method and device for automatically regulating talkback volume
TW201415912A (en) * 2012-10-03 2014-04-16 Hon Hai Prec Ind Co Ltd Hand held device and method for adjusting the volume of electronic apparatus
CN103558970A (en) * 2013-10-29 2014-02-05 广东欧珀移动通信有限公司 Volume adjustment method
CN104506586A (en) * 2014-12-09 2015-04-08 北京奇虎科技有限公司 Intelligent earphone system capable of regulating volume by gesture and regulation method
CN104618796B (en) * 2015-02-13 2019-07-05 京东方科技集团股份有限公司 A kind of method and display equipment of adjusting volume

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102695013A (en) * 2012-05-31 2012-09-26 天津三星电子有限公司 Method and system for regulating volume of intelligent TV
CN105072273A (en) * 2015-08-07 2015-11-18 广东欧珀移动通信有限公司 Method and system for adjusting volume of mobile terminal
CN105204761A (en) * 2015-08-27 2015-12-30 广东欧珀移动通信有限公司 Volume adjustment method and user terminal

Also Published As

Publication number Publication date
CN107371094A (en) 2017-11-21

Similar Documents

Publication Publication Date Title
CN107371094B (en) Volume adjusting method and device and processing equipment
US11144163B2 (en) Capacitance detection method of touch display panel, capacitance detection circuit of touch display panel, and electronic device
US20070172083A1 (en) Method and apparatus for controlling a gain of a voice signal
RU2006145909A (en) IMAGE COMPRESSION PROCESSING DEVICE, IMAGE COMPRESSION PROCESSING METHOD AND IMAGE COMPRESSION PROCESSING PROGRAM
EP3389275A1 (en) Method and device for transcoding
WO2017032031A1 (en) Volume adjustment method and user terminal
CN103843064A (en) Playing audio in trick-modes
CN115712247A (en) Control method and control device for sand making system, processor and sand making system
US4297730A (en) Magnetic recording and reproducing device
US20200284626A1 (en) Phase Deviation Compensation Method and Apparatus
US7999500B1 (en) Calibrating spindle motor controllers
CN108667463A (en) Monitoring data compression method
US4405953A (en) Magnetic recording and reproducing device
CN113706851A (en) Remote controller infrared signal decoding method and device and remote controller
WO2023273144A1 (en) Rotation control component, method and apparatus, and electronic device
JP6501223B2 (en) Electronic device, electronic system, voice output program and voice output method
CN110731087B (en) Volume adjusting method and device, mobile terminal and storage medium
US20110078482A1 (en) Method and Apparatus for Audio Receiver Clock Synchronization
US8907827B2 (en) A/D converter reference calibration
US7801630B2 (en) Method and apparatus for controlling recording levels
JP2002367177A5 (en)
CN112822768A (en) Method and equipment for reducing specific absorption rate of intelligent terminal
CN107621920B (en) Method, device and storage medium for adjusting position of lyric locator
CN113565779B (en) Calibration method, device, fan and storage medium
WO2023246800A1 (en) Method and apparatus for controlling delay of digital pre-distortion loop, and electronic device

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
GR01 Patent grant
GR01 Patent grant