CN103684303B - A kind of method for controlling volume, device and terminal - Google Patents
A kind of method for controlling volume, device and terminal Download PDFInfo
- Publication number
- CN103684303B CN103684303B CN201210335551.4A CN201210335551A CN103684303B CN 103684303 B CN103684303 B CN 103684303B CN 201210335551 A CN201210335551 A CN 201210335551A CN 103684303 B CN103684303 B CN 103684303B
- Authority
- CN
- China
- Prior art keywords
- volume
- frame
- audio data
- audio
- adjustment
- 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
Links
Landscapes
- Circuit For Audible Band Transducer (AREA)
Abstract
The invention discloses a kind of method for controlling volume of offer, device and terminal, methods therein may include:Adjust the volume value of audio data;According to the volume value of the audio data after adjustment, the volume peak of the audio data in preset time is calculated;According to preset volume control threshold values, the volume peak of the audio data is controlled.The present invention can carry out the volume of the audio data after adjustment lasting monitoring and promote the intelligent of volume control to ensure the effect of volume control after carrying out adjustment to the volume of audio data.
Description
Technical field
The present invention relates to a kind of electronic technology field more particularly to technical field of electronic control, and in particular to a kind of volume
Control method, device and terminal.
Background technology
Intelligent volume control refers to through the analysis to audio data, is manually operated without user, automatically controls audio data
Volume.In traditional volume control mode, after carrying out Intelligent volume adjustment to audio data, that is, volume control stream is exited
Journey is not monitored the volume of audio data after adjustment;After the startup of volume control flow next time, again to audio number
According to progress Intelligent volume control and adjustment.However, after exiting volume control flow, volume control flow starts it next time
Before, with the broadcasting of audio data, the volume of adjusted audio data may reappear the excessive or too small problem of volume,
To affect the effect of volume control, the intelligent of volume control is reduced.
Invention content
A kind of method for controlling volume of offer of the embodiment of the present invention, device and terminal carry out intelligence in the volume to audio data
After capable of adjusting, the volume of the audio data after adjustment can be carried out to continue monitoring, to ensure the effect of volume control, promote sound
Amount controls intelligent.
First aspect present invention provides a kind of method for controlling volume, it may include:
Adjust the volume value of audio data;
According to the volume value of the audio data after adjustment, the volume peak of the audio data in preset time is calculated;
According to preset volume control threshold values, the volume peak of the audio data is controlled.
Second aspect of the present invention provides a kind of sound volume control device, it may include:
Adjust module, the volume value for adjusting audio data;
Computing module calculates the audio data in preset time for the volume value according to the audio data after adjustment
Volume peak;
Control module, for according to preset volume control threshold values, controlling the volume peak of the audio data.
Third aspect present invention provides a kind of terminal, it may include:Above-mentioned sound volume control device.
Implement the embodiment of the present invention, has the advantages that:
The embodiment of the present invention to audio data carry out Intelligent volume adjustment after, in preset time persistently to adjustment after
The volume of audio data be monitored, and according to preset volume control threshold values to the volume peak of the audio data after adjustment
It is controlled.After adjusting in Intelligent volume, continue to be monitored the volume of the audio data after adjustment, and monitoring
The intelligent control for carrying out volume when too high or too low to volume peak, ensure that the effect of volume control, improves volume control
It is intelligent.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
Obtain other attached drawings according to these attached drawings.
Fig. 1 is a kind of flow chart of method for controlling volume provided in an embodiment of the present invention;
Fig. 2 is the flow chart of another method for controlling volume provided in an embodiment of the present invention;
Fig. 3 is the flow chart of another method for controlling volume provided in an embodiment of the present invention;
Fig. 4 is the flow chart of another method for controlling volume provided in an embodiment of the present invention;
Fig. 5 is the flow chart of another method for controlling volume provided in an embodiment of the present invention;
Fig. 6 is a kind of structural schematic diagram of sound volume control device provided in an embodiment of the present invention;
Fig. 7 is the structural schematic diagram of one embodiment of adjustment module shown in Fig. 6;
Fig. 8 is the structural schematic diagram of another embodiment of adjustment module shown in Fig. 6;
Fig. 9 is the structural schematic diagram of the embodiment of computing module shown in Fig. 6;
Figure 10 is the structural schematic diagram of one embodiment of control module shown in Fig. 6;
Figure 11 is the structural schematic diagram of another embodiment of control module shown in Fig. 6.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other without creative efforts
Embodiment shall fall within the protection scope of the present invention.
Method for controlling volume provided in an embodiment of the present invention can be adapted for the volume control to various terminals, such as:It is right
PC(Personal Computer, personal computer)System sound volume control, to the system sound volume of mobile terminal control, etc.;
It is readily applicable to the volume control to the audio and video software in various terminals, such as:To the sound of the video player in terminal
Amount control, to the volume control of audio player, etc. in terminal;It can be applicable to the various applications in various terminals
Volume control, such as:The volume control, etc. played to certain in terminal.
Below in conjunction with Fig. 1-Fig. 5, describe in detail to method for controlling volume provided in an embodiment of the present invention.
Fig. 1 is referred to, is a kind of flow chart of method for controlling volume provided in an embodiment of the present invention;This method may include
Following steps S101- steps S103.
S101 adjusts the volume value of audio data;
Adjustment to the volume value of audio data includes:The volume value of augmented audio data, or reduce audio data
Volume value.In this step, when being adjusted to the volume value of audio data, regulating object is the audio frame of audio data, for
The audio data of compression, such as:MP3(Moving Picture Experts Group Audio Layer III, dynamic image
Expert's compression standard audio level 3)Audio data, AAC(Advanced Audio Coding, Advanced Audio Coding)Audio number
According to being first carried out decompression processing, obtain audio frame, then be adjusted to audio frame.It, can be direct for uncompressed audio data
Audio frame is adjusted.
S102 calculates the volume peak of the audio data in preset time according to the volume value of the audio data after adjustment
Value;
Wherein, preset time can be set according to actual needs, and specific duration may be used and indicate, such as:
200ms, 500ms.Since audio frame corresponds to the time point in time domain, continuous audio frame can then correspond to a period of time in time domain,
Therefore, the preset time can also be indicated by the quantity of continuous audio frame, such as:The continuous audio frame of 30 frames, 50 frame continuants
Frequency frame.
S103 controls the volume peak of the audio data according to preset volume control threshold values.
Volume control threshold values can be the threshold values being set by the user, which may include:Subtract for intelligence
First volume control threshold values of the volume of small audio data, and volume for intelligent augmented audio data the second volume control
Threshold values.In this step, it can have the function that volume control, specially by the volume peak of control audio data:If sound
It measures peak value and is more than the first volume control threshold values, then negative gain process is carried out to audio data, to reduce the volume of audio data;
Alternatively, if volume peak is less than the second volume control threshold values, postiive gain processing is carried out to audio data, to increase audio
The volume of data.
Fig. 2 is referred to, for the flow chart of another method for controlling volume provided in an embodiment of the present invention;Implement shown in Fig. 2
In example, the volume value of audio data is smaller, needs to carry out increase processing to the volume of audio data, and to the sound that increases that treated
The volume of frequency evidence is monitored, using preset first volume control threshold values, to the volume for the audio data that increases that treated
Peak value is controlled.This method may comprise steps of S201- steps S207.
S201 obtains all sampled values of each frame audio frame of audio data;
In the present embodiment, PCM can be used in each frame audio frame of audio data(Pulse-Code Modulation, pulse
Coded modulation)It is sampled, this step obtains all PCM sampled values of each frame audio frame.
S202 carries out postiive gain processing using the first gain coefficient to all sampled values of each frame audio frame;
Wherein, K may be used in the first gain coefficient1It indicates, wherein K1>1.In this step, by all samplings of each frame
Value is multiplied by K1, then can be achieved to handle the postiive gain of each frame audio frame, increase the volume of each frame audio frame, to increase
The volume of audio data.The first gain coefficient K1Various algorithms may be used to obtain, such as:Algorithm K may be used1=Vtag/
VmaxIt is calculated, wherein VtagIndicate the target sound magnitude for needing to increase to, VmaxIndicate the maximum sampled value of audio frame;For another example:
Multiple algorithm may be used, set K1For fixed value, such as 1.2,1.5 or 2.0, that is, indicate to increase the volume of each frame audio frame
To 1.2 times, 1.5 times or 2.0 times of former volume.
S203, for each frame audio frame of the audio data after adjustment, all samplings to each frame audio frame
Value carries out read group total, obtains the energy of each frame audio frame;
In this step, the energy of each frame audio frame can use EiIt indicates, wherein i is the sequence of audio data sound intermediate frequency frame
Number.Such as:Each audio frame has 1152 samplings in MP3 audio datas, then in this step, which is added,
Summation obtains the energy of each audio frame.
S204 chooses the continuous audio frame of preset value quantity;
Wherein, preset value can be set according to actual needs, it is assumed that preset value 30, then this step continuously selection 30
Frame audio frame.
S205 calculates the average energy of selected continuous audio frame, obtains the volume peak of the audio data;
According to the example of the present embodiment, in this step, calculates and obtain the volume peak of the audio data and be:Ea=(E1+E2+
E3+…+E29+E30)/30.It should be noted that if default settings be 30 when, if the continuous audio of the audio data
30 frame of lazy weight of frame can then set the energy of insufficient number of audio frame as 0, such as:Assuming that the company of the audio data
The quantity of continuous audio frame is 25 frames, and less than 30 frames, then the volume peak of the audio data is:Ea=(E1+E2+E3+…+E25+0+
0+0+0+0)/30。
S206, judges whether the volume peak of the audio data is more than the first volume control threshold values, if it is judged that
It is yes, is transferred to S207;Otherwise, terminate.
E may be used in first volume control threshold valuesmaxIt indicates.In this step, E is judgedaWith EmaxSize, if Ea>Emax,
Show that the volume peak of the volume data after adjustment controls threshold values higher than max volume set by user, needs to the sound
The volume of frequency evidence carries out negative gain process.
S207 carries out negative gain process using preset first control coefrficient to the audio data.
Wherein, D may be used in preset first control coefrficient1It indicates, wherein 0<D1<1.In this step, by each frame
All sampled values are multiplied by D1, then it can be achieved, to the negative gain process of each frame audio frame, to reduce the volume of each frame audio frame,
To reduce the volume of audio data.The first control coefrficient D1Various algorithms may be used to obtain, such as:Calculation may be used
Method D1=Ea/EmaxIt is calculated;For another example:Multiple algorithm may be used, set D1For fixed value, such as 0.2,0.5 or 0.6, that is, indicate
By 0.2 times of the volume down of each frame audio frame to former volume, 0.5 times or 0.6 times.
Fig. 3 is referred to, is the flow chart of another method for controlling volume provided in an embodiment of the present invention;Implement shown in Fig. 3
In example, the volume value of audio data is smaller, needs to carry out increase processing to the volume of audio data, and to the sound that increases that treated
The volume of frequency evidence is monitored, using preset first volume control threshold values, to the volume for the audio data that increases that treated
Peak value is controlled.This method may comprise steps of S301- steps S307.
S301 obtains all sampled values of each frame audio frame of audio data;
S302 carries out postiive gain processing using the first gain coefficient to all sampled values of each frame audio frame;
S303, for each frame audio frame of the audio data after adjustment, all samplings to each frame audio frame
Value carries out read group total, obtains the energy of each frame audio frame;
S304 chooses the continuous audio frame in preset time;
Wherein, preset time can be set according to actual needs, it is assumed that preset time 200ms, then this step from
The current audio frame of the audio data corresponds to the time point in time domain, takes the continuous time point in 200ms in the time domain
Corresponding continuous audio frame.
S305 calculates the average energy of selected continuous audio frame, obtains the volume peak of the audio data;
S306, judges whether the volume peak of the audio data is more than the first volume control threshold values, if it is judged that
It is yes, is transferred to S307;Otherwise, terminate.
S307 carries out negative gain process using preset first control coefrficient to the audio data.
The step S301- steps S303 of the present embodiment may refer to the step S201- steps in embodiment illustrated in fig. 2
S203;The step S305- steps S307 of the present embodiment may refer to the step S205- step S207 in embodiment illustrated in fig. 2,
This is not repeated.
Fig. 4 is referred to, is the flow chart of another method for controlling volume provided in an embodiment of the present invention;Implement shown in Fig. 4
In example, the volume value of audio data is larger, needs to carry out reduction processing to the volume of audio data, and to the sound that reduces that treated
The volume of frequency evidence is monitored, using preset second volume control threshold values, to the volume for the audio data that reduces that treated
Peak value is controlled.This method may comprise steps of S401- steps S407.
S401 obtains all sampled values of each frame audio frame of audio data;
In the present embodiment, each frame audio frame of audio data can be used PCM and be sampled, this step obtains each frame sound
All PCM sampled values of frequency frame.
S402 carries out negative gain process using the second gain coefficient to all sampled values of each frame audio frame;
Wherein, K may be used in the second gain coefficient2It indicates, wherein 0<K2<1.In this step, all by each frame adopt
Sample value is multiplied by K2, then can be achieved, to the negative gain process of each frame audio frame, to reduce the volume of each frame audio frame, to subtract
The volume of small audio data.The second gain coefficient K2Various algorithms may be used to obtain, such as:Algorithm K may be used1=
V′tag/VmaxIt is calculated, wherein V 'tagIndicate the target sound magnitude for needing to be reduced to, VmaxIndicate the maximum sampling of audio frame
Value;For another example:Multiple algorithm may be used, set K2For fixed value, such as 0.4,0.5 or 0.7, that is, indicate each frame audio frame
Volume increases to 0.4 times, 0.5 times or 0.7 times of former volume.
S403, for each frame audio frame of the audio data after adjustment, all samplings to each frame audio frame
Value carries out read group total, obtains the energy of each frame audio frame;
S404 chooses the continuous audio frame of preset value quantity;
S405 calculates the average energy of selected continuous audio frame, obtains the volume peak of the audio data;
The step S403- steps S405 of the present embodiment may refer to the step S203- steps S205 of embodiment illustrated in fig. 2.
S406, judges whether the volume peak of the audio data is less than the second volume control threshold values, if it is judged that
It is yes, is transferred to S407;Otherwise, terminate.
E may be used in second volume control threshold valuesminIt indicates.In this step, E is judgedaWith EminSize, if Ea<Emin,
Show that the volume peak of the volume data after adjustment controls threshold values less than minimal volume set by user, needs to the sound
The volume of frequency evidence carries out postiive gain processing.
S407 carries out postiive gain processing using preset second control coefrficient to the audio data.
Wherein, D may be used in preset second control coefrficient2It indicates, wherein D1>1.In this step, by the institute of each frame
There is sampled value to be multiplied by D2, then it can be achieved to handle the postiive gain of each frame audio frame, increase the volume of each frame audio frame, from
And the volume of augmented audio data.The second control coefrficient D2Various algorithms may be used to obtain, such as:Algorithm may be used
D2=Emin/EaIt is calculated;For another example:Multiple algorithm may be used, set D2For fixed value, such as 1.2,1.5 or 1.6, that is, indicating will
The volume of each frame audio frame increases to 1.2 times, 1.5 times or 1.6 times of former volume.
Fig. 5 is referred to, is the flow chart of another method for controlling volume provided in an embodiment of the present invention;Implement shown in Fig. 5
In example, the volume value of audio data is larger, needs to carry out reduction processing to the volume of audio data, and to the sound that reduces that treated
The volume of frequency evidence is monitored, using preset second volume control threshold values, to the volume for the audio data that reduces that treated
Peak value is controlled.This method may comprise steps of S501- steps S507.
S501 obtains all sampled values of each frame audio frame of audio data;
S502 carries out negative gain process using the second gain coefficient to all sampled values of each frame audio frame;
S503, for each frame audio frame of the audio data after adjustment, all samplings to each frame audio frame
Value carries out read group total, obtains the energy of each frame audio frame;
S504 chooses the continuous audio frame in preset time;
Wherein, preset time can be set according to actual needs, it is assumed that preset time 500ms, then this step from
The current audio frame of the audio data corresponds to the time point in time domain, takes the continuous time point in 500ms in the time domain
Corresponding continuous audio frame.
S505 calculates the average energy of selected continuous audio frame, obtains the volume peak of the audio data;
S506, judges whether the volume peak of the audio data is less than the second volume control threshold values, if it is judged that
It is yes, is transferred to S507;Otherwise, terminate.
S507 carries out postiive gain processing using preset second control coefrficient to the audio data.
The step S501- steps S503 of the present embodiment may refer to the step S401- steps in embodiment illustrated in fig. 4
S403;The step S405- steps S407 of the present embodiment may refer to the step S405- step S407 in embodiment illustrated in fig. 4,
This is not repeated.
By the description of above method embodiment, the embodiment of the present invention is adjusting it to audio data progress Intelligent volume
Afterwards, persistently the volume of the audio data after adjustment is monitored in preset time, and according to preset volume control threshold values
The volume peak of audio data after adjustment is controlled.After being adjusted in Intelligent volume, continue to the sound after adjustment
The volume of frequency evidence is monitored, and monitor volume peak it is too high or too low when carry out volume intelligent control, ensure that
The effect of volume control improves the intelligent of volume control.
Below in conjunction with Fig. 6-Figure 11, describe in detail to sound volume control device provided in an embodiment of the present invention.It needs
Illustrate, following devices can be applied in the above method.
Fig. 6 is referred to, is a kind of structural schematic diagram of sound volume control device provided in an embodiment of the present invention;The device can be with
Including:Adjust module 101, computing module 102 and control module 103.
Adjust module 101, the volume value for adjusting audio data;
Adjustment to the volume value of audio data includes:The volume value of augmented audio data, or reduce audio data
Volume value.When the adjustment module 101 is adjusted the volume value of audio data, regulating object is the audio of audio data
Frame, for the audio data of compression, such as:Decompression processing is first carried out in MP3 audio datas, AAC audio datas, obtains audio
Frame, then audio frame is adjusted.For uncompressed audio data, directly audio frame can be adjusted.
In the present embodiment, following two feasible embodiments may be used in the adjustment module 101:
It is one embodiment of adjustment module shown in Fig. 6 please also refer to Fig. 7 in the first feasible embodiment
Structural schematic diagram;The adjustment module 101 may include:First acquisition unit 1101 and the first adjustment unit 1102.
First acquisition unit 1101, all sampled values of each frame audio frame for obtaining audio data;
The first adjustment unit 1102 carries out all sampled values of each frame audio frame for using the first gain coefficient
Postiive gain processing.
It is another implementation of adjustment module shown in Fig. 6 please also refer to Fig. 8 in second of feasible embodiment
The structural schematic diagram of example;The adjustment module 101 may include:Second acquisition unit 1103 and second adjustment unit 1104.
Second acquisition unit 1103, all sampled values of each frame audio frame for obtaining audio data;
Second adjustment unit 1104 carries out all sampled values of each frame audio frame for using the second gain coefficient
Negative gain process.
Computing module 102 calculates the audio number in preset time for the volume value according to the audio data after adjustment
According to volume peak;
It is the structural schematic diagram of the embodiment of computing module shown in Fig. 6 please also refer to Fig. 9;The computing module 102 can wrap
It includes:Frame energy calculation unit 1201, selection unit 1202 and peak computational unit 1203.
Frame energy calculation unit 1201, for each frame audio frame for the audio data after adjustment, to each
All sampled values of frame audio frame carry out read group total, obtain the energy of each frame audio frame;
Selection unit 1202, the continuous audio frame for choosing preset value quantity, or choose continuous in preset time
Audio frame;
Peak computational unit 1203, the average energy for calculating selected continuous audio frame, obtains the audio number
According to volume peak.
Control module 103, for according to preset volume control threshold values, controlling the volume peak of the audio data.
Volume control threshold values can be the threshold values being set by the user, which may include:Subtract for intelligence
First volume control threshold values of the volume of small audio data, and volume for intelligent augmented audio data the second volume control
Threshold values.The control module 103 can have the function that volume control, specially by the volume peak of control audio data:
If volume peak is more than the first volume control threshold values, negative gain process is carried out to audio data, to reduce audio data
Volume;Alternatively, if volume peak is less than the second volume control threshold values, postiive gain processing is carried out to audio data, to
The volume of augmented audio data.
Corresponding to two kinds of feasible embodiments of the adjustment module 101, the control module 103 can there is also two kinds
Capable embodiment.In the present embodiment, if the adjustment module 101 is using the first above-mentioned feasible embodiment,
There are a kind of following feasible embodiments for the control module 103:
It is the structural schematic diagram of one embodiment of control module shown in Fig. 6 please also refer to Figure 10;The control module
103 may include:First judging unit 1301 and the first control unit 1302.
First judging unit 1301, for judging whether the volume peak of the audio data is more than the first volume control valve
Value;
First control unit 1302, if the volume peak for the audio data is more than the first volume control threshold values,
Preset first control coefrficient is then used, negative gain process is carried out to the audio data.
In the present embodiment, if the adjustment module 101 is using above-mentioned second of feasible embodiment, the control
There are the following feasible embodiments of another kind for molding block 103:
It is the structural schematic diagram of another embodiment of control module shown in Fig. 6 please also refer to Figure 11;The control module
103 may include:Second judgment unit 1303 and the second control unit 1304.
Second judgment unit 1303, for judging whether the volume peak of the audio data is less than the second volume control valve
Value;
Second control unit 1304, if the volume peak for the audio data is less than the second volume control threshold values,
Preset second control coefrficient is then used, postiive gain processing is carried out to the audio data.
It is understood that the function of each function module of sound volume control device shown in Fig. 6-Figure 11 passes through Fig. 1-Fig. 5
Method specific implementation in shown embodiment of the method, specific implementation process may refer to the correlation in above method embodiment and retouch
It states, this will not be repeated here.
By the description of above-mentioned sound volume control device embodiment, the embodiment of the present invention is carrying out Intelligent volume to audio data
After adjustment, persistently the volume of the audio data after adjustment is monitored in preset time, and according to preset volume control
Threshold values processed controls the volume peak of the audio data after adjustment.After being adjusted in Intelligent volume, continue to adjustment
The volume of audio data afterwards is monitored, and monitor volume peak it is too high or too low when carry out volume intelligent control,
The effect that ensure that volume control improves the intelligent of volume control.
The embodiment of the invention also discloses a kind of terminal, which can be that the various terminals such as PC, mobile phone, MP3, MP4 are set
It is standby.Wherein, which may include an audio control apparatus, and the concrete structure and function of the audio control apparatus may refer to figure
Related description in 6- embodiment illustrated in fig. 11, this will not be repeated here.
By the description of above-mentioned terminal embodiment, the embodiment of the present invention is adjusting it to audio data progress Intelligent volume
Afterwards, persistently the volume of the audio data after adjustment is monitored in preset time, and according to preset volume control threshold values
The volume peak of audio data after adjustment is controlled.After being adjusted in Intelligent volume, continue to the sound after adjustment
The volume of frequency evidence is monitored, and monitor volume peak it is too high or too low when carry out volume intelligent control, ensure that
The effect of volume control improves the intelligent of volume control.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a computer read/write memory medium
In, the program is when being executed, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic
Dish, CD, read-only memory(Read-Only Memory, ROM)Or random access memory(Random Access
Memory, RAM)Deng.
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly
It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.
Claims (11)
1. a kind of method for controlling volume, which is characterized in that including:
Adjust the volume value of audio data;
According to the volume value of the audio data after adjustment, the volume peak of the audio data in preset time is calculated;
If the volume value of the adjustment audio data is to carry out increase processing to the volume of audio data, using preset the
One volume control threshold values shows the volume after adjustment when the volume peak is more than the first volume control threshold values
The volume peak of data controls threshold values higher than max volume set by user, using preset first control coefrficient to each frame sound
Frequency frame carries out negative gain process, reduces the volume of each frame audio frame, to reduce the volume of audio data;
If the volume value of the adjustment audio data is to carry out reduction processing to the volume of audio data, using preset the
Two volume control threshold values show the volume after adjustment when the volume peak is less than the second volume control threshold values
The volume peak of data controls threshold values less than minimal volume set by user, using preset second control coefrficient to each frame sound
Frequency frame carries out postiive gain processing, increases the volume of each frame audio frame, to the volume of augmented audio data.
2. the method as described in claim 1, which is characterized in that the volume value of the adjustment audio data, including:
Obtain all sampled values of each frame audio frame of audio data;
Using the first gain coefficient, postiive gain processing is carried out to all sampled values of each frame audio frame.
3. the method as described in claim 1, which is characterized in that the volume value of the adjustment audio data, including:
Obtain all sampled values of each frame audio frame of audio data;
Using the second gain coefficient, negative gain process is carried out to all sampled values of each frame audio frame.
4. method as claimed in claim 2 or claim 3, which is characterized in that the volume value according to the audio data after adjustment, meter
The volume peak of the audio data in preset time is calculated, including:
For each frame audio frame of the audio data after adjustment, sum to all sampled values of each frame audio frame
It calculates, obtains the energy of each frame audio frame;
The continuous audio frame of preset value quantity is chosen, or chooses the continuous audio frame in preset time;
The average energy for calculating selected continuous audio frame, obtains the volume peak of the audio data.
5. a kind of sound volume control device, which is characterized in that including:
Adjust module, the volume value for adjusting audio data;
Computing module calculates the sound of the audio data in preset time for the volume value according to the audio data after adjustment
Measure peak value;
Control module, if the volume value for the adjustment audio data is to carry out increase processing to the volume of audio data,
Preset first volume control threshold values is then used, when the volume peak is more than the first volume control threshold values, shows to adjust
The volume peak of the volume data after whole controls threshold values higher than max volume set by user, is controlled using preset first
Coefficient carries out negative gain process to each frame audio frame, reduces the volume of each frame audio frame, to reduce the sound of audio data
Amount;If the volume value of the adjustment audio data is to carry out reduction processing to the volume of audio data, using preset the
Two volume control threshold values show the volume after adjustment when the volume peak is less than the second volume control threshold values
The volume peak of data controls threshold values less than minimal volume set by user, using preset second control coefrficient to each frame sound
Frequency frame carries out postiive gain processing, increases the volume of each frame audio frame, to the volume of augmented audio data.
6. device as claimed in claim 5, which is characterized in that the adjustment module includes:
First acquisition unit, all sampled values of each frame audio frame for obtaining audio data;
The first adjustment unit carries out at postiive gain all sampled values of each frame audio frame for using the first gain coefficient
Reason.
7. device as claimed in claim 5, which is characterized in that the adjustment module includes:
Second acquisition unit, all sampled values of each frame audio frame for obtaining audio data;
Second adjustment unit carries out at negative gain all sampled values of each frame audio frame for using the second gain coefficient
Reason.
8. device as claimed in claims 6 or 7, which is characterized in that the computing module includes:
Frame energy calculation unit, for each frame audio frame for the audio data after adjustment, to each frame audio frame
All sampled values carry out read group total, obtain the energy of each frame audio frame;
Selection unit, the continuous audio frame for choosing preset value quantity, or choose the continuous audio frame in preset time;
Peak computational unit, the average energy for calculating selected continuous audio frame, obtains the volume of the audio data
Peak value.
9. device as claimed in claim 8, which is characterized in that the control module includes:
First judging unit, for judging whether the volume peak of the audio data is more than the first volume control threshold values;
First control unit, if the volume peak for the audio data is more than the first volume control threshold values, using pre-
If the first control coefrficient, negative gain process is carried out to the audio data.
10. device as claimed in claim 8, which is characterized in that the control module includes:
Second judgment unit, for judging whether the volume peak of the audio data is less than the second volume control threshold values;
Second control unit, if the volume peak for the audio data is less than the second volume control threshold values, using pre-
If the second control coefrficient, to the audio data carry out postiive gain processing.
11. a kind of terminal, which is characterized in that including:Such as claim 5-10 any one of them sound volume control devices.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210335551.4A CN103684303B (en) | 2012-09-12 | 2012-09-12 | A kind of method for controlling volume, device and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210335551.4A CN103684303B (en) | 2012-09-12 | 2012-09-12 | A kind of method for controlling volume, device and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103684303A CN103684303A (en) | 2014-03-26 |
CN103684303B true CN103684303B (en) | 2018-09-04 |
Family
ID=50320808
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210335551.4A Active CN103684303B (en) | 2012-09-12 | 2012-09-12 | A kind of method for controlling volume, device and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103684303B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105450193A (en) * | 2014-08-28 | 2016-03-30 | 深圳Tcl新技术有限公司 | Volume adjusting method and volume adjusting device |
CN104579212B (en) * | 2015-01-30 | 2017-04-19 | 青岛海信电器股份有限公司 | Method and device for adjusting audio gains |
EP3671430A4 (en) * | 2017-08-18 | 2020-08-26 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Volume adjustment method and apparatus, terminal device, and storage medium |
CN109300482A (en) * | 2018-09-13 | 2019-02-01 | 广州酷狗计算机科技有限公司 | Audio recording method, apparatus, storage medium and terminal |
CN110457002B (en) * | 2019-07-03 | 2023-07-25 | 平安科技(深圳)有限公司 | Multimedia file processing method, device and computer storage medium |
CN111813367B (en) * | 2020-07-22 | 2024-07-12 | 广州繁星互娱信息科技有限公司 | Method, device, equipment and storage medium for adjusting volume |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101399523A (en) * | 2008-09-05 | 2009-04-01 | 宇龙计算机通信科技(深圳)有限公司 | Gain control method and system for playing audio signal |
CN101459415A (en) * | 2008-11-26 | 2009-06-17 | 苏州顺芯半导体有限公司 | Volume automatic control method and circuit in digital audio field |
CN102255607A (en) * | 2010-05-17 | 2011-11-23 | 腾讯科技(深圳)有限公司 | Method for adjusting output volume and system thereof |
CN102610229A (en) * | 2011-01-21 | 2012-07-25 | 安凯(广州)微电子技术有限公司 | Method, apparatus and device for audio dynamic range compression |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9425747B2 (en) * | 2008-03-03 | 2016-08-23 | Qualcomm Incorporated | System and method of reducing power consumption for audio playback |
CN102422349A (en) * | 2009-05-14 | 2012-04-18 | 夏普株式会社 | Gain control apparatus and gain control method, and voice output apparatus |
-
2012
- 2012-09-12 CN CN201210335551.4A patent/CN103684303B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101399523A (en) * | 2008-09-05 | 2009-04-01 | 宇龙计算机通信科技(深圳)有限公司 | Gain control method and system for playing audio signal |
CN101459415A (en) * | 2008-11-26 | 2009-06-17 | 苏州顺芯半导体有限公司 | Volume automatic control method and circuit in digital audio field |
CN102255607A (en) * | 2010-05-17 | 2011-11-23 | 腾讯科技(深圳)有限公司 | Method for adjusting output volume and system thereof |
CN102610229A (en) * | 2011-01-21 | 2012-07-25 | 安凯(广州)微电子技术有限公司 | Method, apparatus and device for audio dynamic range compression |
Also Published As
Publication number | Publication date |
---|---|
CN103684303A (en) | 2014-03-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103684303B (en) | A kind of method for controlling volume, device and terminal | |
US8724017B2 (en) | Auto exposure techniques for variable lighting conditions | |
CN102667924B (en) | Selectivity power is utilized to control the method and system of decoding to voice data | |
CN106941004B (en) | Method and apparatus for bit allocation of audio signal | |
US7558158B2 (en) | Electronic apparatus and method for implementing an intelligent wake mode | |
CN103701419A (en) | Volume regulating method and device | |
CN101223490A (en) | Using historic load profiles to dynamically adjust operating frequency and available power to a handheld multimedia device processor core | |
KR101427993B1 (en) | Method for converting audio signal to haptic signal and apparatus for performing the same | |
CN103929692B (en) | Audio information processing method and electronic equipment | |
WO2019001407A1 (en) | Download control method and device, multimedia terminal and computer storage medium | |
CN107818789B (en) | Decoding method and decoding device | |
CN108174031A (en) | A kind of volume adjusting method, terminal device and computer readable storage medium | |
CN110554945A (en) | electric quantity control method, electronic equipment and computer readable storage medium | |
BR112014016153B1 (en) | method for an encoder to process audio data, method for processing an audio signal, encoder and decoder | |
US20180213341A1 (en) | Method for processing vr audio and corresponding equipment | |
CN107634783B (en) | The carrier aggregation mode setting method and communication terminal and medium product of communication terminal | |
CA2770622C (en) | Frequency band scale factor determination in audio encoding based upon frequency band signal energy | |
JP6182895B2 (en) | Processing apparatus, processing method, program, and processing system | |
WO2020019180A1 (en) | Image encoding control method and device, storage medium and unmanned aerial vehicle | |
CN111580774B (en) | Sound effect adjusting method, device, equipment and storage medium | |
CN104658559B (en) | Multi-medium play method and device | |
CN114866814A (en) | Network bandwidth allocation method and device | |
CN103595363B (en) | A kind of method for controlling volume, device and terminal | |
CN114040257A (en) | Self-adaptive video stream transmission playing method, device, equipment and storage medium | |
US20100121901A1 (en) | Moving-picture processing device and moving-picture processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |