Background technology
It is universal with multimedia application with the development of science and technology, support the electronic equipment of multimedia audio output increasingly
More, each class of electronic devices is not quite similar to output volume control method.Current main-stream equipment is to have customized level of sound volume increasing in advance
Beneficial curve, level of sound volume is by user according to Preferences.
The wide variety of multimedia resource, style and preference are different, since human ear is to the sense of hearing of each different frequency
Sensitivity is different, and the volume that the multimedia resource of different-style under identical volume broadcasts is caused also to be not quite similar.Such as:Human ear pair
The sense of hearing sensitivity of each different frequency is different, and the sound of 125HZ-30dB and the sound of 1KHZ-10dB sound tool in human ear
There is identical loudness;The song frequency spectrum of typical bass wind is concentrated mainly on low frequency part, the song frequency spectrum of typical high pitch wind
It is concentrated mainly on high frequency section.In addition, same song, in different paragraphs, frequency spectrum difference may also be bigger.Therefore, exist
Under identical level of sound volume gain, the sound that the song of high pitch style and the song user of bass style hear but varies, because
Different frequency range loudness sense of hearing difference is big under identical level of sound volume for this, and user is caused to be frequently necessary to manually adjust volume
Meet the custom of oneself.
The patent of Publication No. CN104410379A discloses a kind of volume adjusting method, the method includes:Acquisition is worked as
The characteristic parameter of preceding audio signal;The characteristic parameter and preset parameter threshold corresponding with current volume lattice number are carried out
Compare;According to comparison result, the gain of the current volume lattice number is adjusted.The embodiment of the present invention can be according to the ginseng of audio file
It counts to set the corresponding volume gain of volume adjustment, promotes user experience.Although system sound volume may be implemented in above technical scheme
Adjusting, but this method is using predetermined threshold value according to the stage gains such as the feature of audio signal dynamic and threshold value comparison adjustment,
It can only adjust that audio stream volume itself is different, and the big audio stream of volume difference in different sections gives great volume
It is small, identical volume under the multimedia of different-style different to the sense of hearing sensitivity of each different frequency again without consideration human ear
The volume also different problem that resource is broadcasted, therefore it is identical to solve audio stream volume itself, but due to audio stream
Style (frequency range) is different, leads to the problem that the volume difference that user hears is big.
The patent of Publication No. CN106293606A discloses a kind of sound-volume control system and method for controlling volume, the sound
Amount control method includes:Audio/video file is provided, record has the audio/video file in the file header of the audio/video file
The average gain value of effective audio;When playing the audio/video file, by the audio/video file decoding, described in acquisition
After the average gain value of effective audio of audio/video file, by the average gain value compared with standard gain reference value, obtain
Gain coefficient is obtained, the average gain value is multiplied by gain coefficient and is equal to the standard gain reference value;According to the gain coefficient
Adjust gain when audio/video file described in player plays.Although above technical scheme can also realize the tune of system sound volume
Section, using the comparison of audio stream head pre-set yield value and grade yield value, the then stage gains such as adjustment reduce switching
Song volume saltus step, therefore be also that can only adjust the different audio stream of audio stream volume itself, do not account for human ear pair yet
The sense of hearing sensitivity of each different frequency is different, and the volume that the multimedia resource of different-style broadcasts under identical volume also differs
The problem of, therefore it is identical also to solve audio stream volume itself, but due to audio stream style (frequency range) difference, cause to use
The big problem of volume difference that family is heard.
Invention content
The purpose of the present invention is in view of the drawbacks of the prior art, considered the frequency response curve of audio system and human ear to ring
Sense of hearing psychology curve is spent, the stage gains such as dynamic volume for calculating audio stream using subdivision frequency range level of sound volume gain curve,
Make volume adjustment more fine homogeneous, is adapted to volume difference, volume sense of hearing caused by music style difference and more meets human ear
Characteristic, experience is more preferable.
In order to achieve the goal above, the present invention uses following technical scheme:
A kind of method for controlling volume, including step:
S1. audio stream is received;
S2. the volume of audio stream described in default volume level Gain tuning is used in first time piece;
S3. the stage gains such as dynamic volume are calculated according to the feature of audio stream and subdivision frequency range level of sound volume gain curve;
S4. according to the volume of audio stream described in the dynamic volume grade Gain tuning.
Further, the first time piece is 100ms.
Further, the subdivision frequency range level of sound volume gain curve indicates each frequency range pass corresponding with gain size
System.
Further, it is described subdivision frequency range level of sound volume gain curve formulation process be:
A1. to the loudness and frequency response values of the identical frequency point under the frequency response curve of audio system and equal loudness contour
It is overlapped to obtain the frequency response curve under audio system loudness level;
A2. piece-wise linearization is carried out to the frequency response curve according to preset threshold value and obtains segmentation frequency response curve;
A3. benefit is taken according to the corresponding signal gain of the maximum loudness of audio system upwards to segmentation frequency response curve progress
It obtains taking benefit curve;
A4. benefit curve is taken to be normalized to obtain subdivision frequency range level of sound volume gain curve to described.
Further, the stage gains such as described dynamic volume are the weight of each frequency range and each frequency range pair in the audio stream
The sum of products for the level of sound volume gain answered.
Correspondingly, the present invention also provides a kind of sound-volume control systems, including:
Receiving module, for receiving audio stream;
The first adjustment module, for using the sound of audio stream described in default volume level Gain tuning in first time piece
Measure size;
Computing module, for calculating dynamic volume etc. according to the feature and subdivision frequency range level of sound volume gain curve of audio stream
Stage gain;
Second adjustment module, for the volume according to audio stream described in the dynamic volume grade Gain tuning.
Further, the first time piece is 100ms.
Further, the subdivision frequency range level of sound volume gain curve indicates each frequency range pass corresponding with gain size
System.
Further, it is described subdivision frequency range level of sound volume gain curve formulation process be:
A1. to the loudness and frequency response values of the identical frequency point under the frequency response curve of audio system and equal loudness contour
It is overlapped to obtain the frequency response curve under audio system loudness level;
A2. piece-wise linearization is carried out to the frequency response curve according to preset threshold value and obtains segmentation frequency response curve;
A3. benefit is taken according to the corresponding signal gain of the maximum loudness of audio system upwards to segmentation frequency response curve progress
It obtains taking benefit curve;
A4. benefit curve is taken to be normalized to obtain subdivision frequency range level of sound volume gain curve to described.
Further, the stage gains such as described dynamic volume are the weight of each frequency range and each frequency range pair in the audio stream
The sum of products for the level of sound volume gain answered.
Compared with prior art, the present invention is by considering the frequency response curve of audio system, in conjunction with human ear loudness sense of hearing
Psychology curve, the feature for formulating subdivision frequency range level of sound volume gain curve combination audio stream calculate level of sound volume gain in real time,
It is more careful to the volume adjustment of audio stream, can dynamic control audio streaming voice output size, ensure big in different frequency range sound
Small sense of hearing is consistent, and the musical sound size sense of hearing of different-style is consistent, and grade sound is adjusted in the upper user of alternative sounds output stream
Size sense of hearing is uniform, and volume sense of hearing more meets the characteristic of human ear, and experience is more preferable.
Specific implementation mode
Illustrate that embodiments of the present invention, those skilled in the art can be by this specification below by way of specific specific example
Disclosed content understands other advantages and effect of the present invention easily.The present invention can also pass through in addition different specific realities
The mode of applying is embodied or practiced, the various details in this specification can also be based on different viewpoints with application, without departing from
Various modifications or alterations are carried out under the spirit of the present invention.It should be noted that in the absence of conflict, following embodiment and implementation
Feature in example can be combined with each other.
It should be noted that the diagram provided in following embodiment only illustrates the basic structure of the present invention in a schematic way
Think, component count, shape and size when only display is with related component in the present invention rather than according to actual implementation in schema then
Draw, when actual implementation kenel, quantity and the ratio of each component can be a kind of random change, and its assembly layout kenel
It is likely more complexity.
The technology of the present invention is related to a kind of method for controlling volume and system, with the development of Internet technology, mobile communication
The fast development of technology supports the electronic equipment of multimedia audio output more and more, and the present invention is set aiming at existing electronics
The shortcomings that standby audio system control volume method, the frequency response curve and human ear loudness sense of hearing psychology of audio system are considered
Curve, the stage gains such as dynamic volume for calculating audio stream using subdivision frequency range level of sound volume gain curve so that volume adjustment
More fine homogeneous is adapted to volume difference caused by music style difference, and volume sense of hearing more meets the characteristic of human ear, and experience is more
It is good.
The present invention provides a kind of method for controlling volume, as shown in Figure 1, including step:
S1. audio stream is received;
S2. the volume of audio stream described in default volume level Gain tuning is used in first time piece;
S3. the stage gains such as dynamic volume are calculated according to the feature of audio stream and subdivision frequency range level of sound volume gain curve;
S4. according to the volume of audio stream described in the dynamic volume grade Gain tuning.
Wherein, the audio stream is audio file being played in multimedia electronic equipment.In the specific implementation, electronics is set
It is standby include PC, smart mobile phone (such as Android phone, iOS mobile phones, Windows Phone mobile phones), MP3, MP4,
MP5, tablet computer, palm PC, mobile internet device (MID, Mobile Internet Devices) or Wearable
Etc. the terminal for having multi-media player function, the audio stream can be wide for song files, video file, network flow-medium, FM
It broadcasts, at least one of voice communication and video conference.Above-mentioned audio stream is characterized in referring to quantization means audio stream signal sound
The design parameter of sound feature, characteristic parameter are mainly the frequency and power of above-mentioned audio stream signal.
Electronic equipment playback terminal acquires more matchmakers by way of sampling first before playing specified multimedia file
The characteristic parameter of body file sound intermediate frequency stream.Sample mode therein can be analog-to-digital conversion (ADC, Analog-to-Digital
Converting) sampling or frequency sampling, the specific sample mode embodiment of the present invention are not construed as limiting.
When audio stream starts to play, in first timeslice default volume level gain adjust the volume of audio stream
Size, possible system also has little time to acquire the stage gains such as the feature calculation dynamic volume of audio stream to adjust in first time piece
The volume of audio stream, so being adjusted in first time piece or first using default volume level gain.
Specifically, the default volume level gain is chosen by full frequency-domain level of sound volume gain curve.
Increase it should be noted that the full frequency-domain level of sound volume gain curve is exactly the level of sound volume not being finely divided
Beneficial curve, existing major part electronic equipment is all to adjust giving great volume for audio using full frequency-domain level of sound volume gain curve
It is small.
Optionally, the first time piece is 100ms.
After first time piece, at this point, system has got the characteristic parameter of audio stream, audio stream is got
The stage gains such as dynamic volume are calculated according to the feature of audio stream and subdivision frequency range level of sound volume gain curve after characteristic parameter.
In the specific implementation, the subdivision frequency range level of sound volume gain curve indicates that each frequency range is corresponding with gain size
Relationship.
As shown in Fig. 2, the formulation process of the subdivision frequency range level of sound volume gain curve is:
A1. to the loudness and frequency response values of the identical frequency point under the frequency response curve of audio system and equal loudness contour
It is overlapped to obtain the frequency response curve under audio system loudness level;
A2. piece-wise linearization is carried out to the frequency response curve according to preset threshold value and obtains segmentation frequency response curve;
A3. benefit is taken according to the corresponding signal gain of the maximum loudness of audio system upwards to segmentation frequency response curve progress
It obtains taking benefit curve;
A4. benefit curve is taken to be normalized to obtain subdivision frequency range level of sound volume gain curve to described.
Specifically, being frequency response curve and equal loudness contour that will be in formulation system first, formulation process is to take full frequency band
Frequency response is corresponding loudness frequency response with the corresponding frequency response of peak signal that input signal gain linearity changes, and is taken under the signal amplitude
System loudness is maximum loudness such as 90db when 1khz signals.Then correspond to 90db equal loudness contours and correspondence system frequency response curve.Step by step
(such as decaying 2db) measuring system frequency response curve simultaneously finds corresponding equal loudness contour, until the scheduled minimum loudness of system.
Obtain frequency response curve after frequency response curve and equal loudness contour to audio system and equal loudness contour under
The loudness and frequency response values of identical frequency point are overlapped, and obtain the corresponding frequency response curve of each loudness level.
Then piece-wise linearization is carried out to frequency response curve according to preset threshold value and obtains segmentation frequency response curve.For example, setting
Threshold value is 1db, then it is one section to take Continuous Band of the curvilinear motion threshold value in 1db, and it is loudness value to take mean value in the section, if should
Variation is excessively violent in frequency range, then resultant curve variation tendency and frequency range span choose frequency range.
Then the segmentation frequency response curve is taken upwards according to the maximum loudness of audio system corresponding signal gain
Benefit obtains taking benefit curve.
It is finally that curve is mended in described taking to be normalized until subdivision frequency range level of sound volume gain curve.
Optionally, the normalized is handled using maximum loudness corresponding gain for boundary.
Segmenting frequency range level of sound volume gain curve by formulation can obtain under each loudness level corresponding to different frequency range
Gain size, for example, predefined 10 grades of output volume grade, corresponding loudness are:
Grade |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
Loudness (db) |
90 |
87 |
84 |
81 |
78 |
75 |
72 |
69 |
66 |
64 |
0 |
Different frequency range (such as 80-120Hz and 120- can be obtained according to the subdivision frequency range level of sound volume gain curve of formulation
Two frequency ranges of 250Hz) level of sound volume gain.
Frequency range |
10 |
9 |
8 |
7 |
6 |
80-120Hz |
0.98 |
0.51 |
0.3 |
0.125 |
… |
120-250Hz |
0.96 |
0.41 |
0.2 |
0.12 |
… |
Optionally, the stage gains such as described dynamic volume are that the weight of each frequency range in the audio stream is corresponding with each frequency range
Level of sound volume gain the sum of products.
Specifically, after getting the characteristic parameter of audio stream, before this using the power of each frequency range and to calculate
Weight in audio stream shared by each frequency range can be found each in the audio stream according to subdivision frequency range level of sound volume gain curve
Level of sound volume gain corresponding to a frequency range, until the weight of each frequency range and level of sound volume gain can calculate dynamic volume
Equal stage gains.
Specifically calculating process is:Such as the level of sound volume of default current system is 9 grades, the frequency spectrum of audio stream is fallen
In two frequency ranges of 80-120Hz and 120-250Hz.
Calculate separately two frequency ranges of 80-120Hz and 120-250Hz power and, obtain percentage power and n1 (40) and
N2 (60), it is respectively n1/ (n1+n2)=0.4, n2/ (n1+n2)=0.6 to obtain weight.
Because the current level of sound volume of system is 9 grades, 9 grades of corresponding level of sound volume gains 0.51 and 0.49 are taken, etc.
Weight to two frequency ranges and level of sound volume gain, can calculate dynamic volume grade gain results such as 0.51*0.4+
0.49*0.6=0.498.Then system adjusts volume according to stage gains such as this dynamic volumes.
Correspondingly, the present invention also provides a kind of sound-volume control systems, as shown in figure 3, including:
Receiving module 1, for receiving audio stream;
The first adjustment module 2, for using audio stream described in default volume level Gain tuning in first time piece
Volume;
Computing module 3, for calculating dynamic volume according to the feature and subdivision frequency range level of sound volume gain curve of audio stream
Equal stage gains;
Second adjustment module 4, for the volume according to audio stream described in the dynamic volume grade Gain tuning.
Specifically, the first time piece is 100ms.
Specifically, the subdivision frequency range level of sound volume gain curve indicates the correspondence of each frequency range and gain size.
Specifically, the formulation process of the subdivision frequency range level of sound volume gain curve is:
A1. to the loudness and frequency response values of the identical frequency point under the frequency response curve of audio system and equal loudness contour
It is overlapped to obtain the frequency response curve under audio system loudness level;
A2. piece-wise linearization is carried out to the frequency response curve according to preset threshold value and obtains segmentation frequency response curve;
A3. benefit is taken according to the corresponding signal gain of the maximum loudness of audio system upwards to segmentation frequency response curve progress
It obtains taking benefit curve;
A4. benefit curve is taken to be normalized to obtain subdivision frequency range level of sound volume gain curve to described.
Specifically, the stage gains such as described dynamic volume are corresponding with each frequency range for the weight of each frequency range in the audio stream
Level of sound volume gain the sum of products.
In conclusion the present invention is by considering the frequency response curve of audio system, in conjunction with human ear loudness sense of hearing psychology
Curve, the feature for formulating subdivision frequency range level of sound volume gain curve combination audio stream calculates level of sound volume gain in real time, to audio
The volume adjustment of stream is more careful, can dynamic control audio streaming voice output size, ensure in different frequency range sound size sense of hearing
Unanimously, the musical sound size sense of hearing of different-style is consistent, and adjusting grade sound size in the upper user of alternative sounds output stream listens
Sense is uniform, and volume sense of hearing more meets the characteristic of human ear, and experience is more preferable.
Note that above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that
The present invention is not limited to specific embodiments described here, can carry out for a person skilled in the art it is various it is apparent variation,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out to the present invention by above example
It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also
May include other more equivalent embodiments, and the scope of the present invention is determined by scope of the appended claims.