CN106980486B - Method for controlling volume and device - Google Patents
Method for controlling volume and device Download PDFInfo
- Publication number
- CN106980486B CN106980486B CN201710179766.4A CN201710179766A CN106980486B CN 106980486 B CN106980486 B CN 106980486B CN 201710179766 A CN201710179766 A CN 201710179766A CN 106980486 B CN106980486 B CN 106980486B
- Authority
- CN
- China
- Prior art keywords
- terminal
- front side
- acoustic signals
- testee
- distance
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
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)
- Telephone Function (AREA)
Abstract
The disclosure is directed to a kind of method for controlling volume and devices, belong to field of terminal technology.The described method includes: when sound is currently played in terminal and terminal front side is in unobstructed state, emit multiple first acoustic signals along terminal front side outwardly direction, since second acoustic wave signal is the signal that first acoustic signals reach testee back reflection, therefore it can pass through the emission parameter of the first acoustic signals and the distance between the reception parameter detecting terminal of second acoustic wave signal and testee, and according to the distance between terminal and testee, the volume for the sound being currently played is adjusted, the realization of volume control option is triggered to the volume control of currently playing sound by predetermined registration operation without user, to simplify the operation of user, improve the efficiency that terminal carries out volume control.
Description
Technical field
This disclosure relates to field of terminal technology more particularly to a kind of method for controlling volume and device.
Background technique
With the development of terminal technology, the terminals such as mobile phone, tablet computer can provide colourful answer not only for user
With, such as wechat, Alipay and drop drop call a taxi, can also be according to the corresponding operation of instruction execution of user, such as according to user
Instruction execution booting, the operation such as shutdown or volume control.
In the related technology, volume control option is generally included in the terminal, when terminal detects that user passes through predetermined registration operation
When triggering the volume control option, the corresponding operation of volume control option is executed.If volume control option includes increasing volume
Option, reduction volume option and mute option etc. execute increase when terminal detects that user clicks the increase volume option
The operation of currently playing sound executes the behaviour for closing currently playing sound when terminal detects that user clicks the mute option
Make.
Summary of the invention
To overcome the problems in correlation technique, present disclose provides a kind of method for controlling volume and devices.The skill
Art scheme is as follows:
According to the first aspect of the embodiments of the present disclosure, a kind of method for controlling volume is provided, which comprises
When sound is currently played in the terminal, judge whether the terminal front side is in unobstructed state;
When the terminal front side is in unobstructed state, emit multiple first sound along the terminal front side outwardly direction
Wave signal;
For the first acoustic signals of each of the multiple first acoustic signals, when receiving first acoustic signals
When reaching the second acoustic wave signal of testee back reflection, emission parameter and the rising tone based on first acoustic signals
The reception parameter of wave signal, determines the distance between the terminal front side and the testee, to obtain described at least one
The distance between terminal front side and the testee;
According to the distance between at least one described described terminal front side and described testee, to what is be currently played
The volume of sound is adjusted.
Optionally, the emission parameter of first acoustic signals includes amplitude when first acoustic signals are launched;
The reception parameter of the second acoustic wave signal includes the amplitude when second acoustic wave signal is received;It is described to be based on described first
The reception parameter of the emission parameter of acoustic signals and the second acoustic wave signal, determines the terminal front side and the testee
The distance between, comprising:
Calculate amplitude when first acoustic signals are launched and the amplitude when second acoustic wave signal is received it
Between amplitude difference;
Obtain the attenuation coefficient of amplitude in propagation process of sound wave;
Based on the amplitude difference and the attenuation coefficient, determine between the terminal front side and the testee away from
From.
Optionally, when the emission parameter of first acoustic signals includes transmitting when first acoustic signals are launched
Between point;The reception parameter of the second acoustic wave signal includes the receiving time point when second acoustic wave signal is received;It is described
The reception parameter of emission parameter and the second acoustic wave signal based on first acoustic signals, determine the terminal front side with
The distance between described testee, comprising:
It calculates when launch time point and the second acoustic wave signal when first acoustic signals are launched are received
Time difference between receiving time point;
Obtain the spread speed of sound wave;
Based on the time difference and the spread speed, determine between the terminal front side and the testee away from
From.
Optionally, described the distance between at least one described terminal front side and the testee according to, to working as
The volume of preceding sound being played on is adjusted, comprising:
It is chosen from the distance between at least one described described terminal front side and the testee and is less than pre-determined distance
Distance;
Determine the difference between the maximum distance and minimum range in the distance chosen;
When determining difference is greater than preset difference value, reduce the volume for the sound being currently played;
When determining difference is not more than the preset difference value, zero is set by the volume for the sound being currently played.
It is optionally, described to emit multiple first acoustic signals along the terminal front side outwardly direction, comprising:
By the wave sounder part of the terminal, emit multiple first sound wave letters along the terminal front side outwardly direction
Number;
The second acoustic wave signal for receiving first acoustic signals and reaching testee back reflection, comprising:
By the acoustic receiver device of the terminal, first acoustic signals reach testee back reflection the is received
Two acoustic signals.
Optionally, the wave sounder part is the earpiece at the top of the terminal, and the acoustic receiver device is the end
Hold the noise reduction microphone at top.
Optionally, described when the terminal front side is in unobstructed state, it is sent out along the terminal front side outwardly direction
It penetrates before multiple first acoustic signals, further includes:
Judge whether the terminal is in horizontality;
When the terminal is in horizontality and the terminal front side is in unobstructed state, execute described along the end
Rectify the step of direction faced out emits multiple first acoustic signals.
According to the second aspect of an embodiment of the present disclosure, a kind of sound volume control device is provided, described device includes:
First judgment module, for judging whether the terminal front side is located when sound is currently played in the terminal
In unobstructed state;
Transmitting module is used for when the terminal front side is in unobstructed state, along the terminal front side outwardly direction
Emit multiple first acoustic signals;
Determining module, for for the first acoustic signals of each of the multiple first acoustic signals, when receiving
When stating the second acoustic wave signal of the first acoustic signals arrival testee back reflection, the transmitting ginseng based on first acoustic signals
Several and the second acoustic wave signal reception parameter, determines the distance between the terminal front side and the testee, with
To the distance between terminal front side described at least one and the testee;
Module is adjusted, it is right for the distance between at least one described terminal front side and the testee according to
The volume for the sound being currently played is adjusted.
Optionally, the emission parameter of first acoustic signals includes amplitude when first acoustic signals are launched;
The reception parameter of the second acoustic wave signal includes the amplitude when second acoustic wave signal is received;The determining module packet
It includes:
First computational submodule, for calculating amplitude and second sound wave letter when first acoustic signals are launched
The amplitude difference between amplitude when number being received;
First acquisition submodule, for obtaining the attenuation coefficient of amplitude in propagation process of sound wave;
First determine submodule, for be based on the amplitude difference and the attenuation coefficient, determine the terminal front side with
The distance between described testee.
Optionally, when the emission parameter of first acoustic signals includes transmitting when first acoustic signals are launched
Between point;The reception parameter of the second acoustic wave signal includes the receiving time point when second acoustic wave signal is received;It is described
Determining module includes:
Second computational submodule, for calculating the launch time point and described second when first acoustic signals are launched
The time difference between receiving time point when acoustic signals are received;
Second acquisition submodule, for obtaining the spread speed of sound wave;
Second determine submodule, for be based on the time difference and the spread speed, determine the terminal front side with
The distance between described testee.
Optionally, the adjustment module includes:
Submodule is chosen, for selecting from the distance between at least one described described terminal front side and the testee
Take the distance less than pre-determined distance;
Third determines submodule, for determining the difference between the maximum distance and minimum range in the distance chosen;
Reduce submodule, for reducing the sound for the sound being currently played when determining difference is greater than preset difference value
Amount;
Submodule is set, the sound for will be currently played when determining difference is not more than the preset difference value
Volume be set as zero.
Optionally, the transmitting module is also used to:
By the wave sounder part of the terminal, emit multiple first sound wave letters along the terminal front side outwardly direction
Number;
Described device further include:
It is tested to receive the first acoustic signals arrival for the acoustic receiver device by the terminal for receiving module
The second acoustic wave signal of object back reflection.
Optionally, the wave sounder part is the earpiece at the top of the terminal, and the acoustic receiver device is the end
Hold the noise reduction microphone at top.
Optionally, described device further include:
Second judgment module, for judging whether the terminal is in horizontality;
Execution module, for holding when the terminal is in horizontality and the terminal front side is in unobstructed state
It goes described the step of emitting multiple first acoustic signals along the terminal front side outwardly direction.
According to the third aspect of an embodiment of the present disclosure, a kind of sound volume control device is provided, described device includes:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
When sound is currently played in the terminal, judge whether the terminal front side is in unobstructed state;
When the terminal front side is in unobstructed state, emit multiple first sound along the terminal front side outwardly direction
Wave signal;
For the first acoustic signals of each of the multiple first acoustic signals, when receiving first acoustic signals
When reaching the second acoustic wave signal of testee back reflection, emission parameter and the rising tone based on first acoustic signals
The reception parameter of wave signal, determines the distance between the terminal front side and the testee, to obtain described at least one
The distance between terminal front side and the testee;
According to the distance between at least one described described terminal front side and described testee, to what is be currently played
The volume of sound is adjusted.
The technical scheme provided by this disclosed embodiment can include the following benefits:
In the embodiment of the present disclosure, when sound is currently played in terminal and terminal front side is in unobstructed state, along end
Rectify the direction faced out and emit multiple first acoustic signals, since second acoustic wave signal is that first acoustic signals arrival is tested
The signal of object back reflection, therefore can be examined by the emission parameter of the first acoustic signals and the reception parameter of second acoustic wave signal
The distance between terminal front side and testee are surveyed, and according to the distance between terminal front side and testee, to currently
The volume of the sound of broadcasting is adjusted, and triggers the realization of volume control option to currently broadcasting by predetermined registration operation without user
The volume control for the sound put improves the efficiency that terminal carries out volume control to simplify the operation of user.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention
Example, and be used to explain the principle of the present invention together with specification.
Fig. 1 is a kind of flow chart of method for controlling volume shown according to an exemplary embodiment;
Fig. 2A is a kind of flow chart of the method for controlling volume shown according to another exemplary embodiment;
Fig. 2 B is a kind of schematic diagram of terminal shown according to an exemplary embodiment;
Fig. 2 C is a kind of decaying schematic diagram of acoustic signals amplitude shown according to an exemplary embodiment;
Fig. 3 A is a kind of sound volume control device block diagram shown according to an exemplary embodiment;
Fig. 3 B is a kind of determining module block diagram shown according to an exemplary embodiment;
Fig. 3 C is a kind of determining module block diagram shown according to another exemplary embodiment;
Fig. 3 D is a kind of sound volume control device block diagram shown according to another exemplary embodiment;
Fig. 3 E is a kind of sound volume control device block diagram shown according to another exemplary embodiment;
Fig. 4 is a kind of sound volume control device block diagram shown according to another exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended
The example of device and method being described in detail in claims, some aspects of the invention are consistent.
Before carrying out detailed explanation to the embodiment of the present disclosure, first the application scenarios of the embodiment of the present disclosure are given
It introduces.The method for controlling volume that the embodiment of the present disclosure provides is applied to terminal and sound is currently played, and user want to the end
In the scene for holding the volume of the sound played to be adjusted.
In the related technology, when sound is currently played in terminal, user can be by predetermined registration operation triggering terminal
Volume control option, to realize the volume control to currently playing sound.Particularly, terminal inconvenient to use for user
Scene such as conference scenario, terminal are normally placed on desktop, and when terminal receives the message of some application, terminal will be by broadcasting
The mode for putting prompt tone reminds user, is such as directed to the incoming ring tone of incoming message.At this time in order to avoid the prompt tone is to the meeting
Other users in scene interfere, and user need to first pick up mobile phone and then trigger volume control option by predetermined registration operation, with
Realizing must be by the contact between terminal and user come real to the control of the volume of the prompt tone namely the method for controlling volume
It is existing, cause user's operation relatively complicated, and volume control efficiency is lower.Therefore, the embodiment of the present disclosure provides a kind of volume control
Method processed, details are as follows.
Fig. 1 is a kind of flow chart of method for controlling volume shown according to an exemplary embodiment, the method for controlling volume
Applied in terminal, which can be mobile phone, tablet computer, computer etc. in terminal.As shown in Figure 1, the volume control
Method processed includes the following steps.
In a step 101, when sound is currently played in terminal, sentence and state whether terminal front side is in unobstructed state.
In a step 102, when terminal front side is in unobstructed state, along terminal front side outwardly direction transmitting multiple the
One acoustic signals.
In step 103, for the first acoustic signals of each of multiple first acoustic signals, when receiving first sound
When wave signal reaches the second acoustic wave signal of testee back reflection, emission parameter based on first acoustic signals and this second
The reception parameter of acoustic signals, determines the distance between terminal front side and testee, with obtain at least one terminal front side with
The distance between testee.
At step 104, according to the distance between at least one terminal front side and testee, to being currently played
The volume of sound be adjusted.
In the embodiment of the present disclosure, when sound is currently played in terminal and terminal front side is in unobstructed state, along end
Rectify the direction faced out and emit multiple first acoustic signals, since second acoustic wave signal is that first acoustic signals arrival is tested
The signal of object back reflection, therefore can be examined by the emission parameter of the first acoustic signals and the reception parameter of second acoustic wave signal
The distance between terminal front side and testee are surveyed, and according to the distance between terminal front side and testee, to currently
The volume of the sound of broadcasting is adjusted, and triggers the realization of volume control option to currently broadcasting by predetermined registration operation without user
The volume control for the sound put improves the efficiency that terminal carries out volume control to simplify the operation of user.
Optionally, the amplitude when emission parameter of the first acoustic signals first acoustic signals are launched;Second sound wave letter
Number reception parameter include amplitude when second acoustic wave signal is received;Emission parameter based on the first acoustic signals and this second
The reception parameter of acoustic signals, determines the distance between terminal front side and testee, comprising:
It calculates between amplitude when amplitude and the second acoustic wave signal when first acoustic signals are launched are received
Amplitude difference;
Obtain the attenuation coefficient of amplitude in propagation process of sound wave;
Based on the amplitude difference and attenuation coefficient, the distance between terminal front side and testee are determined.
Optionally, the emission parameter of the first acoustic signals includes launch time point when the first acoustic signals are launched;The
The reception parameter of two acoustic signals includes receiving time point when second acoustic wave signal is received;Hair based on the first acoustic signals
The reception parameter for penetrating parameter and second acoustic wave signal, determines the distance between terminal front side and testee, comprising:
Calculate reception when launch time point and the second acoustic wave signal when first acoustic signals are launched are received
Time difference between time point;
Obtain the spread speed of sound wave;
Based on the time difference and spread speed, the distance between terminal front side and testee are determined.
Optionally, according to the distance between at least one terminal front side and testee, to the sound being currently played
Volume be adjusted, comprising:
It is less than at a distance from pre-determined distance from being chosen in the distance between at least one terminal front side and testee;
Determine the difference between the maximum distance and minimum range in the distance chosen;
When determining difference is greater than preset difference value, reduce the volume for the sound being currently played;
When determining difference is not more than the preset difference value, zero is set by the volume for the sound being currently played.
Optionally, emit multiple first acoustic signals along terminal front side outwardly direction, comprising:
By the wave sounder part of terminal, emit multiple first acoustic signals along terminal front side outwardly direction;
Receive the second acoustic wave signal that the first acoustic signals reach testee back reflection, comprising:
By the acoustic receiver device of terminal, the second sound wave letter that the first acoustic signals reach testee back reflection is received
Number.
Optionally, wave sounder part is the earpiece at the top of terminal, and acoustic receiver device is the noise reduction Mike at the top of terminal
Wind.
Optionally, when terminal front side is in unobstructed state, emit multiple first sound along terminal front side outwardly direction
Before wave signal, further includes:
Judge whether terminal is in horizontality;
When terminal is in horizontality and terminal front side is in unobstructed state, execute along terminal front side outwardly direction
The step of emitting multiple first acoustic signals.
All the above alternatives, can form the alternative embodiment of the disclosure according to any combination, and the disclosure is real
It applies example and this is no longer repeated one by one.
Fig. 2A is a kind of flow chart of the method for controlling volume shown according to another exemplary embodiment, as shown in Figure 2 A,
The method for controlling volume is for including the following steps in terminal.
In step 201, when sound is currently played in the terminal, judge whether the terminal front side is in unobstructed shape
State, and judge whether the terminal is in horizontality.
When sound is currently played in the terminal, such as the prompt tone for the notification message that incoming ring tone or wechat are applied, this
When, if being currently conference scenario, user may want that the volume to the sound of terminal plays is adjusted.In order to simplify the behaviour of user
Make, the embodiment of the present disclosure provides a kind of method that can quickly control volume close to terminal front side by hand, and this is quickly
Control volume method can be started by rapid volume control module.In order to save terminal power, the terminal can be first judged
Whether in being suitable for the state for starting rapid volume control module, to just start rapid volume control in a suitable case
Module.
Firstly, when terminal front side is blocked, such as when terminal is buckled on the table or is installed in user's pocket
When, it is blocked since terminal front side at this time has had, will be unable to accurately judge the close movement of user's hand again.Mirror
In this, can using the unobstructed state of terminal front side as being suitable for the state for opening rapid volume control module, i.e., when terminal just
Face just starts rapid volume control module when being in unobstructed state.
Secondly, in view of when user does not use terminal, it will usually place on the table terminal.Just because of terminal quilt
It places on the table, user is just not desired to pick up terminal from desktop and is realized again by triggering volume control option to currently playing
The control of the volume of sound.Moreover, terminal is generally in horizontality when terminal is placed on the table.In consideration of it, may be used also
State when terminal being in horizontal is as being suitable for the state for opening rapid volume control module, i.e., when terminal front side is in nothing
Occlusion state and just starting rapid volume control module when in a horizontal state.
It should be noted that the horizontality in the embodiment of the present disclosure refers to that terminal steady places the state being not used by.
The horizontality can be determined by the tilt angle of terminal with respect to the horizontal plane, by the inclination angle of terminal with respect to the horizontal plane
State when spending within the scope of predetermined angle threshold value is determined as horizontality.For example, the predetermined angle threshold value may range from [-
5 °, 5 °], or [- 10 °, 10 °] etc., the embodiment of the present disclosure to the predetermined angle threshold value range without limitation.
In practical application, terminal can detect whether terminal front side is in unobstructed shape by the first sensor configured
State detects whether the terminal is in horizontality by the second sensor configured.The first sensor can be photoelectric sensing
Device etc., the second sensor can be acceleration transducer, gravity sensor, gyroscope etc..
By taking the first sensor is photoelectric sensor as an example, which can be only fitted to the front of the terminal, than
As configured at the top of terminal front side, such as top earpiece accessory position.Photoelectric sensor be one kind can optical signal (infrared light,
Visible light and ultraviolet laser light etc.) it is changed into the sensing device of electric signal, it is usually made of light-emitting component and sensing element, should
Light-emitting component can be LED (Light Emitting Diode, light emitting diode) etc..
The testing principle of photoelectric sensor are as follows: when light-emitting component issue light be blocked object reflect when, sensing element
It can sense, and can produce interruption and handle accordingly.In the embodiment of the present disclosure, when photoelectric sensor is detected by shining
The light that element issues is blocked object when reflecting, and indication signal can be issued to controller, to indicate that the terminal front side is in
There is occlusion state.When the light issued by light-emitting component be not blocked object reflect when, can to controller issue instruction letter
Number to indicate that the terminal front side is in unobstructed state, indication signal can not also be issued to controller.
In step 202, when the terminal front side is in unobstructed state and the terminal is when in a horizontal state, along the terminal
The direction of right-side-out emits multiple first acoustic signals.
When the terminal front side is in unobstructed state and the terminal is when in a horizontal state, illustrate that the terminal is not made at this time
With and in be suitable for the state for starting rapid volume control module, then the terminal can start rapid volume control mould at this time
Block emits the first acoustic signals along the terminal front side outwardly direction by the rapid volume control module of starting.
In the embodiment of the present disclosure, which can be sonic sensor module, pass through sonic sensor
The acoustic signals that module issues detect close the movement of user's hand, so realization user's hand close to when to currently playing
The volume of sound is adjusted.Significantly, since user wants the side that the volume to currently playing sound is adjusted
There are many formula is possible, such as reduces the volume of currently playing sound or set mute for the volume of currently playing sound, therefore, In
In the embodiment of the present disclosure, multiple first acoustic signals need to be emitted, terminal judges terminal front side according to multiple first acoustic signals
The variation of the distance between user's hand, changes the tune that different modes are carried out to the volume of currently playing sound according to this distance
It is whole.
Wherein, which includes wave sounder part and sound wave receiving device, can carry out sound wave respectively
Transmitting and reception, and can be according to transmitting and the judgement of received sound wave and the distance between shelter.It that is to say, which can
To emit the first acoustic signals along the terminal front side outwardly direction by the wave sounder part.
In practical application, which is configured in terminal top position, such as can be configured at top and listen
Near cylinder position.It is possible to further configure the sonic sensor module and above-mentioned first sensor in the same area, so as to
When determining that terminal front side is blocked by the first sensor, detects the terminal by the sonic sensor module and block
The distance between object.
Optionally, which can be the earpiece at the top of the terminal, which can be the end
Hold the noise reduction microphone at top.Fig. 2 B is please referred to, Fig. 2 B is a kind of schematic diagram of terminal shown according to an exemplary embodiment.
It include wave sounder part 21 and sound wave receiving device 22 in the terminal.
Optionally, which can be ultrasonic signal.Wherein, due to the direction signal collection of ultrasonic signal
In, thus be suitble to the embodiment of the present disclosure provide along this determination direction of terminal front side outwardly direction emit acoustic signals.It is super
Here without limitation, frequency is more than that side shown by the embodiment of the present disclosure can be achieved in the sound wave of 20KHz to the frequency of acoustic signals
Case, frequency can be 96KHz, 128KHz or 256KHz etc..
It should be noted that the embodiment of the present disclosure is only when the terminal front side is in unobstructed state and the terminal is in water
When level state, just for multiple first acoustic signals of terminal front side outwardly direction transmitting.And in another embodiment, when
When sound is currently played in the terminal, it can also only judge whether the terminal front side is in unobstructed state, work as terminal front side
When in unobstructed state, i.e., emit multiple first acoustic signals along the terminal front side outwardly direction.For example, terminal can be
Slant setting emits more on terminal support, and when terminal front side is in unobstructed state along the terminal front side outwardly direction
A first acoustic signals.
In step 203, for the first acoustic signals of each of multiple first acoustic signals, when receiving first sound
When wave signal reaches the second acoustic wave signal of testee back reflection, emission parameter based on first acoustic signals and this second
The reception parameter of acoustic signals, determines the distance between the terminal front side and testee, to obtain at least one terminal just
The distance between face and testee.
Terminal is after launching multiple first acoustic signals, for the first sound wave of each of multiple first acoustic signals
Signal can receive first acoustic signals by the acoustic receiver device of the terminal and reach the rising tone after testee reflection
Wave signal.Second acoustic wave signal be the first acoustic signals encounter testee back reflection formed and the first acoustic signals have
Identical frequency, because propagation medium locating after reflection is identical, therefore the propagation of second acoustic wave signal and the first acoustic signals is fast
It spends also identical.In addition, the testee can when user wants to be adjusted by volume of the hand motion to currently playing sound
Think user's hand.
Optionally, which is the noise reduction microphone at the top of terminal.The position of the acoustic receiver device herein
Scheme measuring accuracy that is with the position of wave sounder part in step 202 corresponding, being provided due to the embodiment of the present disclosure
The order of magnitude is Centimeter Level and ultrasonic wave can be considered as along straightline propagation when measuring short distance, thus design the wave sounder part and
When the position of the acoustic receiver device, should by the installation site between it as close to.Optionally, the wave sounder part and
Range of the distance between the acoustic receiver device within one centimetre.
Wherein, the reception parameter of emission parameter and the second acoustic wave signal based on first acoustic signals, determines the end
The implementation for rectifying the distance between face and the testee, may include following two:
The first implementation: the emission parameter of first acoustic signals includes vibration when first acoustic signals are launched
Width;The reception parameter of the second acoustic wave signal includes the amplitude when second acoustic wave signal is received;It should be based on first sound wave
The emission parameter of signal and the reception parameter of the second acoustic wave signal, determine the distance between the terminal front side and the testee
Include the following steps 1) -3):
1) it calculates between amplitude when amplitude and the second acoustic wave signal when first acoustic signals are launched are received
Amplitude difference.
When acoustic signals are propagated in medium (air), the decaying of energy is decided by the diffusion, scattering and suction of acoustic signals
It receives.In perfect medium, the decaying of sound wave comes solely from the diffusion of sound wave, i.e., the distance propagated with acoustic signals increases and causes
The decrease of sonic energy signal.Granular boundary or stream when scatter attenuation refers to that ultrasonic wave is propagated in the medium, in solid dielectric
Suspended particles in body medium make sound wave generate diffraction, and a portion sound can be moved no longer along the original direction of propagation, and be formed
Scattering.Scatter attenuation is related with the property of the shape of scattering particles, size, quantity, the property of medium and scattering particles.Absorption declines
Subtracting is that the interior friction between particle is caused when propagating ultrasonic wave in the medium due to medium viscosity, to enable a part of sound
Thermal energy is converted to, heat exchange is carried out by heat transfer, leads to the loss of sonic energy signal.
Fig. 2 C is please referred to, Fig. 2 C is a kind of decaying signal of acoustic signals amplitude shown according to an exemplary embodiment
Figure, the amplitude of acoustic signals reduces with the increase of propagation distance in fig. 2 c.In Fig. 2 C, A indicates the amplitude of acoustic signals, D
Indicate propagation distance.It should be strongly noted that the one of the amplitude for being reduced to acoustic signals of acoustic signals amplitude shown in Fig. 2 C
Graphically schematically illustrating for kind damped manner, does not form restriction to it.
When first acoustic signals are launched, emission parameter will be recorded in the terminal.In the first implementation, should
Amplitude when emission parameter includes the transmitting of the first acoustic signals, the amplitude can be the mean amplitude of tide when transmitting of the first acoustic signals
Value, alternatively, being also possible to the first acoustic signals in the instantaneous amplitude value for starting emission time.Similarly, second acoustic wave signal is connect
In the time receiving, receiving parameter will be recorded in the terminal.In the first implementation, which includes second acoustic wave signal
Reception when amplitude, which can be average amplitude value when second acoustic wave signal receives, or is also possible to the rising tone
Wave signal is in the instantaneous amplitude value for terminating the time of reception.
By taking the first acoustic signals of wave sounder part transmitting are the ultrasonic signals of 96KHz as an example, due to the ultrasonic wave
After signal is launched, the amplitude of sound wave is gradually reduced with the increase of propagation distance in air, the ultrasonic signal it is flat
Equal acoustic density is also gradually reduced.Therefore, the amplitude for the second acoustic wave signal that acoustic receiver device receives and the first sound wave are believed
Number amplitude variations difference and above-mentioned two acoustic signals be propagated through at a distance from be positively correlated.The amplitude of second acoustic wave signal with
The amplitude variations difference of first acoustic signals is bigger, and the distance between terminal and testee are longer.
2) attenuation coefficient of amplitude in propagation process of sound wave is obtained.
Wherein, terminal can obtain the environmental parameter of terminal surrounding by the environmental sensor in the terminal, according to environment
Parameter obtains the attenuation coefficient of amplitude in propagation process of sound wave.The environmental parameter include in temperature, air humidity or air pressure at least
It is a kind of.
The speed that the amplitude of sound wave is decayed in the medium depends on attenuation coefficient when sound wave is propagated in the medium, this declines
It is related to subtract the factors such as coefficient and the material of medium, temperature and density.In the embodiments of the present disclosure, the first acoustic signals and second
Acoustic signals are propagated in air, and for air, the factor for influencing the attenuation coefficient of sonic wave amplitude mainly includes
Temperature, air humidity and air pressure etc..
Therefore, in the embodiments of the present disclosure, terminal can first by environmental sensor obtain terminal surrounding include temperature,
The environmental parameters such as air humidity and air pressure.Later, at least one of temperature, air humidity or the air pressure obtained according to measurement ring
Border parameter, terminal can obtain attenuation coefficient according to pre-set corresponding relationship.
Attenuation coefficient can be obtained according to three above-mentioned temperature, air humidity and air pressure measured values, can also be according to it
In at least one measured value obtain.In addition attenuation coefficient is not surveyed in the case of being obtained according to wherein at least one measured value
Preset value can be used in the environmental parameter of amount.For example, temperature is only measured, then air humidity and air pressure are corresponding using at this temperature
Preset value.
3) based on the amplitude difference and the attenuation coefficient, the distance between the terminal front side and the testee are determined.
In a kind of method in the cards, a list is stored in advance in terminal, includes attenuation coefficient, amplitude in the list
Corresponding relationship between three kinds away from the distance between terminal front side data of difference and testee, declines in the list processing method
Subtract coefficient and amplitude difference be continuous value, with guarantee the data of a pair of of attenuation coefficient and amplitude difference can correspond to find by
Object is surveyed away from the distance between terminal front side.
A user is stored in advance in the method for alternatively possible realization, in terminal according to amplitude difference and attenuation coefficient
Algorithm of the testee away from the distance between terminal front side is calculated, which can recorde in some chip in the terminal,
It can be integrated in terminal in an application program, using the algorithm, terminal only needs to input independent variable attenuation coefficient and vibration
Width difference, it can obtain testee away from the distance between terminal front side.
In another method in the cards, terminal can be changed according to the amplitude of first acoustic signals according to correlation
Calculation relationship obtains the acoustic pressure and the sound intensity of the first acoustic signals, and according to the amplitude of second acoustic wave signal, according to related conversion relation
The acoustic pressure and the sound intensity of second acoustic wave signal are obtained, then brings obtained attenuation coefficient into following formula (1) and formula (2) respectively
In.
P2=P1e-kx (1)
I2=I1e-2kx (2)
Wherein, P1It is the acoustic pressure of the first acoustic signals, P2It is the acoustic pressure of second acoustic wave signal;I1It is the first acoustic signals
The sound intensity, I2It is the acoustic pressure of second acoustic wave signal;K is attenuation coefficient, and x is testee away from the distance between terminal front side.
Then according to above-mentioned formula (1) and formula (2) you can get it testee away from the distance between terminal front side x.
Optionally, which can be measured by continuously issuing continual acoustic signals by multiple acoustic signals
Aggregation of data obtains testee away from the distance between terminal front side.For example, by determined in nearest a period of time it is multiple away from
It is averaged from value, as testee away from the distance between terminal front side.
In a possible embodiment, addition marks in each acoustic signals that terminal issues, when terminal receives
It, can be corresponding with each acoustic signals issued by the label in the second acoustic wave signal received when second acoustic wave signal.
For example, the label for the acoustic signals institute band that terminal continuously issues is respectively as follows: A1、A2、A3……An, then terminal receives sound wave letter
Number when can be according to A1、A2、A3……AnIt is corresponding with the signal launched Deng marking.For example terminal is A in emission mark1Sound
One group of parameter is had recorded when wave signal, and is labeled as A receiving1Acoustic signals when have recorded another group of data, at this time this two
Group data are corresponding data, using this two groups of corresponding datas you can get it testee away from the distance between terminal front side.
At the same time, parameter when parameter and reception when terminal emits the acoustic signals of other labels corresponds,
Multiple testees that the data of preset group number are calculated are averaged away from the distance between terminal front side, or use it
Its data processing method show that testee away from the distance between terminal front side, utilizes continuous continual acoustic signals to reach
Testee is measured away from the distance between terminal front side, avoid because when individual sound waves are interfered give entire measurement result bring
The effect of error.
Second of implementation: the emission parameter of first acoustic signals includes hair when first acoustic signals are launched
Penetrate time point;The reception parameter of the second acoustic wave signal includes the receiving time point when second acoustic wave signal is received;The base
In the emission parameter of first acoustic signals and the reception parameter of the second acoustic wave signal, the terminal front side and the measured object are determined
The distance between body includes the following steps 1) -3):
1) connecing when launch time point when first acoustic signals are launched is received with the second acoustic wave signal is calculated
Receive the time difference between time point.
When first acoustic signals are launched, emission parameter will be recorded in the terminal.In the second implementation, should
Launch time point when emission parameter includes the transmitting of the first acoustic signals.Similarly, it when second acoustic wave signal is received, receives
Parameter will be also recorded in the terminal.In the second implementation, when which includes that second acoustic wave signal is received
Receiving time point.
Receiving time when launch time point and second acoustic wave signal when according to the transmitting of the first acoustic signals are received
The difference of point, can be obtained time difference T.
2) spread speed of sound wave is obtained.
Wherein, terminal can obtain the environmental parameter of terminal surrounding by the environmental sensor in terminal, be joined according to environment
Number obtains the spread speed of sound wave.The environmental parameter includes at least one of temperature, air humidity or air pressure.
Temperature, air humidity or effects of air pressure atmospheric density, and atmospheric density influences the aerial propagation speed of sound wave
Degree, the spread speed of the more high then ultrasonic wave of the density of air is faster, so the spread speed for wanting to obtain sound wave need to first pass through
Environmental sensor obtains environmental parameter.After measuring the environmental parameter including temperature, air humidity or air pressure, that is, it can determine
First acoustic signals and the aerial spread speed V of second acoustic wave signal.
3) based on the time difference and the spread speed, the distance between the terminal front side and the testee are determined.
Wherein it is possible to determine the distance between the terminal front side and the testee according to following formula (3):
D=T*V/2 (3)
Wherein, D indicates testee away from the distance between terminal, and T indicates the launch time point and the of the first acoustic signals
The difference of the receiving time point of two acoustic signals, V indicate the first acoustic signals and the aerial propagation speed of second acoustic wave signal
Degree.
It should be noted that can pass through for each of multiple first acoustic signals the first acoustic signals, terminal
Any distance to determine terminal and testee of above two implementation can also use above two realization simultaneously
Mode determines the distance of terminal and testee, is not specifically limited herein in the embodiment of the present disclosure.
It is further to note that due to multiple first acoustic signals of terminal transmission, and the second sound wave that terminal receives
Signal is the transmitting signal namely each second sound wave letter for having emitted first acoustic signals in multiple first acoustic signals
Number there is its corresponding first acoustic signals, therefore, in the embodiments of the present disclosure, need to take measures to believe multiple first sound wave
It number distinguishes.
In a possible embodiment, addition marks in the first acoustic signals of each of terminal sending, works as terminal
It, can be by marking and each of sending the first acoustic signals in the second acoustic wave signal received when receiving second acoustic wave signal
It is corresponding, and according to the emission parameter of the reception parameter of the second acoustic wave signal received and corresponding first acoustic signals, really
Determine the distance between terminal and testee.For example, the label for the first acoustic signals institute band that terminal continuously issues is respectively as follows:
A1、A2、A3……An, then terminal can be according to A when receiving second acoustic wave signal1、A2、A3……AnDeng label with launch
First acoustic signals are corresponding.For example terminal is A in emission mark1The first acoustic signals when have recorded one group of parameter, and
It receives and is labeled as A1Second acoustic wave signal when have recorded another group of data, at this time this two groups of data be corresponding data, utilize this
Two groups of corresponding datas are by above two implementation you can get it testee away from the distance between terminal front side.Work as end
End is when being performed both by the above operation to multiple first acoustic signals, available one group of testee away between terminal front side away from
The distance between from, namely obtain at least one terminal front side and testee.
In step 204, according to the distance between at least one terminal front side and testee, to being currently played
The volume of sound be adjusted.
It, can be according at least one terminal when terminal obtains the distance between at least one terminal front side and testee
Front determines the variation of the distance between testee and terminal front side the distance between with testee, then according to should be away from
From variation, the volume for the sound being currently played is adjusted.That is, from least one terminal front side and measured object
The distance for being less than pre-determined distance is chosen in the distance between body, is determined between the maximum distance and minimum range in the distance chosen
Difference, when determining difference be greater than preset difference value when, reduce the volume for the sound being currently played, when determining difference not
When greater than the preset difference value, zero is set by the volume for the sound being currently played.
Wherein, pre-determined distance is pre-set distance in terminal, namely only between testee and terminal front side
It, just can be according to the distance between testee and terminal front side, to the sound of currently playing sound when distance is within pre-determined distance
Amount is adjusted, and avoids improving because the operation of user necessarily causes terminal to be adjusted the volume of currently playing sound
The precision of terminal control volume.
In addition, preset difference value is pre-set distance difference, which may be used to indicate that testee and end
Whether the distance between end is changed, and when determining difference is greater than preset difference value, shows testee at this time and terminal
The distance between exist variation, when determining difference be not more than the preset difference value when, testee and terminal can be approximately considered
The distance between front does not change.That is, when the distance between testee and terminal front side change in pre-determined distance
When, reduce the volume of currently playing sound, when there is no variations in pre-determined distance for the distance between testee and terminal
When, zero is set by the volume for the sound being currently played.
In the embodiment of the present disclosure, when sound is currently played in terminal and terminal front side is in unobstructed state, along end
Rectify the direction faced out and emit multiple first acoustic signals, since second acoustic wave signal is that first acoustic signals arrival is tested
The signal of object back reflection, therefore can be examined by the emission parameter of the first acoustic signals and the reception parameter of second acoustic wave signal
The distance between terminal front side and testee are surveyed, and according to the distance between terminal front side and testee, to currently
The volume of the sound of broadcasting is adjusted, and triggers the realization of volume control option to currently broadcasting by predetermined registration operation without user
The volume control for the sound put improves the efficiency that terminal carries out volume control to simplify the operation of user.Particularly,
When testee is user's hand, by user's hand close to terminal front side, the volume to currently playing sound can be realized
Quick control.
Fig. 3 A is a kind of block diagram of sound volume control device 300 shown according to an exemplary embodiment.Referring to Fig. 3 A, the dress
It sets including first judgment module 301, transmitting module 302, determining module 303 and adjustment module 304.
First judgment module 301, for judging whether terminal front side is in no screening when sound is currently played in terminal
Gear state;
Transmitting module 302, for emitting along terminal front side outwardly direction more when terminal front side is in unobstructed state
A first acoustic signals;
Determining module 303, for for the first acoustic signals of each of multiple first acoustic signals, when receiving this
When first acoustic signals reach the second acoustic wave signal of testee back reflection, emission parameter based on first acoustic signals and
The reception parameter of the second acoustic wave signal, determines the distance between the terminal front side and the testee, to obtain at least one
The distance between terminal front side and testee;
Module 304 is adjusted, for according to the distance between at least one terminal front side and testee, to currently
The volume of the sound of broadcasting is adjusted.
Optionally, referring to Fig. 3 B, the emission parameter of first acoustic signals includes when first acoustic signals are launched
Amplitude;The reception parameter of the second acoustic wave signal includes the amplitude when second acoustic wave signal is received;The determining module 303 packet
It includes:
First computational submodule 3031, for calculating amplitude and second sound wave letter when first acoustic signals are launched
The amplitude difference between amplitude when number being received;
First acquisition submodule 3032, for obtaining the attenuation coefficient of amplitude in propagation process of sound wave;
First determining submodule 3033, for determining the terminal front side and being somebody's turn to do based on the amplitude difference and the attenuation coefficient
The distance between testee.
Optionally, referring to Fig. 3 C, the emission parameter of first acoustic signals includes when first acoustic signals are launched
Launch time point;The reception parameter of the second acoustic wave signal includes the receiving time point when second acoustic wave signal is received;It should
Determining module 303 includes:
Second computational submodule 3034, for calculate launch time point when first acoustic signals are launched and this second
The time difference between receiving time point when acoustic signals are received;
Second acquisition submodule 3035, for obtaining the spread speed of sound wave;
Second determining submodule 3036, for determining the terminal front side and being somebody's turn to do based on the time difference and the spread speed
The distance between testee.
Optionally, which includes:
Submodule is chosen, is less than for being chosen in the distance between at least one terminal front side and the testee from this
The distance of pre-determined distance;
Third determines submodule, for determining the difference between the maximum distance and minimum range in the distance chosen;
Reduce submodule, for reducing the sound for the sound being currently played when determining difference is greater than preset difference value
Amount;
Be arranged submodule, for when determining difference be not more than the preset difference value when, by the sound being currently played
Volume is set as zero.
Optionally, referring to Fig. 3 D, which is used for:
By the wave sounder part of the terminal, emit multiple first acoustic signals along the terminal front side outwardly direction;
The device 300 further include:
Receiving module 305 receives the first acoustic signals and reaches testee for passing through the acoustic receiver device of the terminal
The second acoustic wave signal of back reflection.
Optionally, which is the earpiece at the top of the terminal, which is at the top of the terminal
Noise reduction microphone.
Optionally, referring to Fig. 3 E, the device 300 further include:
Second judgment module 306, for judging whether the terminal is in horizontality;
Execution module 307, for executing when the terminal is in horizontality and the terminal front side is in unobstructed state
The step of emitting multiple first acoustic signals along the terminal front side outwardly direction.
In the embodiment of the present disclosure, when sound is currently played in terminal and terminal front side is in unobstructed state, along end
Rectify the direction faced out and emit multiple first acoustic signals, since second acoustic wave signal is that first acoustic signals arrival is tested
The signal of object back reflection, therefore can be examined by the emission parameter of the first acoustic signals and the reception parameter of second acoustic wave signal
The distance between terminal front side and testee are surveyed, and according to the distance between terminal front side and testee, to currently
The volume of the sound of broadcasting is adjusted, and triggers the realization of volume control option to currently broadcasting by predetermined registration operation without user
The volume control for the sound put improves the efficiency that terminal carries out volume control to simplify the operation of user.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method
Embodiment in be described in detail, no detailed explanation will be given here.
Fig. 4 is a kind of block diagram of device 400 for volume control shown according to an exemplary embodiment.For example, dress
Setting 400 can be mobile phone, computer, messaging devices, game console, tablet device, Medical Devices, body-building equipment
Deng.
Referring to Fig. 4, device 400 may include following one or more components: processing component 402, memory 404, power supply
Component 406, multimedia component 408, audio component 410, the interface 412 of input/output (I/O), sensor module 414, and
Communication component 416.
The integrated operation of the usual control device 400 of processing component 402, such as with display, telephone call, data communication, phase
Machine operation and record operate associated operation.Processing component 402 may include that one or more processors 420 refer to execute
It enables, to perform all or part of the steps of the methods described above.In addition, processing component 402 may include one or more modules, just
Interaction between processing component 402 and other assemblies.For example, processing component 402 may include multi-media module, it is more to facilitate
Interaction between media component 408 and processing component 402.
Memory 404 is configured as storing various types of data to support the operation in device 400.These data are shown
Example includes the instruction of any application or method for operating on device 400, contact data, and telephone book data disappears
Breath, picture, video etc..Memory 404 can be by any kind of volatibility or non-volatile memory device or their group
It closes and realizes, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM) is erasable to compile
Journey read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash
Device, disk or CD.
Power supply module 406 provides power supply for the various assemblies of device 400.Power supply module 406 may include power management system
System, one or more power supplys and other with for device 400 generate, manage, and distribute the associated component of power supply.
Multimedia component 408 includes the screen of one output interface of offer between described device 400 and user.One
In a little embodiments, screen may include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen
Curtain may be implemented as touch screen, to receive input signal from the user.Touch panel includes one or more touch sensings
Device is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or sliding action
Boundary, but also detect duration and pressure associated with the touch or slide operation.In some embodiments, more matchmakers
Body component 408 includes a front camera and/or rear camera.When device 400 is in operation mode, such as screening-mode or
When video mode, front camera and/or rear camera can receive external multi-medium data.Each front camera and
Rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 410 is configured as output and/or input audio signal.For example, audio component 410 includes a Mike
Wind (MIC), when device 400 is in operation mode, when such as call mode, recording mode, and voice recognition mode, microphone is matched
It is set to reception external audio signal.The received audio signal can be further stored in memory 404 or via communication set
Part 416 is sent.In some embodiments, audio component 410 further includes a loudspeaker, is used for output audio signal.
I/O interface 412 provides interface between processing component 402 and peripheral interface module, and above-mentioned peripheral interface module can
To be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and lock
Determine button.
Sensor module 414 includes one or more sensors, and the state for providing various aspects for device 400 is commented
Estimate.For example, sensor module 414 can detecte the state that opens/closes of device 400, and the relative positioning of component, for example, it is described
Component is the display and keypad of device 400, and sensor module 414 can be with 400 1 components of detection device 400 or device
Position change, the existence or non-existence that user contacts with device 400,400 orientation of device or acceleration/deceleration and device 400
Temperature change.Sensor module 414 may include proximity sensor, be configured to detect without any physical contact
Presence of nearby objects.Sensor module 414 can also include optical sensor, such as CMOS or ccd image sensor, at
As being used in application.In some embodiments, which can also include acceleration transducer, gyro sensors
Device, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 416 is configured to facilitate the communication of wired or wireless way between device 400 and other equipment.Device
400 can access the wireless network based on communication standard, such as WiFi, 2G or 3G or their combination.In an exemplary implementation
In example, communication component 416 receives broadcast singal or broadcast related information from external broadcasting management system via broadcast channel.
In one exemplary embodiment, the communication component 416 further includes near-field communication (NFC) module, to promote short range communication.Example
Such as, NFC module can be based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band (UWB) technology,
Bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, device 400 can be believed by one or more application specific integrated circuit (ASIC), number
Number processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array
(FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for executing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided
It such as include the memory 404 of instruction, above-metioned instruction can be executed by the processor 420 of device 400 to complete the above method.For example,
The non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk
With optical data storage devices etc..
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its
Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or
Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the disclosure
Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following
Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.
Claims (14)
1. a kind of method for controlling volume, which is characterized in that be applied in terminal, which comprises
When sound is currently played in the terminal, judge whether the terminal front side is in unobstructed state and described
Whether terminal is in horizontality, and the horizontality refers to the tilt angle of the terminal with respect to the horizontal plane in predetermined angle
State when in threshold range, the terminal front side is in unobstructed state and horizontality is used to indicate the terminal currently not
It is used by a user;
When the terminal front side is in unobstructed state and the terminal is when in a horizontal state, outside along the terminal front side
Direction emits multiple first acoustic signals;
For the first acoustic signals of each of the multiple first acoustic signals, reached when receiving first acoustic signals
When the second acoustic wave signal of testee back reflection, emission parameter and second sound wave letter based on first acoustic signals
Number reception parameter, the distance between the terminal front side and the testee are determined, to obtain at least one described terminal
The distance between positive and described testee, the testee are the hand of user;
According to the distance between at least one described described terminal front side and described testee, to the sound being currently played
Volume be adjusted, to reduce the volume of sound being currently played.
2. the method according to claim 1, wherein the emission parameter of first acoustic signals includes described
Amplitude when one acoustic signals are launched;The reception parameter of the second acoustic wave signal includes that the second acoustic wave signal is received
When amplitude;The reception parameter of the emission parameter based on first acoustic signals and the second acoustic wave signal determines
The distance between the terminal front side and the testee, comprising:
It calculates between amplitude when amplitude and the second acoustic wave signal when first acoustic signals are launched are received
Amplitude difference;
Obtain the attenuation coefficient of amplitude in propagation process of sound wave;
Based on the amplitude difference and the attenuation coefficient, the distance between the terminal front side and the testee are determined.
3. the method according to claim 1, wherein the emission parameter of first acoustic signals includes described
Launch time point when one acoustic signals are launched;The reception parameter of the second acoustic wave signal includes the second acoustic wave signal
Receiving time point when being received;The emission parameter based on first acoustic signals and the second acoustic wave signal connect
Parameter is received, determines the distance between the terminal front side and the testee, comprising:
Calculate reception when launch time point and the second acoustic wave signal when first acoustic signals are launched are received
Time difference between time point;
Obtain the spread speed of sound wave;
Based on the time difference and the spread speed, the distance between the terminal front side and the testee are determined.
4. the method according to claim 1, wherein at least one described terminal front side and the institute according to
The distance between testee is stated, the volume for the sound being currently played is adjusted, comprising:
From the distance between at least one described described terminal front side and the testee choose be less than pre-determined distance away from
From;
Determine the difference between the maximum distance and minimum range in the distance chosen;
When determining difference is greater than preset difference value, reduce the volume for the sound being currently played;
When determining difference is not more than the preset difference value, zero is set by the volume for the sound being currently played.
5. the method according to claim 1, wherein described multiple along terminal front side outwardly direction transmitting
First acoustic signals, comprising:
By the wave sounder part of the terminal, emit multiple first acoustic signals along the terminal front side outwardly direction;
The second acoustic wave signal for receiving first acoustic signals and reaching testee back reflection, comprising:
By the acoustic receiver device of the terminal, the rising tone that first acoustic signals reach testee back reflection is received
Wave signal.
6. according to the method described in claim 5, it is characterized in that, the wave sounder part is listening at the top of the terminal
Cylinder, the acoustic receiver device are the noise reduction microphone at the top of the terminal.
7. a kind of sound volume control device, which is characterized in that be applied in terminal, described device includes:
First judgment module, for judging whether the terminal front side is in nothing when sound is currently played in the terminal
Whether occlusion state and the terminal are in horizontality, and the horizontality refers to the terminal with respect to the horizontal plane
State when tilt angle is within the scope of predetermined angle threshold value, the terminal front side is in unobstructed state and horizontality is used for
Indicate that the terminal is not used by a user currently;
Transmitting module is used to be in unobstructed state when the terminal front side and the terminal is when in a horizontal state, along described
Terminal front side outwardly direction emits multiple first acoustic signals;
Determining module, for for the first acoustic signals of each of the multiple first acoustic signals, when receiving described
When one acoustic signals reach the second acoustic wave signal of testee back reflection, emission parameter based on first acoustic signals and
The reception parameter of the second acoustic wave signal, determines the distance between the terminal front side and the testee, with obtain to
Few the distance between a terminal front side and the testee, the testee are the hand of user;
Module is adjusted, for the distance between at least one described terminal front side and the testee according to, to current
The volume of sound being played on is adjusted, to reduce the volume for the sound being currently played.
8. device according to claim 7, which is characterized in that the emission parameter of first acoustic signals includes described
Amplitude when one acoustic signals are launched;The reception parameter of the second acoustic wave signal includes that the second acoustic wave signal is received
When amplitude;The determining module includes:
First computational submodule, for calculating amplitude and the second acoustic wave signal quilt when first acoustic signals are launched
The amplitude difference between amplitude when reception;
First acquisition submodule, for obtaining the attenuation coefficient of amplitude in propagation process of sound wave;
First determine submodule, for be based on the amplitude difference and the attenuation coefficient, determine the terminal front side with it is described
The distance between testee.
9. device according to claim 7, which is characterized in that the emission parameter of first acoustic signals includes described
Launch time point when one acoustic signals are launched;The reception parameter of the second acoustic wave signal includes the second acoustic wave signal
Receiving time point when being received;The determining module includes:
Second computational submodule, for calculating launch time point and second sound wave when first acoustic signals are launched
The time difference between receiving time point when signal is received;
Second acquisition submodule, for obtaining the spread speed of sound wave;
Second determine submodule, for be based on the time difference and the spread speed, determine the terminal front side with it is described
The distance between testee.
10. device according to claim 7, which is characterized in that the adjustment module includes:
Submodule is chosen, it is small for being chosen from the distance between at least one described described terminal front side and the testee
In the distance of pre-determined distance;
Third determines submodule, for determining the difference between the maximum distance and minimum range in the distance chosen;
Reduce submodule, for reducing the volume for the sound being currently played when determining difference is greater than preset difference value;
Be arranged submodule, for when determining difference be not more than the preset difference value when, by the sound for the sound being currently played
Amount is set as zero.
11. device according to claim 7, which is characterized in that the transmitting module is also used to:
By the wave sounder part of the terminal, emit multiple first acoustic signals along the terminal front side outwardly direction;
Described device further include:
Receiving module receives first acoustic signals and reaches testee for the acoustic receiver device by the terminal
The second acoustic wave signal of back reflection.
12. device according to claim 11, which is characterized in that the wave sounder part is listening at the top of the terminal
Cylinder, the acoustic receiver device are the noise reduction microphone at the top of the terminal.
13. the device as described in claim 8-12 is any, which is characterized in that described device further include:
Second judgment module, for judging whether the terminal is in horizontality;
Execution module, for executing institute when the terminal is in horizontality and the terminal front side is in unobstructed state
State the step of emitting multiple first acoustic signals along the terminal front side outwardly direction.
14. a kind of sound volume control device, which is characterized in that described device includes:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
When sound is currently played in terminal, judge whether the terminal front side is in unobstructed state and the terminal
Whether horizontality is in, the horizontality refers to the tilt angle of the terminal with respect to the horizontal plane in predetermined angle threshold value
State when in range, the terminal front side is in unobstructed state and horizontality be used to indicate the terminal currently not by with
Family uses;
When the terminal front side is in unobstructed state and the terminal is when in a horizontal state, outside along the terminal front side
Direction emits multiple first acoustic signals;
For the first acoustic signals of each of the multiple first acoustic signals, reached when receiving first acoustic signals
When the second acoustic wave signal of testee back reflection, emission parameter and second sound wave letter based on first acoustic signals
Number reception parameter, the distance between the terminal front side and the testee are determined, to obtain at least one described terminal
The distance between positive and described testee, the testee are the hand of user;
According to the distance between at least one described described terminal front side and described testee, to the sound being currently played
Volume be adjusted, to reduce the volume of sound being currently played.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710179766.4A CN106980486B (en) | 2017-03-23 | 2017-03-23 | Method for controlling volume and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710179766.4A CN106980486B (en) | 2017-03-23 | 2017-03-23 | Method for controlling volume and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106980486A CN106980486A (en) | 2017-07-25 |
CN106980486B true CN106980486B (en) | 2019-12-03 |
Family
ID=59339501
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710179766.4A Active CN106980486B (en) | 2017-03-23 | 2017-03-23 | Method for controlling volume and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106980486B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107613128B (en) * | 2017-09-26 | 2020-06-26 | 努比亚技术有限公司 | Volume adjusting method, terminal and computer readable storage medium |
CN108040174B (en) * | 2017-11-30 | 2021-07-23 | 努比亚技术有限公司 | Incoming call prompt tone volume adjusting method, mobile terminal and storage medium |
CN107995365B (en) * | 2017-11-30 | 2021-05-21 | 努比亚技术有限公司 | Method for outputting prompt tone by terminal, mobile terminal and computer readable storage medium |
CN107894839A (en) * | 2017-11-30 | 2018-04-10 | 努比亚技术有限公司 | Terminal exports method, mobile terminal and the computer-readable recording medium of prompt tone |
CN108091330B (en) * | 2017-12-13 | 2020-11-27 | 北京小米移动软件有限公司 | Output sound intensity adjusting method and device, electronic equipment and storage medium |
CN107888782A (en) * | 2017-12-25 | 2018-04-06 | 出门问问信息科技有限公司 | A kind of control method and device of volume |
CN110161508A (en) * | 2019-06-03 | 2019-08-23 | Oppo广东移动通信有限公司 | Distance measuring method, device, terminal and storage medium |
CN110519450B (en) | 2019-07-31 | 2021-04-09 | Oppo广东移动通信有限公司 | Ultrasonic processing method, ultrasonic processing device, electronic device, and computer-readable medium |
CN112737535A (en) * | 2019-10-28 | 2021-04-30 | 阿里巴巴集团控股有限公司 | Sound signal processing method and device |
CN111427531A (en) * | 2020-03-17 | 2020-07-17 | 北京字节跳动网络技术有限公司 | Prompting method and device and electronic equipment |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104182039A (en) * | 2014-07-29 | 2014-12-03 | 小米科技有限责任公司 | Equipment control method and device as well as electronic equipment |
CN104750489A (en) * | 2015-03-26 | 2015-07-01 | 努比亚技术有限公司 | Method and device for exiting from single-hand mode |
CN105812574A (en) * | 2016-05-03 | 2016-07-27 | 北京小米移动软件有限公司 | Volume adjusting method and device |
CN106210294A (en) * | 2016-06-30 | 2016-12-07 | 北京小米移动软件有限公司 | Screen state method for handover control and device |
CN106200989A (en) * | 2016-09-08 | 2016-12-07 | 广东小天才科技有限公司 | A kind of method and device of mobile terminal bright screen |
CN106384033A (en) * | 2016-09-29 | 2017-02-08 | 努比亚技术有限公司 | Screen off method and apparatus of terminal screen |
CN106534541A (en) * | 2016-11-15 | 2017-03-22 | 广东小天才科技有限公司 | Volume adjusting method and device and terminal equipment |
-
2017
- 2017-03-23 CN CN201710179766.4A patent/CN106980486B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104182039A (en) * | 2014-07-29 | 2014-12-03 | 小米科技有限责任公司 | Equipment control method and device as well as electronic equipment |
CN104750489A (en) * | 2015-03-26 | 2015-07-01 | 努比亚技术有限公司 | Method and device for exiting from single-hand mode |
CN105812574A (en) * | 2016-05-03 | 2016-07-27 | 北京小米移动软件有限公司 | Volume adjusting method and device |
CN106210294A (en) * | 2016-06-30 | 2016-12-07 | 北京小米移动软件有限公司 | Screen state method for handover control and device |
CN106200989A (en) * | 2016-09-08 | 2016-12-07 | 广东小天才科技有限公司 | A kind of method and device of mobile terminal bright screen |
CN106384033A (en) * | 2016-09-29 | 2017-02-08 | 努比亚技术有限公司 | Screen off method and apparatus of terminal screen |
CN106534541A (en) * | 2016-11-15 | 2017-03-22 | 广东小天才科技有限公司 | Volume adjusting method and device and terminal equipment |
Also Published As
Publication number | Publication date |
---|---|
CN106980486A (en) | 2017-07-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106980486B (en) | Method for controlling volume and device | |
CN106933366A (en) | Bright screen method and device | |
US9046415B2 (en) | Virtual detector for sensor system | |
EP2973558B1 (en) | Methods for adaptive acoustic processing based on characterising the acoustic environment | |
US20170013116A1 (en) | Method, apparatus and computer-readable medium for travel path condition prompt | |
CN104301509B (en) | Mobile terminal and its control method | |
CN106546969B (en) | The method and device of ultrasonic wave calibration | |
CN106210294B (en) | Screen state method for handover control and device | |
CN107749925B (en) | Audio playing method and device | |
CN106385290B (en) | Ultrasonic wave calibration method and device | |
CN106162478B (en) | Microphone preferred method and device | |
CN106546970B (en) | The ultrasonic wave calibration method and device of mobile device | |
US20130163768A1 (en) | Electronic device including modifiable output parameter | |
CN109656317A (en) | With the equipment apart from inducing function and apart from inducing method | |
CN108989687A (en) | camera focusing method and device | |
CN105607738B (en) | Determine the method and device of one hand pattern | |
CN108989494A (en) | A kind of electronic equipment | |
CN106772390B (en) | The device and method of distance detection | |
CN109543666A (en) | Structure light assembly control method and device | |
CN106357348B (en) | Adjust the method and device of ultrasonic wave transmission power | |
CN110290576A (en) | Control method of electronic device and device | |
CN109862169A (en) | Control method of electronic device and device | |
CN107526084A (en) | Distance measurement method and device | |
CN109116341A (en) | Method for building up, distance detection method and device, the electronic equipment of range function | |
US11861114B2 (en) | Electronic equipment, method for controlling electronic equipment, 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |