CN107506170A - volume adjusting method, device, terminal device and storage medium - Google Patents
volume adjusting method, device, terminal device and storage medium Download PDFInfo
- Publication number
- CN107506170A CN107506170A CN201710711659.1A CN201710711659A CN107506170A CN 107506170 A CN107506170 A CN 107506170A CN 201710711659 A CN201710711659 A CN 201710711659A CN 107506170 A CN107506170 A CN 107506170A
- Authority
- CN
- China
- Prior art keywords
- audio
- volume
- amplitude
- terminal device
- information
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/16—Sound input; Sound output
- G06F3/165—Management of the audio stream, e.g. setting of volume, audio stream path
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Circuit For Audible Band Transducer (AREA)
Abstract
The embodiment of the invention discloses a kind of volume adjusting method, device, terminal device and storage medium, this method is included when detecting that terminal device carries out source of sound broadcasting, obtain the audio-frequency information of the source of sound, according to the first audio amplitude corresponding to audio-frequency information determination, determine the second audio amplitude, second audio amplitude includes audio amplitude corresponding to other audio-frequency informations in terminal device, volume adjusting information is determined according to first audio amplitude and second audio amplitude, the volume of the terminal device is adjusted according to the volume adjusting information.This programme improves volume adjusting efficiency, reduces the power consumption of terminal device.
Description
Technical field
The present embodiments relate to computer technology, more particularly to a kind of volume adjusting method, device, terminal device and deposit
Storage media.
Background technology
With the raising of terminal device popularity, increasing user's using terminal equipment performs various work(
Can be to meet self-demand, such as using terminal equipment reads word, watches video, listen music, play game.When terminal device exists
During playing audio-video, the regulation existing defects to volume are, it is necessary to improve.
The content of the invention
The invention provides a kind of volume adjusting method, device, terminal device and storage medium, improves volume adjusting effect
Rate, reduce the power consumption of terminal device.
In a first aspect, the embodiments of the invention provide a kind of volume adjusting method, including:
When detecting that terminal device carries out source of sound broadcasting, the audio-frequency information of the source of sound is obtained;
According to the first audio amplitude corresponding to audio-frequency information determination;
The second audio amplitude is determined, second audio amplitude includes audio corresponding to other audio-frequency informations in terminal device
Amplitude;
Volume adjusting information is determined according to first audio amplitude and second audio amplitude, is adjusted according to the volume
The volume of the terminal device is adjusted section information.
Second aspect, the embodiment of the present invention additionally provide a kind of volume adjustment device, including:
Acquisition module, for when detecting that terminal device carries out source of sound broadcasting, obtaining the audio-frequency information of the source of sound;
Amplitude determination module, for according to the second sound of the first audio amplitude and determination corresponding to audio-frequency information determination
Frequency vibration width, second audio amplitude include audio amplitude corresponding to other audio-frequency informations in terminal device;
Information determination module is adjusted, for determining that volume is adjusted according to first audio amplitude and second audio amplitude
Save information;
Adjustment module, for the volume of the terminal device to be adjusted according to the volume adjusting information.
The third aspect, the embodiment of the present invention additionally provide a kind of terminal device, including:Processor, memory and storage
On a memory and the computer program that can run on a processor, realized such as during computer program described in the computing device
Volume adjusting method described in the embodiment of the present invention.
Fourth aspect, the embodiment of the present invention additionally provide a kind of storage medium for including terminal device executable instruction, institute
Terminal device executable instruction is stated as being adjusted during terminal device computing device for the volume described in performing the embodiment of the present invention
Section method.
Technical scheme provided in an embodiment of the present invention, when detecting that terminal device carries out source of sound broadcasting, obtain the sound
The audio-frequency information in source, according to the audio-frequency information determine corresponding to the first audio amplitude, determine the second audio amplitude, described second
Audio amplitude includes audio amplitude corresponding to other audio-frequency informations in terminal device, according to first audio amplitude and described the
Two audio amplitudes determine volume adjusting information, and the volume of the terminal device is adjusted according to the volume adjusting information.
This programme improves volume adjusting efficiency, reduces the power consumption of terminal device.
Brief description of the drawings
By reading the detailed description made to non-limiting example made with reference to the following drawings, of the invention is other
Feature, objects and advantages will become more apparent upon:
Fig. 1 is a kind of flow chart of volume adjusting method provided in an embodiment of the present invention;
Fig. 2 is the flow chart of another volume adjusting method provided in an embodiment of the present invention;
Fig. 3 is the flow chart of another volume adjusting method provided in an embodiment of the present invention;
Fig. 4 is the flow chart of another volume adjusting method provided in an embodiment of the present invention;
Fig. 5 is the flow chart of another volume adjusting method provided in an embodiment of the present invention;
Fig. 6 is the flow chart of another volume adjusting method provided in an embodiment of the present invention;
Fig. 7 is a kind of structured flowchart of volume adjustment device provided in an embodiment of the present invention;
Fig. 8 is a kind of structural representation of terminal device provided in an embodiment of the present invention.
Embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used to explain the present invention, rather than limitation of the invention.It also should be noted that for the ease of retouching
State, part related to the present invention rather than entire infrastructure are illustrate only in accompanying drawing.
Fig. 1 is a kind of flow chart of volume adjusting method provided in an embodiment of the present invention, and the present embodiment was applicable to end
End equipment plays the volume situation about being adjusted during source of sound, this method can by terminal device provided in an embodiment of the present invention Lai
Perform, the volume adjustment device of the terminal device can be realized by the way of software and/or hardware, as shown in figure 1, the present embodiment
The concrete scheme of offer is as follows:
Step S101, when detecting that terminal device carries out source of sound broadcasting, the audio-frequency information of the source of sound is obtained.
Terminal device can carry out source of sound by the audio and video playing software that the third party application or system of installation carry
Broadcasting.Wherein, the steps such as acquisition, decoding and output of audio files are mainly included.Exemplary, the audio files got
It can be the multicast data flow received by network, can also be the audio-video document that terminal device is locally stored;Get the sound
It is loaded into after source file in core buffer;The audio files for being loaded into core buffer are decoded, opened in decoding
Before beginning, if the audio files include video data, it is necessary to carry out the separation of voice data and video data simultaneously, it will divide
Voice data from after is inputted to audio decoder, wherein, audio decoder is mainly used in reading the audio in core buffer
Data, digital audio and video signals are obtained, and the digital audio and video signals are converted into simulated audio signal, the broadcasting device of terminal device
Audio broadcasting is carried out according to the simulated audio signal.In one embodiment, when listening to source of sound broadcast event and being triggered, really
Determine terminal device and commence play out source of sound, wherein, the trigger event can be the broadcast button quilt shown in the touch-screen detected
Press, can also be when detecting the broadcasting device of terminal device for example loudspeaker commencing play out sound, determine that terminal device carries out sound
Source plays.
When detecting that terminal device carries out source of sound broadcasting, the audio-frequency information of the source of sound is obtained.In one embodiment,
The digital audio and video signals that can decode to obtain to audio decoder are sampled, and determine audio-frequency information corresponding to the source of sound.Another
In embodiment, the original document of currently playing source of sound can also be obtained, source of sound pair is determined by the parsing to the original document
The audio-frequency information answered.In another embodiment, by taking android system as an example, can pass through
Android.media.MediaRecorder classes or android.media.AudioRecord classes obtain the audio-frequency information of source of sound.
Step S102, according to the first audio amplitude corresponding to audio-frequency information determination, and the second audio amplitude is determined.
Amplitude refers to the ultimate range of deviation origin-location during object vibrations, the loudness and source of sound of the sound that human ear is heard
Amplitude it is related, amplitude is bigger, and loudness is stronger.In one embodiment, the audio-frequency information of acquisition can be entered by audio decoder
It is sampled after the digital audio and video signals that row decoding obtains, to obtain the amplitude information in preset time period T, wherein, the amplitude
Information can be made up of multiple amplitudes, can determine to play in preset time period T accordingly according to obtained multiple amplitudes
Source of sound amplitude curve, that is, determine with audio-frequency information corresponding to the first audio amplitude.In another embodiment, with
Exemplified by android system, can by android.media.MediaRecorder classes or
Android.media.AudioRecord classes carry out amplitude extraction to the audio-frequency information of acquisition, obtain corresponding first audio and shake
Width.In another embodiment, can be by original when the audio-frequency information that step S101 is got is original document corresponding to source of sound
Beginning file is parsed to obtain corresponding first audio amplitude.
In one embodiment, when detecting source of sound and playing, determined one time the every preset time (such as 1s, 3s or 10s)
One audio amplitude, or in real time, the amplitude of each frame of audio-frequency information is determined to obtain the first audio amplitude.Specifically
, the audio-frequency information for obtaining the source of sound includes:Obtain the audio frame information of the source of sound;Accordingly, according to the sound
First audio amplitude corresponding to the determination of frequency information includes:Shaking for each frame in audio-frequency information is determined according to the audio frame information
Width.Exemplary, when detecting that source of sound plays, audio files are parsed to obtain audio frame sequence, according to audio frame sequence
First audio amplitude corresponding to each frame determination of row.
Wherein, the second audio amplitude of the determination includes audio amplitude corresponding to other audio-frequency informations in terminal device.
In one possible embodiment, the second audio amplitude of the determination includes:The second source of sound for preparing to play in terminal device is obtained,
According to the second audio amplitude corresponding to second source of sound determination.Exemplary, currently playing source of sound is video 1, by right
Its audio-frequency information analyzed to obtain corresponding to the first audio amplitude, after video 1 terminal device play for video 2, should
Video 2 is other sources of sound in addition to video 1, and accordingly, audio amplitude corresponding to the video 2 determined is that the second audio is shaken
Width.Wherein, the determination mode of second audio amplitude can obtain the audio-frequency information of video 2, and the audio-frequency information is solved
Analysis obtains corresponding second audio amplitude.
In a possible embodiment, there is provided another kind determines the mode of the second audio amplitude, optionally, described
Before determining the second audio amplitude, in addition to:The audio amplitude of source of sound to being played in terminal device records, and generates source of sound
Amplitude record sheet;The second audio amplitude of the determination includes:The second audio amplitude is determined according to the source of sound amplitude record sheet.Show
Example property, when terminal device carries out source of sound broadcasting, the source of sound amplitude of the source of sound is recorded at any time, generates source of sound amplitude record sheet,
When it needs to be determined that during the second audio amplitude, the nearest one article of source of sound amplitude recorded in the source of sound amplitude record sheet can be defined as to
Two audio amplitudes.
Step S103, volume adjusting information, foundation are determined according to first audio amplitude and second audio amplitude
The volume of the terminal device is adjusted the volume adjusting information.
In one embodiment, the size according to the first audio amplitude and the second audio amplitude determine volume adjusting information with
The volume of terminal device is adjusted.Exemplary, when the first audio amplitude is smaller, and the second audio amplitude is larger, phase
The volume for the raising terminal device answered, when the first audio amplitude is larger, and the second audio amplitude is smaller, reduces terminal accordingly
The volume of equipment.Specifically, the first audio amplitude and the second audio amplitude determined can be being averaged for respective audio-frequency information
Amplitude, peak amplitude is can also be, it is exemplary, it is assumed that the size a for the first audio amplitude determined, the second audio amplitude are big
Small is 2a, then accordingly, the volume adjusting information determined according to the size of the first audio amplitude and the second audio amplitude is 0.5,
Half i.e. by the volume adjusting of present terminal equipment for original volume.Thus achieve when terminal device is playing different sounds
During source so that broadcast sound volume is consistent, the suddenly big or suddenly small phenomenon of sound caused by avoiding source of sound switching, meanwhile, avoid
The manual regulation of user, improves volume adjusting efficiency.
Fig. 2 is the flow chart of another volume adjusting method provided in an embodiment of the present invention, optionally, described in the foundation
First audio amplitude and second audio amplitude determine that volume adjusting information includes:According to first audio amplitude and described
The mean amplitude of tide difference of second audio amplitude determines volume adjusting information.As shown in Fig. 2 the technical scheme that the present embodiment provides is specific
It is as follows:
Step S201, when detecting that terminal device carries out source of sound broadcasting, the audio-frequency information of the source of sound is obtained.
Step S202, according to the first audio amplitude corresponding to audio-frequency information determination, and the second audio amplitude is determined.
Step S203, determine that volume is adjusted according to the mean amplitude of tide of first audio amplitude and second audio amplitude difference
Information is saved, the volume of the terminal device is adjusted according to the volume adjusting information.
Exemplary, the first audio amplitude and the second audio amplitude of preset length are obtained respectively, determine that the first audio is shaken
The mean amplitude of tide of width is b, and the mean amplitude of tide for determining the second audio amplitude is c, is b and mean amplitude of tide by mean amplitude of tide accordingly
It is (b-c)/b for the c volume adjusting information for determining to obtain, the volume of terminal device is adjusted according to the volume adjusting information
Agent, can be that the volume value of present terminal equipment is multiplied by into (b-c)/b to broadcast as the volume value progress source of sound after regulation optionally
Put.Thus achieve the source of sound played before the volume and terminal device of currently playing source of sound or prepare the sound played afterwards
The volume in source is consistent.
In another embodiment, it can also be and the first audio amplitude be adjusted the mistake of determination volume adjusting information
The mean amplitude of tide of Cheng Zhong, establishing criteria mean amplitude of tide and the first audio amplitude currently determined determines volume adjusting information, example
Property, the Standard Average Amplitude can be -15db to -20db.
Fig. 3 is the flow chart of another volume adjusting method provided in an embodiment of the present invention, optionally, described in the foundation
Volume adjusting information the volume of the terminal device is adjusted including:Increase information according to the volume or volume reduces letter
The size of first audio amplitude is adjusted amplitude adjustment factor in breath.As shown in Figure 3:
Step S301, when detecting that terminal device carries out source of sound broadcasting, the audio-frequency information of the source of sound is obtained.
Step S302, according to the first audio amplitude corresponding to audio-frequency information determination, and the second audio amplitude is determined.
Step S303, determine that volume is adjusted according to the mean amplitude of tide of first audio amplitude and second audio amplitude difference
Information is saved, the volume adjusting information includes volume increase information or volume reduces information.
Step S304, according to the amplitude adjustment factor in volume increase information or volume reduction information to described first
The size of audio amplitude is adjusted.
In one embodiment, the information that volume increase or volume reduce is corresponding amplitude adjustment factor.The amplitude
Adjustment factor is used to the amplitude of currently playing source of sound (the first audio amplitude) be adjusted.Optionally, when it is determined that amplitude is adjusted
After saving coefficient, the data of the sign amplitude information in obtained voice data can be carried out by being parsed to audio files
Modification, is packaged again after modification, and when being buffered to corresponding audio files and being played, the amplitude of source of sound is corresponding
It is increased or decreased;It is also possible that in the decoding process that source of sound plays, by analyzing obtained digital audio and video signals
Amplitude data is obtained, the amplitude data is multiplied by corresponding adjustment factor to change amplitude size, and then the volume of source of sound is entered
Row regulation.Hereby it is achieved that the size of source of sound volume is adjusted on the premise of not changing the original volume of terminal device system
Section, regulation process can play load or in buffering area before audio files are introduced into buffering area to reduce
Source of sound content is adjusted to improve regulation efficiency.It should be noted that can also be at the same to play source of sound amplitude and
The volume of present terminal equipment adjust simultaneously, further to improve regulating effect.
Fig. 4 is the flow chart of another volume adjusting method provided in an embodiment of the present invention, described to be adjusted according to the volume
Section information the volume of the terminal device is adjusted including:Increase information according to the volume or volume reduces in information
The volume of the terminal device is adjusted for target sound value or volume change value.As shown in figure 4, the skill that the present embodiment provides
Art scheme is specific as follows:
Step S401, when detecting that terminal device carries out source of sound broadcasting, the audio-frequency information of the source of sound is obtained.
Step S402, according to the first audio amplitude corresponding to audio-frequency information determination, and the second audio amplitude is determined.
Step S403, volume adjusting information is determined according to first audio amplitude and second audio amplitude, it is described
Volume adjusting information includes volume increase information or volume reduces information.
Step S404, the target sound value or volume change value in information or volume reduction information are increased according to the volume
The volume of the terminal device is adjusted.
In one embodiment, the information that volume increase or volume reduce is corresponding target sound value.Exemplary,
Terminal device is always divided into 18 grade-adjustables, the corresponding volume value of each grade, the volume down to max volume by Jing Yin
Target sound value corresponding to small information can be 3 or 4, and target sound value corresponding to volume increase information can be 14 or 15,
When the type for the source of sound determined be need increase volume source of sound type, then volume value is increased into 14 or 15 accordingly, when
The type for the source of sound determined is the source of sound type for needing to reduce volume, then volume value is decreased into 3 or 4 accordingly.Optionally,
Before volume adjusting is carried out using the desired value of the volume, in addition to:The reproduction time of the source of sound type is determined, when playing
Between when being more than preset time, reduce using volume increase information or volume according to as described in the target sound value in information if 30s
The mode that the volume value current to the terminal device is adjusted, thus further increases volume adjusting efficiency, reduces
The energy consumption of terminal device.
In one embodiment, the information that volume increase or volume reduce is corresponding volume change value.Exemplary,
Terminal device is always divided into 18 grade-adjustables, the corresponding volume value of each grade, volume increasing to max volume by Jing Yin
It is 3 that big information and volume, which reduce volume change value corresponding to information, for example, the volume value of present terminal equipment is 10, works as needs
When increasing information volume, then increase by 3 carries out sound broadcasting using the 13rd grade of volume on the basis of current volume value, works as needs
When reducing information volume, then reduce 3 on the basis of current volume value and sound broadcasting is carried out using the 7th grade of volume.Optionally,
Before volume adjusting is carried out using the volume change value, in addition to:The reproduction time of the source of sound type is determined, works as reproduction time
During more than preset time, using the volume increase information according to as described in or the volume change value pair in volume reduction information if 30s
The mode that the current volume value of the terminal device is adjusted, thus further increases volume adjusting efficiency, reduces end
The energy consumption of end equipment.
Fig. 5 is the flow chart of another volume adjusting method provided in an embodiment of the present invention, optionally, described according to institute
State before the volume of the terminal device is adjusted volume adjusting information, in addition to:Determine that terminal device plays device
Impedance value, the volume adjusting information is modified according to the impedance value, according to revised volume adjusting information to institute
The volume for stating terminal device is adjusted.As shown in figure 5, the technical scheme that the present embodiment provides is specific as follows:
Step S501, when detecting that terminal device carries out source of sound broadcasting, the audio-frequency information of the source of sound is obtained.
Step S502, according to the first audio amplitude corresponding to audio-frequency information determination, and the second audio amplitude is determined.
Step S503, volume adjusting information is determined according to first audio amplitude and second audio amplitude.
Step S504, determine that terminal device plays the impedance value of device, the volume adjusting is believed according to the impedance value
Breath is modified, and the volume of the terminal device is adjusted according to revised volume adjusting information.
In one embodiment, can be by the broadcasting device installed in power amplifier chips detection terminal equipment (such as:Loudspeaker)
Impedance value, can also be by physics mode detect play device impedance.Exemplary, the impedance value is bigger corresponding right
The amendment of volume adjusting information is bigger.Specifically, the nominal impedance value for assuming to play device is x, by detecting obtained impedance
It is worth for 1.2x, then accordingly on the basis of the volume adjusting information determined, by corresponding target in the volume adjusting information
Volume value or volume change value are multiplied by 1.2 and are used as revised volume adjusting information.
From the foregoing, during the amplitude of source of sound is adjusted, the impedance value for playing device is introduced as determination
One of parameter of volume adjusting information, avoid and play device with the increase impedance value more and more higher of playing duration and then to normal
The problem of volume in playing process has an impact so that the volume after regulation more preferably meets user's request, enters one
Step improves volume adjusting effect.
Fig. 6 is the flow chart of another volume adjusting method provided in an embodiment of the present invention, optionally, described according to institute
State before the volume of the terminal device is adjusted volume adjusting information, in addition to:Determine terminal device local environment
Noise figure, the volume adjusting information is modified according to the noise figure, according to revised volume adjusting information to institute
The volume for stating terminal device is adjusted.As shown in fig. 6, the technical scheme that the present embodiment provides is specific as follows:
Step S601, when detecting that terminal device carries out source of sound broadcasting, the audio-frequency information of the source of sound is obtained.
Step S602, according to the first audio amplitude corresponding to audio-frequency information determination, and the second audio amplitude is determined.
Step S603, volume adjusting information is determined according to first audio amplitude and second audio amplitude.
Step S604, the noise figure of terminal device local environment is determined, the volume adjusting is believed according to the noise figure
Breath is modified, and the volume of the terminal device is adjusted according to revised volume adjusting information.
In one embodiment, the noise of environment can be presently in by the collection of the microphone of installing terminal equipment to determine
Corresponding noise figure.Exemplary, the noise figure is bigger, and the corresponding amendment to volume adjusting information is bigger.Specifically, assume
Noise figure of the terminal device under quiet environment is y, when terminal device is in outdoor or noisy environment, it is determined that noise figure be
1.5y, then accordingly on the basis of the volume adjusting information determined, by the target sound value in the volume adjusting information or
Volume change value is multiplied by 1.5 and is used as revised volume adjusting information.It should be noted that can also be common by impedance value, noise figure
With amendment volume adjusting information.
From the foregoing, during the amplitude of source of sound is adjusted, it is contemplated that shadow of the noise to terminal device volume
Ring, using the noise figure of determination as one of parameter for determining volume adjusting information so that the volume after regulation more conforms to
User's request, further increase volume adjusting effect.
Fig. 7 is a kind of structured flowchart of volume adjustment device provided in an embodiment of the present invention, and the device is above-mentioned for performing
The volume adjusting method that embodiment provides, possesses the corresponding functional module of execution method and beneficial effect.As shown in fig. 7, the dress
Put and specifically include:Acquisition module 101, amplitude determination module 102, regulation information determination module 103 and adjustment module 104.
Wherein, acquisition module 101, for when detecting that terminal device carries out source of sound broadcasting, obtaining the sound of the source of sound
Frequency information.
Terminal device can carry out source of sound by the audio and video playing software that the third party application or system of installation carry
Broadcasting.Wherein, the steps such as acquisition, decoding and output of audio files are mainly included.Exemplary, the audio files got
It can be the multicast data flow received by network, can also be the audio-video document that terminal device is locally stored;Get the sound
It is loaded into after source file in core buffer;The audio files for being loaded into core buffer are decoded, opened in decoding
Before beginning, if the audio files include video data, it is necessary to carry out the separation of voice data and video data simultaneously, it will divide
Voice data from after is inputted to audio decoder, wherein, audio decoder is mainly used in reading the audio in core buffer
Data, digital audio and video signals are obtained, and the digital audio and video signals are converted into simulated audio signal, the broadcasting device of terminal device
Audio broadcasting is carried out according to the simulated audio signal.In one embodiment, when listening to source of sound broadcast event and being triggered, really
Determine terminal device and commence play out source of sound, wherein, the trigger event can be the broadcast button quilt shown in the touch-screen detected
Press, can also be when detecting the broadcasting device of terminal device for example loudspeaker commencing play out sound, determine that terminal device carries out sound
Source plays.
When detecting that terminal device carries out source of sound broadcasting, the audio-frequency information of the source of sound is obtained.In one embodiment,
The digital audio and video signals that can decode to obtain to audio decoder are sampled, and determine audio-frequency information corresponding to the source of sound.Another
In embodiment, the original document of currently playing source of sound can also be obtained, source of sound pair is determined by the parsing to the original document
The audio-frequency information answered.In another embodiment, by taking android system as an example, can pass through
Android.media.MediaRecorder classes or android.media.AudioRecord classes obtain the audio-frequency information of source of sound.
Amplitude determination module 102, for the first audio amplitude corresponding to being determined according to the audio-frequency information and determine the
Two audio amplitudes, second audio amplitude include audio amplitude corresponding to other audio-frequency informations in terminal device.
Amplitude refers to the ultimate range of deviation origin-location during object vibrations, the loudness and source of sound of the sound that human ear is heard
Amplitude it is related, amplitude is bigger, and loudness is stronger.In one embodiment, the audio-frequency information of acquisition can be entered by audio decoder
It is sampled after the digital audio and video signals that row decoding obtains, to obtain the amplitude information in preset time period T, wherein, the amplitude
Information can be made up of multiple amplitudes, can determine to play in preset time period T accordingly according to obtained multiple amplitudes
Source of sound amplitude curve, that is, determine with audio-frequency information corresponding to the first audio amplitude.In another embodiment, with
Exemplified by android system, can by android.media.MediaRecorder classes or
Android.media.AudioRecord classes carry out amplitude extraction to the audio-frequency information of acquisition, obtain corresponding first audio and shake
Width.In another embodiment, can be by original when the audio-frequency information that step S101 is got is original document corresponding to source of sound
Beginning file is parsed to obtain corresponding first audio amplitude.
In one embodiment, when detecting source of sound and playing, determined one time the every preset time (such as 1s, 3s or 10s)
One audio amplitude, or in real time, the amplitude of each frame of audio-frequency information is determined to obtain the first audio amplitude.Specifically
, the audio-frequency information for obtaining the source of sound includes:Obtain the audio frame information of the source of sound;Accordingly, according to the sound
First audio amplitude corresponding to the determination of frequency information includes:Shaking for each frame in audio-frequency information is determined according to the audio frame information
Width.Exemplary, when detecting that source of sound plays, audio files are parsed to obtain audio frame sequence, according to audio frame sequence
First audio amplitude corresponding to each frame determination of row.
Wherein, the second audio amplitude of the determination includes audio amplitude corresponding to other audio-frequency informations in terminal device.
In one possible embodiment, the second audio amplitude of the determination includes:The second source of sound for preparing to play in terminal device is obtained,
According to the second audio amplitude corresponding to second source of sound determination.Exemplary, currently playing source of sound is video 1, by right
Its audio-frequency information analyzed to obtain corresponding to the first audio amplitude, after video 1 terminal device play for video 2, should
Video 2 is other sources of sound in addition to video 1, and accordingly, audio amplitude corresponding to the video 2 determined is that the second audio is shaken
Width.Wherein, the determination mode of second audio amplitude can obtain the audio-frequency information of video 2, and the audio-frequency information is solved
Analysis obtains corresponding second audio amplitude.
In a possible embodiment, there is provided another kind determines the mode of the second audio amplitude, optionally, described
Before determining the second audio amplitude, in addition to:The audio amplitude of source of sound to being played in terminal device records, and generates source of sound
Amplitude record sheet;The second audio amplitude of the determination includes:The second audio amplitude is determined according to the source of sound amplitude record sheet.Show
Example property, when terminal device carries out source of sound broadcasting, the source of sound amplitude of the source of sound is recorded at any time, generates source of sound amplitude record sheet,
When it needs to be determined that during the second audio amplitude, the nearest one article of source of sound amplitude recorded in the source of sound amplitude record sheet can be defined as to
Two audio amplitudes.
Information determination module 103 is adjusted, for determining sound according to first audio amplitude and second audio amplitude
Amount regulation information.
In one embodiment, the size according to the first audio amplitude and the second audio amplitude determine volume adjusting information with
The volume of terminal device is adjusted.Exemplary, when the first audio amplitude is smaller, and the second audio amplitude is larger, phase
The volume for the raising terminal device answered, when the first audio amplitude is larger, and the second audio amplitude is smaller, reduces terminal accordingly
The volume of equipment.Specifically, the first audio amplitude and the second audio amplitude determined can be being averaged for respective audio-frequency information
Amplitude, peak amplitude is can also be, it is exemplary, it is assumed that the size a for the first audio amplitude determined, the second audio amplitude are big
Small is 2a, then accordingly, the volume adjusting information determined according to the size of the first audio amplitude and the second audio amplitude is 0.5,
Half i.e. by the volume adjusting of present terminal equipment for original volume.Thus achieve when terminal device is playing different sounds
During source so that broadcast sound volume is consistent, the suddenly big or suddenly small phenomenon of sound caused by avoiding source of sound switching, meanwhile, avoid
The manual regulation of user, improves volume adjusting efficiency.
Adjustment module 104, for the volume of the terminal device to be adjusted according to the volume adjusting information.
When detecting that terminal device carries out source of sound broadcasting, the audio-frequency information of the source of sound is obtained, is believed according to the audio
First audio amplitude corresponding to breath determination, determines the second audio amplitude, and second audio amplitude includes other in terminal device
Audio amplitude corresponding to audio-frequency information, determine that volume adjusting is believed according to first audio amplitude and second audio amplitude
Breath, the volume of the terminal device is adjusted according to the volume adjusting information.This programme improves volume adjusting efficiency,
Reduce the power consumption of terminal device.
In a possible embodiment, the amplitude determination module 102 is specifically used for:
The second source of sound for preparing to play in terminal device is obtained, is shaken according to the second audio corresponding to second source of sound determination
Width.
In a possible embodiment, the amplitude determination module 102 is specifically used for:
Before the second audio amplitude of the determination, the audio amplitude of the source of sound to being played in terminal device records,
Generate source of sound amplitude record sheet;
The second audio amplitude is determined according to the source of sound amplitude record sheet.
In a possible embodiment, the regulation information determination module 103 is specifically used for:
Volume adjusting information, institute are determined according to the mean amplitude of tide of first audio amplitude and second audio amplitude difference
Stating volume adjusting information includes volume increase information or volume reduction information.
In a possible embodiment, the adjustment module 104 is specifically used for:
According to the amplitude adjustment factor in volume increase information or volume reduction information to first audio amplitude
Size be adjusted.
In a possible embodiment, the adjustment module 104 is specifically used for:
According to the target sound value in volume increase information or volume reduction information or volume change value to the end
The volume of end equipment is adjusted.
In a possible embodiment, the regulation information determination module 103 is additionally operable to:
It is described the volume of the terminal device is adjusted according to the volume adjusting information before, determine that terminal is set
The noise figure of the standby impedance value or local environment for playing device, according to the impedance value or the noise figure to the volume adjusting
Information is modified, and the volume of the terminal device is adjusted according to revised volume adjusting information.
The present embodiment provides a kind of terminal device on the basis of the various embodiments described above, and Fig. 8 is that the embodiment of the present invention carries
The structural representation of a kind of terminal device supplied, as shown in figure 8, the terminal device 200 includes:Memory 201, processor
(Central Processing Unit, CPU) 202, Peripheral Interface 203, RF (Radio Frequency, radio frequency) circuit 205,
Voicefrequency circuit 206, loudspeaker 211, power management chip 208, input/output (I/O) subsystem 209, touch-screen 212, other
Input/control devices 210 and outside port 204, these parts are led to by one or more communication bus or signal wire 207
Letter.
It should be understood that graphic terminal 200 is only an example of terminal device, and terminal device 200
Can have than more or less parts shown in figure, can combine two or more parts, or can be with
Configured with different parts.Various parts shown in figure can be including one or more signal transactings and/or special
Hardware, software including integrated circuit are realized in the combination of hardware and software.
The terminal device for being used to open the rights management of application more that the present embodiment provides is described in detail below, should
Terminal device is by taking smart mobile phone as an example.
Memory 201, the memory 201 can be accessed by CPU202, Peripheral Interface 203 etc., and the memory 201 can
Including high-speed random access memory, can also include nonvolatile memory, such as one or more disk memories,
Flush memory device or other volatile solid-state parts.
The input of equipment and output peripheral hardware can be connected to CPU202 and deposited by Peripheral Interface 203, the Peripheral Interface 203
Reservoir 201.
I/O subsystems 209, the I/O subsystems 209 can be by the input/output peripherals in equipment, such as touch-screen 212
With other input/control devicess 210, Peripheral Interface 203 is connected to.I/O subsystems 209 can include the He of display controller 2091
For controlling one or more input controllers 2092 of other input/control devicess 210.Wherein, one or more input controls
Device 2092 processed receives electric signal from other input/control devicess 210 or sends electric signal to other input/control devicess 210,
Other input/control devicess 210 can include physical button (pressing button, rocker buttons etc.), dial, slide switch, behaviour
Vertical pole, click on roller.What deserves to be explained is input controller 2092 can with it is following any one be connected:Keyboard, infrared port,
The instruction equipment of USB interface and such as mouse.
Touch-screen 212, the touch-screen 212 are the input interface and output interface between user terminal and user, can
It can include figure, text, icon, video etc. to user, visual output depending on output display.
Display controller 2091 in I/O subsystems 209 receives electric signal from touch-screen 212 or sent out to touch-screen 212
Electric signals.Touch-screen 212 detects the contact on touch-screen, and the contact detected is converted to and shown by display controller 2091
The interaction of user interface object on touch-screen 212, that is, realize man-machine interaction, the user interface being shown on touch-screen 212
Icon that object can be the icon of running game, be networked to corresponding network etc..What deserves to be explained is equipment can also include light
Mouse, light mouse is not show the touch sensitive surface visually exported, or the extension of the touch sensitive surface formed by touch-screen.
RF circuits 205, it is mainly used in establishing the communication of mobile phone and wireless network (i.e. network side), realizes mobile phone and wireless network
The data receiver of network and transmission.Such as transmitting-receiving short message, Email etc..Specifically, RF circuits 205 receive and send RF letters
Number, RF signals are also referred to as electromagnetic signal, and RF circuits 205 convert electrical signals to electromagnetic signal or electromagnetic signal is converted into telecommunications
Number, and communicated by the electromagnetic signal with communication network and other equipment.RF circuits 205 can include being used to perform
The known circuit of these functions, it includes but is not limited to antenna system, RF transceivers, one or more amplifiers, tuner, one
Individual or multiple oscillators, digital signal processor, CODEC (COder-DECoder, coder) chipset, user identify mould
Block (Subscriber Identity Module, SIM) etc..
Voicefrequency circuit 206, it is mainly used in receiving voice data from Peripheral Interface 203, the voice data is converted into telecommunications
Number, and the electric signal is sent to loudspeaker 211.
Loudspeaker 211, for the voice signal for receiving mobile phone from wireless network by RF circuits 205, it is reduced to sound
And play the sound to user.
Power management chip 208, the hardware for being connected by CPU202, I/O subsystem and Peripheral Interface are powered
And power management.
The executable present invention of the volume adjustment device and terminal device of the terminal device provided in above-described embodiment is any real
The volume adjusting method for the terminal device that example is provided is applied, possesses and performs the corresponding functional module of this method and beneficial effect.Not
The ins and outs of detailed description in the above-described embodiments, reference can be made to the volume for the terminal device that any embodiment of the present invention is provided
Adjusting method.
The embodiment of the present invention also provides a kind of storage medium for including terminal device executable instruction, and the terminal device can
Execute instruction is used to perform a kind of volume adjusting method when by terminal device computing device, and this method includes:
When detecting that terminal device carries out source of sound broadcasting, the audio-frequency information of the source of sound is obtained;
According to the first audio amplitude corresponding to audio-frequency information determination;
The second audio amplitude is determined, second audio amplitude includes audio corresponding to other audio-frequency informations in terminal device
Amplitude;
Volume adjusting information is determined according to first audio amplitude and second audio amplitude, is adjusted according to the volume
The volume of the terminal device is adjusted section information.
In a possible embodiment, the second audio amplitude of the determination includes:
The second source of sound for preparing to play in terminal device is obtained, is shaken according to the second audio corresponding to second source of sound determination
Width.
In a possible embodiment, before the second audio amplitude of the determination, in addition to:
The audio amplitude of source of sound to being played in terminal device records, and generates source of sound amplitude record sheet;
The second audio amplitude of the determination includes:
The second audio amplitude is determined according to the source of sound amplitude record sheet.
In a possible embodiment, it is described to determine sound according to first audio amplitude and second audio amplitude
Amount regulation information includes:
Volume adjusting information, institute are determined according to the mean amplitude of tide of first audio amplitude and second audio amplitude difference
Stating volume adjusting information includes volume increase information or volume reduction information.
In a possible embodiment, it is described that the volume of the terminal device is carried out according to the volume adjusting information
Regulation includes:
According to the amplitude adjustment factor in volume increase information or volume reduction information to first audio amplitude
Size be adjusted.
In a possible embodiment, it is described that the volume of the terminal device is carried out according to the volume adjusting information
Regulation includes:
According to the target sound value in volume increase information or volume reduction information or volume change value to the end
The volume of end equipment is adjusted.
In a possible embodiment, the volume of the terminal device is entered according to the volume adjusting information described
Before row regulation, in addition to:
Determine that terminal device plays the impedance value of device or the noise figure of local environment, according to the impedance value or described make an uproar
Sound value is modified to the volume adjusting information, and the volume of the terminal device is entered according to revised volume adjusting information
Row regulation.
Storage medium --- any various types of memory devices or storage device.Term " storage medium " is intended to wrap
Include:Install medium, such as CD-ROM, floppy disk or magnetic tape equipment;Computer system memory or random access memory, such as
DRAM, DDR RAM, SRAM, EDO RAM, blue Bath (Rambus) RAM etc.;Nonvolatile memory, such as flash memory, magnetizing mediums
(such as hard disk or optical storage);Memory component of register or other similar types etc..Storage medium can also include other
The memory of type or its combination.In addition, storage medium can be located at program in the first computer system being wherein performed,
Or can be located in different second computer systems, second computer system is connected to the by network (such as internet)
One computer system.Second computer system can provide programmed instruction and be used to perform to the first computer." storage is situated between term
Matter " can include may reside within diverse location two of (such as in different computer systems by network connection) or
More storage mediums.Storage medium can store the programmed instruction that can be performed by one or more processors and (such as implement
For computer program).
Certainly, a kind of storage medium for including computer executable instructions that the embodiment of the present invention is provided, its computer
The volume adjusting method operation that executable instruction is not limited to the described above, can also carry out what any embodiment of the present invention was provided
Associative operation in volume adjusting method.
Pay attention to, 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 invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art various obvious changes,
Readjust and substitute without departing from protection scope of the present invention.Therefore, although being carried out by above example to the present invention
It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also
Other more equivalent embodiments can be included, and the scope of the present invention is determined by scope of the appended claims.
Claims (10)
- A kind of 1. volume adjusting method, it is characterised in that including:When detecting that terminal device carries out source of sound broadcasting, the audio-frequency information of the source of sound is obtained;According to the first audio amplitude corresponding to audio-frequency information determination;The second audio amplitude is determined, second audio amplitude includes audio corresponding to other audio-frequency informations in terminal device and shaken Width;Volume adjusting information is determined according to first audio amplitude and second audio amplitude, is believed according to the volume adjusting Cease and the volume of the terminal device is adjusted.
- 2. according to the method for claim 1, it is characterised in that the second audio amplitude of the determination includes:The second source of sound for preparing to play in terminal device is obtained, according to the second audio amplitude corresponding to second source of sound determination.
- 3. according to the method for claim 1, it is characterised in that before the second audio amplitude of the determination, in addition to:The audio amplitude of source of sound to being played in terminal device records, and generates source of sound amplitude record sheet;The second audio amplitude of the determination includes:The second audio amplitude is determined according to the source of sound amplitude record sheet.
- 4. according to the method in claim 2 or 3, it is characterised in that described according to first audio amplitude and described Two audio amplitudes determine that volume adjusting information includes:Volume adjusting information, the sound are determined according to the mean amplitude of tide of first audio amplitude and second audio amplitude difference Amount regulation information includes volume increase information or volume reduces information.
- 5. according to the method for claim 4, it is characterised in that described that the terminal is set according to the volume adjusting information Standby volume be adjusted including:According to the amplitude adjustment factor in volume increase information or volume reduction information to the big of first audio amplitude It is small to be adjusted.
- 6. according to the method for claim 4, it is characterised in that described that the terminal is set according to the volume adjusting information Standby volume be adjusted including:The terminal is set according to the target sound value in volume increase information or volume reduction information or volume change value Standby volume is adjusted.
- 7. according to the method any one of claim 1-3, it is characterised in that described according to the volume adjusting information Before the volume of the terminal device is adjusted, in addition to:Determine that terminal device plays the impedance value of device or the noise figure of local environment, according to the impedance value or the noise figure The volume adjusting information is modified, the volume of the terminal device adjusted according to revised volume adjusting information Section.
- A kind of 8. volume adjustment device, it is characterised in that including:Acquisition module, for when detecting that terminal device carries out source of sound broadcasting, obtaining the audio-frequency information of the source of sound;Amplitude determination module, for being shaken according to the first audio amplitude corresponding to audio-frequency information determination and the second audio of determination Width, second audio amplitude include audio amplitude corresponding to other audio-frequency informations in terminal device;Information determination module is adjusted, for determining that volume adjusting is believed according to first audio amplitude and second audio amplitude Breath;Adjustment module, for the volume of the terminal device to be adjusted according to the volume adjusting information.
- 9. a kind of terminal device, including:Processor, memory and storage are on a memory and the meter that can run on a processor Calculation machine program, it is characterised in that realized described in the computing device during computer program such as any one of claim 1-7 institutes The volume adjusting method stated.
- A kind of 10. storage medium for including terminal device executable instruction, it is characterised in that the terminal device executable instruction As volume adjusting method during terminal device computing device for execution as any one of claim 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710711659.1A CN107506170A (en) | 2017-08-18 | 2017-08-18 | volume adjusting method, device, terminal device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710711659.1A CN107506170A (en) | 2017-08-18 | 2017-08-18 | volume adjusting method, device, terminal device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107506170A true CN107506170A (en) | 2017-12-22 |
Family
ID=60691352
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710711659.1A Pending CN107506170A (en) | 2017-08-18 | 2017-08-18 | volume adjusting method, device, terminal device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107506170A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111918174A (en) * | 2019-05-08 | 2020-11-10 | 阿里巴巴集团控股有限公司 | Method and device for balancing volume gain, electronic device and vehicle |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1549243A (en) * | 2003-05-20 | 2004-11-24 | 联发科技股份有限公司 | Music file wave form regulating system |
CN102693737A (en) * | 2012-06-11 | 2012-09-26 | 华为终端有限公司 | Volume adjusting method and device |
CN102999492A (en) * | 2011-09-08 | 2013-03-27 | 百度在线网络技术(北京)有限公司 | Method and device for adjusting volume of media file |
CN104978166A (en) * | 2015-06-30 | 2015-10-14 | 北京奇艺世纪科技有限公司 | Volume adjusting method and device |
US20160078879A1 (en) * | 2013-03-26 | 2016-03-17 | Dolby Laboratories Licensing Corporation | Apparatuses and Methods for Audio Classifying and Processing |
CN106293606A (en) * | 2016-08-16 | 2017-01-04 | 微鲸科技有限公司 | Sound-volume control system and method for controlling volume |
-
2017
- 2017-08-18 CN CN201710711659.1A patent/CN107506170A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1549243A (en) * | 2003-05-20 | 2004-11-24 | 联发科技股份有限公司 | Music file wave form regulating system |
CN102999492A (en) * | 2011-09-08 | 2013-03-27 | 百度在线网络技术(北京)有限公司 | Method and device for adjusting volume of media file |
CN102693737A (en) * | 2012-06-11 | 2012-09-26 | 华为终端有限公司 | Volume adjusting method and device |
US20160078879A1 (en) * | 2013-03-26 | 2016-03-17 | Dolby Laboratories Licensing Corporation | Apparatuses and Methods for Audio Classifying and Processing |
CN104978166A (en) * | 2015-06-30 | 2015-10-14 | 北京奇艺世纪科技有限公司 | Volume adjusting method and device |
CN106293606A (en) * | 2016-08-16 | 2017-01-04 | 微鲸科技有限公司 | Sound-volume control system and method for controlling volume |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111918174A (en) * | 2019-05-08 | 2020-11-10 | 阿里巴巴集团控股有限公司 | Method and device for balancing volume gain, electronic device and vehicle |
CN111918174B (en) * | 2019-05-08 | 2022-04-01 | 阿里巴巴集团控股有限公司 | Method and device for balancing volume gain, electronic device and vehicle |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107526568A (en) | volume adjusting method, device, terminal device and storage medium | |
CN107465824A (en) | volume adjusting method, device, mobile terminal and storage medium | |
CN107526570A (en) | volume adjusting method, device, terminal device and storage medium | |
CN107436751A (en) | volume adjusting method, device, terminal device and storage medium | |
US11201598B2 (en) | Volume adjusting method and mobile terminal | |
CN110799936B (en) | Volume adjusting method, volume adjusting device, terminal equipment and storage medium | |
CN107566618A (en) | volume adjusting method, device, terminal device and storage medium | |
CN107040660A (en) | Control method, device and the mobile terminal of mobile terminal playing volume | |
CN107483734A (en) | volume adjusting method, device, terminal device and storage medium | |
CN107479852B (en) | Volume adjusting method, device, terminal device and storage medium | |
CN106713653A (en) | Audio/video playing control method and device, and terminal | |
CN107799113A (en) | Audio-frequency processing method, device, storage medium and mobile terminal | |
CN110876180A (en) | Power consumption processing method and device, electronic equipment and computer readable medium | |
CN103456334B (en) | Audio file play method and playing device | |
CN107506168A (en) | volume adjusting method, device, terminal device and storage medium | |
CN107508983A (en) | volume adjusting method, device, storage medium and terminal device | |
CN107479851B (en) | Volume adjusting method, device, terminal device and storage medium | |
CN107506170A (en) | volume adjusting method, device, terminal device and storage medium | |
CN107506169A (en) | volume adjusting method, device, terminal device and storage medium | |
WO2019033439A1 (en) | Volume adjustment method, apparatus, storage medium, and mobile terminal | |
WO2019033435A1 (en) | Sound volume adjustment method and apparatus, mobile terminal, and storage medium | |
WO2019033434A1 (en) | Volume control method and apparatus, storage medium, and mobile terminal | |
CN110753919B (en) | Volume adjusting method and device, storage medium and mobile terminal |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171222 |