CN107547732A - A kind of media play volume adjusting method, device, terminal and storage medium - Google Patents

A kind of media play volume adjusting method, device, terminal and storage medium Download PDF

Info

Publication number
CN107547732A
CN107547732A CN201710543150.0A CN201710543150A CN107547732A CN 107547732 A CN107547732 A CN 107547732A CN 201710543150 A CN201710543150 A CN 201710543150A CN 107547732 A CN107547732 A CN 107547732A
Authority
CN
China
Prior art keywords
volume
current environment
audio
media
broadcast sound
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710543150.0A
Other languages
Chinese (zh)
Inventor
潘宇超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Original Assignee
Yulong Computer Telecommunication Scientific Shenzhen 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 Yulong Computer Telecommunication Scientific Shenzhen Co Ltd filed Critical Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority to CN201710543150.0A priority Critical patent/CN107547732A/en
Publication of CN107547732A publication Critical patent/CN107547732A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a kind of media play volume adjusting method, device, terminal and storage medium, methods described includes:During media renderer plays, current environment audio is recorded;The current environment volume according to corresponding to current environment audio described in the current environment audio computer;According to the broadcast sound volume of media player described in the current environment volume adjusting.The program is during the media player of user's using terminal, by recording current environment audio every preset duration to detect the volume of current environment, after having recorded every time, calculate current environment volume corresponding to the current environment audio recorded, the broadcast sound volume of media player is finally adjusted according to the size for the current environment volume being calculated, so, realization automatically adjusts broadcast sound volume according to current environment volume in good time, operated without user, avoid the bad experience brought in the prior art because adjusting volume manually to user, improve the hommization of broadcast sound volume regulation.

Description

A kind of media play volume adjusting method, device, terminal and storage medium
Technical field
The present invention relates to communication technical field, and in particular to a kind of media play volume adjusting method, device, terminal and deposits Storage media.
Background technology
At present, as the development of the communication technology, various mobile terminals turn into people's daily life gradually An indispensable part, mobile phone, tablet personal computer, etc. terminal device increasingly popularized in daily life, use Family can not only carry out information interchange by terminal, can also carry out recreation experience, for example listen music, see video etc..
When user uses media player, the situation of regulation volume, the media player of existing terminal are often run into Volume adjusting mode it is more stiff, such as, open video player, can typically be played with default volume, if midway use Regulation volume is wanted at family, can only adjust manually, extremely inconvenient, influences the audiovisual experience of user.For another example, video is in playing process In, the surrounding environment volume where user becomes quiet or noisy suddenly, for the sense of hearing custom of user, default sound Amount can seem excessive or too small, cause user not hear video-frequency playing content, even if subsequently through manual regulation volume, also can Influence the audiovisual experience of user.
The content of the invention
In view of this, the embodiments of the invention provide a kind of media play volume adjusting method, device, terminal and storage to be situated between Matter, to solve the problems, such as that media play volume can not automatically adjust in the prior art.
First aspect present invention provides a kind of media play volume adjusting method, applied to terminal, such as mobile phone, flat board Computer etc., including:During media renderer plays, current environment audio is recorded;According to the current environment audio computer The current environment volume corresponding to the current environment audio;According to media player described in the current environment volume adjusting Broadcast sound volume.
The method described by implementing first aspect, during the media player of user's using terminal, passes through recording Current environment audio detects the volume of current environment, and can carry out an environmental audio every preset duration herein records, record Duration processed can be set as needed, after having recorded every time, calculate current environment corresponding to the current environment audio of recording Volume, the broadcast sound volume of media player is finally adjusted according to the size for the current environment volume being calculated, in this way, realizing Broadcast sound volume is automatically adjusted according to current environment volume in good time, operated without user, is avoided in the prior art because of regulation manually The bad experience that volume is brought to user, improve the hommization of broadcast sound volume regulation.
It is described according to current environment audio in first aspect present invention first embodiment with reference to first aspect present invention Calculating the current environment volume corresponding to the current environment audio includes:Obtain volume corresponding to the current environment audio Characterize intensity;The volume calculation formula according to corresponding to the volume characterizes intensity selection;According to calculating the volume formula The current environment volume corresponding to current environment audio.
By performing above-mentioned steps, when calculating current environment volume, current volume is obtained first and characterizes intensity, herein Volume characterizes intensity and can selected in advance by user, and different volumes, which characterizes intensity, can correspond to different volume calculation formula, After volume indicator journey degree is determined, you can the volume calculation formula chosen under the volume indicator journey degree calculates current environment audio pair The current environment volume answered, in this way, volume calculation formula is different, fundamentally determine that same current environment audio has not Same volume, in actual application environment, the audio in environment is usually uncertain, and volume distribution is uniform sometimes, sometimes sound Amount height has a long way to go, therefore the calculating of the volume for current environment audio, can be protruded using different volume calculation formula Different environmental quality, the diversity of volume indicator journey degree, enriches the calculation of current environment volume, equally enriches use Family makes result of calculation more to show the demand of user, improves Consumer's Experience to the selectivity of volume adjusting demand.
With reference to first aspect present invention first embodiment, in first aspect present invention second embodiment, when the sound When scale sign intensity is the first estate, according to the maximum and reference sound pressure of all audio sample points of the current environment audio Determine the volume calculation formula;Or when it is the second grade that the volume, which characterizes intensity, according to the current environment audio The virtual value and the reference sound pressure of all audio sample points determine the volume calculation formula;Or when the volume characterizes intensity For the tertiary gradient when, the sound is determined according to the average value of all audio sample points of the current environment audio and reference amplitude Measure calculation formula.
By performing above-mentioned steps, different volume indicator journey degree ranks can be pre-set as needed, specifically, the One rank can characterize current environment volume by calculating the maximum of all sampled points, in such cases to the table of ambient sound Sign more block, strong, that is, make it that influence of the volume adjusting of media player to environmental volume is more sensitive;Second level can be with Current environment volume, the current environment volume that the program is calculated are characterized by calculating the virtual value of all audio sample points First level is less than to the sign degree of current environment audio, i.e., finally causes the volume adjusting of media player to environmental volume Influence sensitivity be less than first level situation;Third level can be characterized by the average value of all audio sample points Current environment volume, is calculated that current environment volume is more stable in such cases, is not easily susceptible to the influence of extreme case, but Be compared to by way of audio sample point maximum value calculation, it is slower to the sign of environmental volume.It should be noted that for Different demands, three kinds of algorithms of calculations set forth above environmental volume can be considered, naturally, calculating of the invention is current The mode of environmental volume is not limited to above-mentioned calculating combination, as long as the volume for being that by present embodiment calculates Scheme is applied to the present invention.
It is described according to the current environment in the embodiment of first aspect present invention the 3rd with reference to first aspect present invention The broadcast sound volume of media player described in volume adjusting includes:According to the corresponding relation between environmental volume and media play volume Obtain broadcast sound volume grade corresponding to the current environment volume;The broadcast sound volume of the media player is adjusted to described and broadcast Put media play volume corresponding to level of sound volume.
By performing above-mentioned steps, can be accustomed to establishing previously according to human auditory environmental volume and media play volume it Between corresponding relation form, broadcast sound volume grade can be marked in relation table, after current environment volume is calculated, from pass It is that broadcast sound volume grade corresponding to current environment volume is obtained in table, then with media play sound corresponding to the broadcast sound volume grade The broadcast sound volume of amount regulation media player, in this way, the volume that media play volume is not only selected with user characterizes intensity and worked as Preceding environmental audio is relevant, also suffers from the influence of the volume use habit of user so that media play volume more meets user's Demands of individuals, more hommization.
With reference to first aspect present invention, in the embodiment of first aspect present invention the 4th, working as front ring described in the basis Also include before the broadcast sound volume of media player described in the volume adjusting of border:When the media player is opened, described in control Media player exports broadcast sound volume with default volume.
By performing above-mentioned steps, when user just opens media player, played first with default volume output Volume, herein preset volume can be especially small, user will be barely audible, with avoid peace and quiet environment under broadcast sound volume it is excessive and Others is bothered, while can be ensured before the broadcast sound volume according to current environment volume adjusting media player, will not be gone out The situation of existing broadcast sound volume delay.
In addition, second aspect of the present invention provides a kind of media play volume adjustment device, for terminal, such as mobile phone peace Plate computer etc., the media play volume adjustment device include being used to perform above-mentioned any one matchmaker of first aspect or first aspect The module or unit of body broadcast sound volume adjusting method.
For example, described device includes:Module is recorded, for during media renderer plays, recording current environment sound Frequently;Computing module, for the current environment sound corresponding to the current environment audio according to the current environment audio computer Amount;Adjustment module, the broadcast sound volume for the media player according to the current environment volume adjusting.
By implementing above-mentioned media play volume adjustment device, during the media player of user's using terminal, lead to Cross and record current environment audio to detect the volume of current environment, can carry out an environmental audio record every preset duration herein System, recording duration can be set as needed, after having recorded every time, be calculated current corresponding to the current environment audio of recording Environmental volume, the broadcast sound volume of media player is finally adjusted according to the size for the current environment volume being calculated, in this way, Realization automatically adjusts broadcast sound volume according to current environment volume in good time, is operated without user, avoids in the prior art because manually The bad experience that regulation volume is brought to user, improves the hommization of broadcast sound volume regulation.
With reference to second aspect of the present invention, in second aspect of the present invention first embodiment, the computing module includes:First Acquiring unit, intensity is characterized for obtaining volume corresponding to the current environment audio;Selecting unit, for according to the volume Characterize volume calculation formula corresponding to intensity selection;Computing unit, for calculating the current environment according to the volume formula The current environment volume corresponding to audio.
By implementing above-mentioned media play volume adjustment device, when calculating current environment volume, obtain first currently Volume characterizes intensity, and volume characterizes intensity and can selected in advance by user herein, and different volumes, which characterizes intensity, can correspond to difference Volume calculation formula, after volume indicator journey degree is determined, you can choose the volume calculation formula under the volume indicator journey degree Current environment volume corresponding to calculating current environment audio, in this way, volume calculation formula is different, is fundamentally determined same Current environment audio has different volumes, and in actual application environment, the audio in environment is usually uncertain, sometimes sound Amount is evenly distributed, and volume height has a long way to go sometimes, therefore the calculating of the volume for current environment audio, using different sounds Amount calculation formula can protrude different environmental qualities, the diversity of volume indicator journey degree, enrich the calculating of current environment volume Mode, selectivity of the user to volume adjusting demand is equally enriched, result of calculation is more showed the demand of user, improve Consumer's Experience.
With reference to second aspect of the present invention first embodiment, in second aspect of the present invention second embodiment, when the sound When scale sign intensity is the first estate, according to the maximum and reference sound pressure of all audio sample points of the current environment audio Determine the volume calculation formula;Or when it is the second grade that the volume, which characterizes intensity, according to the current environment audio The virtual value and the reference sound pressure of all audio sample points determine the volume calculation formula;Or when the volume characterizes intensity For the tertiary gradient when, the sound is determined according to the average value of all audio sample points of the current environment audio and reference amplitude Measure calculation formula.
By implementing above-mentioned media play volume adjustment device, different volume indicator journeys can be pre-set as needed Rank is spent, specifically, first level can characterize current environment volume, such a feelings by calculating the maximum of all sampled points To the sign of ambient sound more block, strong under condition, that is, cause influence of the volume adjusting of media player to environmental volume more It is sensitive;Second level can characterize current environment volume by calculating the virtual value of all audio sample points, and the program calculates Obtained current environment volume is less than first level to the sign degree of current environment audio, i.e., finally causes media player Influence sensitivity of the volume adjusting to environmental volume is less than the situation of first level;Third level can be adopted by all audios The average value of sampling point characterizes current environment volume, and it is more stable to be calculated current environment volume in such cases, be not easy by To the influence of extreme case, but compared to by way of audio sample point maximum value calculation, to the sign of environmental volume compared with Slowly.It should be noted that for different demands, three kinds of algorithms of calculations set forth above environmental volume can be considered, from So, the mode of calculating current environment volume of the invention is not limited to above-mentioned calculating combination, as long as can be real The volume numerical procedure of existing present embodiment is applied to the present invention.
With reference to second aspect of the present invention, in the embodiment of second aspect of the present invention the 3rd, the adjustment module includes:Second Acquiring unit, it is corresponding for obtaining the current environment volume according to the corresponding relation between environmental volume and media play volume Broadcast sound volume grade;Adjustment unit, for the broadcast sound volume of the media player to be adjusted to the broadcast sound volume grade Corresponding media play volume.
By implementing above-mentioned media play volume adjustment device, can be accustomed to establishing environmental volume previously according to human auditory The form of corresponding relation between media play volume, broadcast sound volume grade can be marked in relation table, worked as being calculated After preceding environmental volume, broadcast sound volume grade corresponding to current environment volume is obtained from relation table, then with the broadcast sound volume etc. The broadcast sound volume of media play volume adjusting media player corresponding to level, in this way, media play volume is not only selected with user Volume characterize intensity it is relevant with current environment audio, also suffer from the influence of the volume use habit of user so that media are broadcast Playback amount more meets the demands of individuals of user, more hommization.
With reference to second aspect of the present invention, in the embodiment of second aspect of the present invention the 4th, in addition to:Control module, it is used for Before the broadcast sound volume of the media player according to the current environment volume adjusting, opened in the media player Qi Shi, the media player is controlled to export broadcast sound volume with default volume.
By implementing above-mentioned media play volume adjustment device, when user just opens media player, first with Default volume output broadcast sound volume, presetting volume herein can be especially small, and user will be barely audible, to avoid in quiet environment Lower broadcast sound volume is excessive and bothers others, while can ensure in the broadcasting according to current environment volume adjusting media player Be not in the situation of broadcast sound volume delay before volume.
Module or unit included by the media play volume adjustment device are not limited to above-mentioned naming method.
These aspects of the application can more straightforward in the following description.
Third aspect present invention provides a kind of terminal, including memory, processor and storage are on a memory and can The computer program run on a processor, it is characterised in that the present invention first is realized during the computing device described program Media play volume adjusting method described in any embodiment of aspect or first aspect.
Fourth aspect present invention provides a kind of computer-readable recording medium, the computer-readable recording medium storage Computer instruction, the computer instruction are used for any reality for making the computer perform first aspect present invention or first aspect Apply the media play volume adjusting method described in mode.
Brief description of the drawings
The features and advantages of the present invention can be more clearly understood by reference to accompanying drawing, accompanying drawing is schematically without that should manage Solve to carry out any restrictions to the present invention, in the accompanying drawings:
Fig. 1 shows the structure chart of mobile phone in the embodiment of the present invention;
Fig. 2 shows the flow chart of media play volume adjusting method according to embodiments of the present invention;
Fig. 3 shows the structural representation of media play volume adjustment device according to embodiments of the present invention;
Fig. 4 shows another structural representation of media play volume adjustment device according to embodiments of the present invention;
Fig. 5 shows the structural representation of terminal according to embodiments of the present invention.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is Part of the embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those skilled in the art are not having There is the every other embodiment made and obtained under the premise of creative work, belong to the scope of protection of the invention.
As shown in figure 1, it is the application scenarios schematic diagram of embodiments of the invention.Mobile terminal is mobile phone or tablet personal computer etc. Mobile device, mobile terminal by taking mobile phone as an example, the part-structure block diagram of mobile phone as shown in figure 1, mobile phone include radio circuit 110, Memory 120, input block 130, display unit 140, sensor 150, voicefrequency circuit 160, wireless module 170, processor 180 And the grade of power supply 190 part.It will be understood by those skilled in the art that the handset structure shown in Fig. 1 is not formed to mobile phone Limit, can include than illustrating more or less parts, either combine some parts or different parts arrangement.
Wherein RF circuits 110 be used for receive and send messages or communication process in, the reception and transmission of signal.Memory 120 is used for Software program and module are stored, processor 180 is stored in the software program and module of memory 120 by operation, so as to Perform various function application and the data processing of mobile phone.Input block 130 is used for the numeral or character information for receiving input, with And produce the key signals relevant with the user of mobile phone setting and function control and input.Input block 130 may include contact panel 131 and other input equipments 132.Other input equipments 132 can include but is not limited to physical keyboard, function key, mouse, behaviour Make the one or more in bar.Display unit 140 be used for show by user input information or be supplied to user information and The various menus of mobile phone.Display unit 140 can include display panel 141.Contact panel 131 can cover display panel 141, when After contact panel 131 detects the touch operation on or near it, processor 180 is sent to determine the class of touch event Type, it is followed by subsequent processing device 180 and corresponding visual output is provided on display panel 141 according to the type of touch event.
Mobile phone may also include at least one sensor 150, such as optical sensor, motion sensor and other sensors.Light Sensor may include ambient light sensor and proximity transducer, and environmental sensor can adjust display according to the light and shade of ambient light The brightness of panel 141, proximity transducer can close display panel 141 and/or backlight when mobile phone is moved in one's ear.This implementation In example on the housing for the front and back that optical sensor can be arranged on mobile phone, for detecting blocked area when user holds mobile phone Domain.Pressure sensor can also be included herein, be arranged on the front or back housing of mobile phone, for the side by detecting pressure Formula obtains occlusion area when user holds mobile phone.In addition, mobile phone can also configure gyroscope, barometer, hygrometer, temperature The other sensors such as meter, infrared ray sensor, are repeated no more.
Voicefrequency circuit 160, loudspeaker 161, microphone 162 can provide the COBBAIF between user and mobile phone.Wireless mould Block 170 can be WIFI module, provide the user wireless the Internet access service.
Processor 180 is the control centre of mobile phone, using various interfaces and the various pieces of connection whole mobile phone, is led to Cross operation or perform the software program and/or module being stored in memory 120, and call and be stored in memory 120 Data, the various functions and processing data of mobile phone are performed, so as to carry out integral monitoring to mobile phone.Optionally, processor 180 can be with Including one or more processing units.In addition, mobile phone also include each part power supply power supply 190, by power-supply management system with Processor 180 is logically contiguous, so as to realize the functions such as management charging, electric discharge and power managed by power-supply management system.
Although being not shown, mobile phone can also include camera, bluetooth module etc., will not be repeated here.
Referring to Fig. 2, a kind of media play volume adjusting method provided in an embodiment of the present invention, applied to terminal, such as Mobile phone, tablet personal computer etc., this method includes:
S21:During media renderer plays, current environment audio is recorded;In the media play of user's using terminal During device, the volume of current environment is detected by recording current environment audio, can carry out one every preset duration herein Secondary environment audio recording, recording duration can be set as needed, specifically, such as, record the current of preset duration T seconds Environmental audio, android system provide three classes MediaRecorder, AudioSource, AudioRecord and record sound Frequently, can also be provided directly from Android Audio Hardware read () function or in Linux ALSA frameworks Tinycap instruments read current environment audio PCM data, preset duration can be very short herein, with avoid the tinkle of bells play have Hysteresis quality.
S22:According to current environment volume corresponding to current environment audio computer current environment audio;Record and worked as every time After preceding environmental audio, current environment volume corresponding to current environment audio is calculated, with according to the current environment volume calculated every time The broadcast sound volume of media player is in time adjusted, current environment volume side is calculated by recording current environment audio Formula is easy, it is not necessary to which terminal additional equipment can be achieved, and the audio that scene is recorded has more authenticity, more press close to current The reality of environment.Select to circulate every preset duration herein and carry out environmental volume recording and calculating, until media player Stop playing, not only ensure that broadcast sound volume changes in good time with the change of environmental volume, moreover, compared to real-time recording and counting For the mode for calculating environmental volume, terminal energy consumption can be saved.
S23:According to the broadcast sound volume of current environment volume adjusting media player.Finally calculated according in step S22 The size of obtained current environment volume adjusts the broadcast sound volume of media player, in this way, realizing in good time according to current environment Volume automatically adjusts broadcast sound volume so that the broadcast sound volume of media player adapts to the environment residing for user automatically, such as noisy Under environment, broadcast sound volume can become big, and relatively under quiet environment, broadcast sound volume can diminish, and be operated without user, avoid existing Have in technology because of the bad experience that regulation volume is brought to user manually, improve the hommization of broadcast sound volume regulation.
Alternatively, step S22 can include:Obtain volume corresponding to current environment audio and characterize intensity;According to volume indicator Levy volume calculation formula corresponding to intensity selection;The current environment volume according to corresponding to volume formula calculates current environment audio. Specifically, when calculating current environment volume, obtain current volume first and characterize intensity, herein volume characterize intensity can be by User selectes in advance, and different volumes, which characterizes intensity, can correspond to different volume calculation formula, and volume indicator journey degree is being determined Afterwards, you can the volume calculation formula chosen under the volume indicator journey degree calculates current environment volume corresponding to current environment audio, In this way, volume calculation formula is different, fundamentally determine that same current environment audio has different volumes, actually should With in environment, the audio in environment is usually uncertain, and volume distribution is uniform sometimes, and volume height has a long way to go sometimes, because This calculating for the volume of current environment audio, different environmental qualities, sound can be protruded using different volume calculation formula The diversity of scale journey degree, the calculation of current environment volume is enriched, equally enrich user to volume adjusting demand Selectivity, result of calculation is more showed the demand of user, improve Consumer's Experience.
As a kind of specific embodiment, when it is the first estate that the volume, which characterizes intensity, work as front ring according to described The maximum and reference sound pressure of all audio sample points of border audio determine the volume calculation formula;Or when the volume characterizes It is true according to the virtual value of all audio sample points of the current environment audio and the reference sound pressure when intensity is the second grade The fixed volume calculation formula;Or when it is the tertiary gradient that the volume, which characterizes intensity, according to the institute of the current environment audio There are the average value of audio sample point and reference amplitude to determine the volume calculation formula.Specifically, when volume characterizes intensity as the During one grade, volume calculation formula can be:
Wherein, LPFor current environment volume, Prms1 is the maximum of all audio sample points of current environment audio, Pref is reference sound pressure;Or when it is the second grade that volume, which characterizes intensity, volume calculation formula can be:
Wherein, LPFor current environment volume, Prms2 is the virtual value of all audio sample points of current environment audio, Pref is reference sound pressure;Or when it is the tertiary gradient that volume, which characterizes intensity, volume calculation formula can be:
Wherein, LPFor current environment volume, A1For the average value of all audio sample points of current environment audio, A0It is ginseng Examine amplitude.Specifically, if characterizing volume by audio amplitude, intensity is characterized for the volume of different stage, no The scheme of same volume calculation formula is described as follows:
First level:In T second current environment audios, current environment sound is characterized by calculating the maximum of all sampled points Amount;There are the following two kinds acquisition modes for the maximum of all sampled points:
Mode one:The current environment audio of T seconds is first first recorded using MediaRecorder or AudioSource, then Using MediaRecorder or AudioSource method getMaxAmplitude (), all samplings in this T seconds are obtained The maximum of point.
Mode two:The audio of T seconds is first recorded, preserves the pcm voice datas of this T seconds, each sampled point is taken out in then circulation Compare, until calculating maximum.Then current environment volume is calculated using equation below:
Wherein, LPFor current environment volume, Prms1 is the maximum of all sampled points, and Pref is that reference sound pressure (is generally 20 micro- pas, the minimum acoustic pressure that the mankind can hear).The current environment volume come out by audio sample point maximum value calculation is to ring The sign of border sound more block, strong, but can be influenceed by Outliers, such as, at a certain moment, there is leviathan to drop and generate One sound loud noise, if the loud noise is collected, result of calculation will be made very big, and current environment is possible to overall relatively peace in fact It is quiet.
Second level:In T second current environment audios, characterized by calculating the virtual value of all audio sample points current Environmental volume, that is, the pcm voice datas of the T second current environment audios of recording are preserved, then therefrom each sampled point is taken out in circulation, Their root-mean-square value is calculated using equation below:
Wherein, XiThe value of ith sample point is represented, N represents the sampling number in the T seconds, XrmsRepresent the equal of all sampled points Root;Then current environment volume is calculated using equation below:
Wherein, LPFor current environment volume, Prms2 is the virtual value of all audio sample points, and Pref is reference sound pressure (one As be 20 micro- pas, the minimum acoustic pressure that the mankind can hear).Work as front ring by what the virtual value of all audio sample points was calculated Border volume is less than first level to the sign degree of current environment audio, i.e., finally causes the volume adjusting of media player to ring The influence sensitivity of border volume is less than the situation of first level.
Third level:In T second current environment audios, current environment is characterized by the average value of all audio sample points Volume, that is, the pcm voice datas of the T second current environment audios of recording are preserved, then therefrom each sampled point is taken out in circulation, first asks Their quadratic sum, then with quadratic sum divided by the sampling number in the T seconds;Current environment sound is finally calculated using equation below Amount:
Wherein, LPFor current environment volume, A1For the average value of all audio sample points, A0It is that reference amplitude (typically takes 20 Amplitude corresponding to micro- pa sound pressure level, can directly it be taken 1) when calculating here.Obtained by the mean value calculation of all audio sample points It is more stable to current environment volume, it is not easily susceptible to the influence of extreme case, but compared to passing through audio sample point maximum The mode of calculating, it is slower to the sign of environmental volume.
It should be noted that for different demands (degree of the DB to the sign of ambient sound), it can consider and carry above To three kinds of algorithms of computing environment volume determine the grade classification of volume indicator journey degree, such as, the T seconds be divided into n deciles, taken The maximum of each decile sound intermediate frequency sampled point, then again by all these maximums, according to being carried in default volume sensitivity 2 The algorithm arrived, their quadratic sum is first sought, then with quadratic sum divided by n, the volume DB values so calculated can be between above-mentioned first Between current environment volume corresponding to rank and second level.Naturally, the mode of calculating current environment volume of the invention is simultaneously Above-mentioned calculating combination is not limited to, as long as the calculation for being that by the technical scheme of the present embodiment is applied to The present invention.
Alternatively, step S23 can include:Obtained and worked as according to the corresponding relation between environmental volume and media play volume Broadcast sound volume grade corresponding to preceding environmental volume;The broadcast sound volume of media player is adjusted to matchmaker corresponding to broadcast sound volume grade Body broadcast sound volume.Specifically, pair established between environmental volume and media play volume can be accustomed to previously according to human auditory The form that should be related to, broadcast sound volume grade can be marked in relation table, after current environment volume is calculated, from relation table Broadcast sound volume grade corresponding to current environment volume is obtained, then with media play volume adjusting corresponding to the broadcast sound volume grade The form of corresponding relation between the broadcast sound volume of media player, such as environmental volume and media play volume may be referred to as Under type is established:
The tier definition of broadcast sound volume is 0-15 ranks (0 by android system:Volume is minimum, equivalent to Jing Yin, 15:Sound Sound is maximum) according to " decibel " entry on wikipedia, it is 15 grades that DB, which is divided, respectively the 1-15 of corresponding A ndroid systems Prompt tone grade, the form of the corresponding relation between environmental volume and media play volume can be obtained, it is as shown in the table:
DB Prompt tone grade
0-10 is extremely quiet, almost imperceptible 1
10-20 2
20-30 is quiet, softly talks 3
30-35 4
35-40 5
40-45 is general, and general room is talked 6
45-50 7
50-55 8
55-60 9
60-65 is noisy 10
65-70 11
70-80 is very noisy, and nerve cell can have an impact 12
80-90 13
90-100 impaired hearings 14
More than 100 15
Certainly, the level of sound volume distribution shown in upper table, can be adjusted as the case may be and reasonably, for example mobile phone plays sound Sound size, intensity of variation level and level between etc. of the amount grade per one-level can be all adjusted.Calculating current environment sound During amount, you can corresponding volume-level (i.e. broadcast sound volume grade) is matched from upper table, then by the broadcasting of media player Volume adjusting is to the volume-level, in this way, the volume that media play volume is not only selected with user characterizes intensity and current environment Audio is relevant, also suffers from the influence of the volume use habit of user so that media play volume, which more meets the personal of user, to be needed Ask, more hommization.
Alternatively, before step S23, can also include:When media player is opened, control media player is with pre- If volume exports broadcast sound volume.Specifically, when user just opens media player, played first with default volume output Volume, herein preset volume can be especially small, user will be barely audible, with avoid peace and quiet environment under broadcast sound volume it is excessive and Others is bothered, while can be ensured before the broadcast sound volume according to current environment volume adjusting media player, will not be gone out The situation of existing broadcast sound volume delay.
The media play volume adjusting method provided in the present embodiment, in the media player process of user's using terminal In, the volume of current environment is detected by recording current environment audio, can carry out a secondary environment every preset duration herein Audio recording, recording duration can be set as needed, and after having recorded every time, the current environment audio for calculating recording is corresponding Current environment volume, the last size according to the current environment volume being calculated adjusts the broadcasting sound of media player Amount, broadcast sound volume is automatically adjusted according to current environment volume in good time in this way, realizing, is operated without user, avoids prior art The middle bad experience brought because adjusting volume manually to user, improve the hommization of broadcast sound volume regulation.
Referring to Fig. 3, it is a kind of structural representation of media play volume adjustment device provided in an embodiment of the present invention, is used for Terminal, such as mobile phone, tablet personal computer etc., it includes:
Module 31 is recorded, for during media renderer plays, recording current environment audio;Detailed content is referring to upper State the step S21 in embodiment.
Computing module 32, for the current environment volume according to corresponding to current environment audio computer current environment audio;In detail Thin content is referring to the step S22 in above-described embodiment.
Adjustment module 33, for the broadcast sound volume according to current environment volume adjusting media player.Detailed content referring to Step S23 in above-described embodiment.
Alternatively, in some embodiments of the invention, as shown in figure 4, computing module 32 includes:First acquisition unit 321, use Intensity is characterized in obtaining volume corresponding to current environment audio;Selecting unit 322, it is corresponding for characterizing intensity selection according to volume Volume calculation formula;Computing unit 323, for the current environment sound according to corresponding to volume formula calculating current environment audio Amount.Detailed content is described in detail referring to the correlation in above-described embodiment.
Alternatively, in some embodiments of the invention, when it is the first estate that the volume, which characterizes intensity, according to described current The maximum and reference sound pressure of all audio sample points of environmental audio determine the volume calculation formula;Or when the volume indicator When sign intensity is the second grade, according to the virtual value of all audio sample points of the current environment audio and the reference sound pressure Determine the volume calculation formula;Or when it is the tertiary gradient that the volume, which characterizes intensity, according to the current environment audio The average value and reference amplitude of all audio sample points determine the volume calculation formula.Detailed content is referring in above-described embodiment Related detailed description.
Alternatively, in some embodiments of the invention, as shown in figure 4, adjustment module 33 includes:Second acquisition unit 331, use In obtaining the corresponding broadcast sound volume grade of current environment volume according to the corresponding relation between environmental volume and media play volume; Adjustment unit 332, for the broadcast sound volume of media player to be adjusted to media play volume corresponding to broadcast sound volume grade.In detail Thin content is described in detail referring to the correlation in above-described embodiment.
Alternatively, in some embodiments of the invention, as shown in figure 4, also including:Control module 34, for according to current Before the broadcast sound volume of environmental volume regulation media player, when media player is opened, control media player is with default Volume exports broadcast sound volume.Detailed content is described in detail referring to the correlation in above-described embodiment.
The media play volume adjustment device that the present embodiment provides, during the media player of user's using terminal, The volume of current environment is detected by recording current environment audio, can carry out an environmental audio every preset duration herein Record, recording duration can be set as needed, after having recorded every time, calculated and worked as corresponding to the current environment audio of recording Preceding environmental volume, the broadcast sound volume of media player is finally adjusted according to the size for the current environment volume being calculated, such as This, realization automatically adjusts broadcast sound volume according to current environment volume in good time, operates, is avoided in the prior art because of hand without user The bad experience that dynamic regulation volume is brought to user, improves the hommization of broadcast sound volume regulation.
The embodiment of the present invention additionally provides a kind of terminal, including:Any media play volume adjusting in above-described embodiment Device.
Illustrate a kind of terminal of the present invention by taking a kind of smart mobile phone as an example below.
As shown in figure 5, correspondingly, a kind of terminal provided in the embodiment of the present invention, including:At least one processor 51, Memory 52, in Fig. 5 by taking a processor as an example, processor 51, memory 52 are connected by bus 50, and memory 52 is stored with The instruction that can be performed by least one processor 51, instructs and is performed by least one processor 51, so that at least one processor 51 perform following method:
During media renderer plays, current environment audio is recorded;
According to current environment volume corresponding to current environment audio computer current environment audio;
According to the broadcast sound volume of current environment volume adjusting media player.
Optionally, in some embodiments of the invention, according to corresponding to current environment audio computer current environment audio Current environment volume includes:Obtain volume corresponding to current environment audio and characterize intensity;It is corresponding that intensity selection is characterized according to volume Volume calculation formula;The current environment volume according to corresponding to volume formula calculates current environment audio.
Optionally, in some embodiments of the invention, when it is the first estate that the volume, which characterizes intensity, according to described The maximum and reference sound pressure of all audio sample points of current environment audio determine the volume calculation formula;Or when the sound When scale sign intensity is the second grade, according to the virtual value of all audio sample points of the current environment audio and the reference Acoustic pressure determines the volume calculation formula;Or when it is the tertiary gradient that the volume, which characterizes intensity, according to the current environment sound The average value and reference amplitude of all audio sample points of frequency determine the volume calculation formula.
Alternatively, in some embodiments of the invention, according to the broadcasting sound of current environment volume adjusting media player Amount includes:The corresponding broadcast sound volume of current environment volume is obtained according to the corresponding relation between environmental volume and media play volume Grade;The broadcast sound volume of media player is adjusted to media play volume corresponding to broadcast sound volume grade.
Alternatively, in some embodiments of the invention, in the broadcasting according to current environment volume adjusting media player Before volume, at least one processor 51 can also carry out:When media player is opened, control media player is with default sound Amount output broadcast sound volume.
Related description can correspond to associated description corresponding the step of referring to Fig. 2 and effect is understood, not do herein Excessively repeat.
The terminal that above-described embodiment provides, during the media player of user's using terminal, work as front ring by recording Border audio detects the volume of current environment, and can carry out an environmental audio every preset duration herein records, and records duration It can as needed be set, after having recorded every time, calculate current environment volume corresponding to the current environment audio of recording, most The broadcast sound volume of media player is adjusted according to the size for the current environment volume being calculated afterwards, in this way, realizing in good time root Automatically adjust broadcast sound volume according to current environment volume, without user operate, avoid in the prior art because manually adjust volume to The bad experience that user brings, improve the hommization of broadcast sound volume regulation.
The embodiment of the present invention additionally provides a kind of computer-readable recording medium, and computer-readable recording medium storage has meter Calculation machine executable instruction, the computer executable instructions can perform all or part of flow in above-described embodiment method.Wherein, Storage medium can be magnetic disc, CD, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), flash memory (Flash Memory), hard disk (Hard Disk Drive, contracting Write:) or solid state hard disc (Solid-State Drive, SSD) etc. HDD;Storage medium can also include the memory of mentioned kind Combination.
Although being described in conjunction with the accompanying embodiments of the invention, those skilled in the art can not depart from the present invention Spirit and scope in the case of various modification can be adapted and modification, such modifications and variations are each fallen within by appended claims institute Within the scope of restriction.

Claims (12)

  1. A kind of 1. media play volume adjusting method, it is characterised in that including:
    During media renderer plays, current environment audio is recorded;
    The current environment volume according to corresponding to current environment audio described in the current environment audio computer;
    According to the broadcast sound volume of media player described in the current environment volume adjusting.
  2. 2. media play volume adjusting method according to claim 1, it is characterised in that described according to the current environment The current environment volume includes corresponding to current environment audio described in audio computer:
    Obtain volume corresponding to the current environment audio and characterize intensity;
    The volume calculation formula according to corresponding to the volume characterizes intensity selection;
    The current environment volume according to corresponding to the volume formula calculates the current environment audio.
  3. 3. media play volume adjusting method according to claim 2, it is characterised in that
    When it is the first estate that the volume, which characterizes intensity, according to the maximum of all audio sample points of the current environment audio Value and reference sound pressure determine the volume calculation formula;Or
    When it is the second grade that the volume, which characterizes intensity, according to the effective of all audio sample points of the current environment audio Value and the reference sound pressure determine the volume calculation formula;Or
    When it is the tertiary gradient that the volume, which characterizes intensity, according to being averaged for all audio sample points of the current environment audio Value and reference amplitude determine the volume calculation formula.
  4. 4. media play volume adjusting method according to claim 1, it is characterised in that described according to the current environment The broadcast sound volume of media player described in volume adjusting includes:
    Sound is played according to the corresponding relation acquisition current environment volume between environmental volume and media play volume is corresponding Measure grade;
    The broadcast sound volume of the media player is adjusted to media play volume corresponding to the broadcast sound volume grade.
  5. 5. media play volume adjusting method according to claim 1, it is characterised in that working as front ring described in the basis Also include before the broadcast sound volume of media player described in the volume adjusting of border:
    When the media player is opened, the media player is controlled to export broadcast sound volume with default volume.
  6. A kind of 6. media play volume adjustment device, it is characterised in that including:
    Module is recorded, for during media renderer plays, recording current environment audio;
    Computing module, for the current environment sound corresponding to the current environment audio according to the current environment audio computer Amount;
    Adjustment module, the broadcast sound volume for the media player according to the current environment volume adjusting.
  7. 7. media play volume adjustment device according to claim 6, it is characterised in that the computing module includes:
    First acquisition unit, intensity is characterized for obtaining volume corresponding to the current environment audio;
    Selecting unit, for the volume calculation formula according to corresponding to volume sign intensity selection;
    Computing unit, for the current environment volume according to corresponding to the volume formula calculating current environment audio.
  8. 8. media play volume adjustment device according to claim 7, it is characterised in that
    When it is the first estate that the volume, which characterizes intensity, according to the maximum of all audio sample points of the current environment audio Value and reference sound pressure determine the volume calculation formula;Or
    When it is the second grade that the volume, which characterizes intensity, according to the effective of all audio sample points of the current environment audio Value and the reference sound pressure determine the volume calculation formula;Or
    When it is the tertiary gradient that the volume, which characterizes intensity, according to being averaged for all audio sample points of the current environment audio Value and reference amplitude determine the volume calculation formula.
  9. 9. media play volume adjustment device according to claim 6, it is characterised in that the adjustment module includes:
    Second acquisition unit, for obtaining the current environment according to the corresponding relation between environmental volume and media play volume Broadcast sound volume grade corresponding to volume;
    Adjustment unit, broadcast for the broadcast sound volume of the media player to be adjusted to media corresponding to the broadcast sound volume grade Playback amount.
  10. 10. media play volume adjustment device according to claim 6, it is characterised in that also include:
    Control module, for before the broadcast sound volume of the media player according to the current environment volume adjusting, When the media player is opened, the media player is controlled to export broadcast sound volume with default volume.
  11. 11. a kind of terminal, including memory, processor and storage are on a memory and the computer that can run on a processor Program, it is characterised in that realize that the media any one of claim 1 to 5 are broadcast during the computing device described program Playback amount adjustment method.
  12. 12. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the program is by processor The media play volume adjusting method any one of claim 1 to 5 is realized during execution.
CN201710543150.0A 2017-07-05 2017-07-05 A kind of media play volume adjusting method, device, terminal and storage medium Pending CN107547732A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710543150.0A CN107547732A (en) 2017-07-05 2017-07-05 A kind of media play volume adjusting method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710543150.0A CN107547732A (en) 2017-07-05 2017-07-05 A kind of media play volume adjusting method, device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN107547732A true CN107547732A (en) 2018-01-05

Family

ID=60970362

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710543150.0A Pending CN107547732A (en) 2017-07-05 2017-07-05 A kind of media play volume adjusting method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN107547732A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109361994A (en) * 2018-10-12 2019-02-19 Oppo广东移动通信有限公司 Speaker control method, mobile terminal and computer readable storage medium
CN110536023A (en) * 2019-09-29 2019-12-03 李欣钊 A kind of system intelligently adjusting device for prompt tone of electronic based on spatial volume
CN112637416A (en) * 2019-09-20 2021-04-09 北京小米移动软件有限公司 Volume adjusting method and device and storage medium
CN113676595A (en) * 2021-07-12 2021-11-19 杭州逗酷软件科技有限公司 Volume adjusting method, terminal device and computer readable storage medium
CN113993038A (en) * 2021-10-27 2022-01-28 成都颜创启新信息技术有限公司 Volume adjusting method and device, electronic equipment and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101924828A (en) * 2010-07-21 2010-12-22 惠州Tcl移动通信有限公司 Mobile terminal, method and device for adjusting volume thereof
CN201839344U (en) * 2010-07-21 2011-05-18 惠州Tcl移动通信有限公司 Mobile terminal capable of adjusting volume automatically
CN103152668A (en) * 2012-12-22 2013-06-12 深圳先进技术研究院 Adjusting method of output audio and system thereof
CN106161781A (en) * 2016-06-22 2016-11-23 北京小米移动软件有限公司 Method for regulation of sound volume and device
US20170161381A1 (en) * 2015-12-04 2017-06-08 Chiun Mai Communication Systems, Inc. Electronic device and music play system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101924828A (en) * 2010-07-21 2010-12-22 惠州Tcl移动通信有限公司 Mobile terminal, method and device for adjusting volume thereof
CN201839344U (en) * 2010-07-21 2011-05-18 惠州Tcl移动通信有限公司 Mobile terminal capable of adjusting volume automatically
CN103152668A (en) * 2012-12-22 2013-06-12 深圳先进技术研究院 Adjusting method of output audio and system thereof
US20170161381A1 (en) * 2015-12-04 2017-06-08 Chiun Mai Communication Systems, Inc. Electronic device and music play system and method
CN106161781A (en) * 2016-06-22 2016-11-23 北京小米移动软件有限公司 Method for regulation of sound volume and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张婧颖,孟子厚: "《音响师听力训练基础》", 31 August 2015 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109361994A (en) * 2018-10-12 2019-02-19 Oppo广东移动通信有限公司 Speaker control method, mobile terminal and computer readable storage medium
CN112637416A (en) * 2019-09-20 2021-04-09 北京小米移动软件有限公司 Volume adjusting method and device and storage medium
CN110536023A (en) * 2019-09-29 2019-12-03 李欣钊 A kind of system intelligently adjusting device for prompt tone of electronic based on spatial volume
CN113676595A (en) * 2021-07-12 2021-11-19 杭州逗酷软件科技有限公司 Volume adjusting method, terminal device and computer readable storage medium
CN113676595B (en) * 2021-07-12 2023-07-21 杭州逗酷软件科技有限公司 Volume adjustment method, terminal device, and computer-readable storage medium
CN113993038A (en) * 2021-10-27 2022-01-28 成都颜创启新信息技术有限公司 Volume adjusting method and device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
US11251763B2 (en) Audio signal adjustment method, storage medium, and terminal
CN107547732A (en) A kind of media play volume adjusting method, device, terminal and storage medium
US10321222B1 (en) Earphone, earphone control method and device
CN107509153B (en) Detection method and device of sound playing device, storage medium and terminal
WO2019033987A1 (en) Prompting method and apparatus, storage medium, and terminal
US20110095875A1 (en) Adjustment of media delivery parameters based on automatically-learned user preferences
WO2017215657A1 (en) Sound effect processing method, and terminal device
EP2920880A1 (en) Audio loudness control system
CN110459212A (en) Method for controlling volume and equipment
CN112954115B (en) Volume adjusting method and device, electronic equipment and storage medium
CN110677717B (en) Audio compensation method, smart television and storage medium
CN111045642A (en) Volume adjusting method, vehicle-mounted terminal and computer storage medium
CN112947886A (en) Method and device for protecting user hearing and electronic equipment
CN101783656A (en) Loudness control method, module and device of stereo system
CN113992781A (en) Volume control method and device, electronic equipment and computer readable storage medium
KR102110515B1 (en) Hearing aid device of playing audible advertisement or audible data
CN107493376A (en) A kind of ringing volume adjusting method and device
KR20150049914A (en) Earphone apparatus capable of outputting sound source optimized about hearing character of an individual
CN110113694A (en) Method and apparatus for controlling audio broadcasting in the electronic device
CN106293607B (en) Method and system for automatically switching audio output modes
CN113613122B (en) Volume adjusting method, volume adjusting device, earphone and storage medium
CN1941619B (en) Volume management system and method
CN106791252A (en) The player method and device of a kind of incoming ring tone
CN109274826B (en) Voice playing mode switching method and device, terminal and computer readable storage medium
CN111739496A (en) Audio processing method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20180105

RJ01 Rejection of invention patent application after publication