CN106980486A - Method for controlling volume and device - Google Patents

Method for controlling volume and device Download PDF

Info

Publication number
CN106980486A
CN106980486A CN201710179766.4A CN201710179766A CN106980486A CN 106980486 A CN106980486 A CN 106980486A CN 201710179766 A CN201710179766 A CN 201710179766A CN 106980486 A CN106980486 A CN 106980486A
Authority
CN
China
Prior art keywords
acoustic signals
terminal
front side
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.)
Granted
Application number
CN201710179766.4A
Other languages
Chinese (zh)
Other versions
CN106980486B (en
Inventor
张鹏
熊达蔚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201710179766.4A priority Critical patent/CN106980486B/en
Publication of CN106980486A publication Critical patent/CN106980486A/en
Application granted granted Critical
Publication of CN106980486B publication Critical patent/CN106980486B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/16Sound input; Sound output
    • G06F3/165Management 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 device, belong to field of terminal technology.Methods described includes:When sound is currently played in terminal and terminal front side is in unobstructed state, launch multiple first acoustic signals along terminal front side outwardly direction, because the second acoustic signals are the signal that first acoustic signals reach testee back reflection, therefore the distance between reception parameter detecting terminal and testee of the emission parameters of the first acoustic signals and the second acoustic signals can be passed through, and according to the distance between terminal and testee, the volume of sound to being currently played is adjusted, volume is triggered without user by predetermined registration operation to control option and then realize to control the volume of currently playing sound, so as to simplify the operation of user, improve the efficiency that terminal carries out volume control.

Description

Method for controlling volume and device
Technical field
This disclosure relates to field of terminal technology, more particularly to a kind of method for controlling volume and device.
Background technology
With the development of terminal technology, the terminal such as mobile phone, tablet personal computer can not only provide the user colourful answer With such as wechat, Alipay and drop drop are called a taxi, and corresponding operation can also be performed according to the instruction of user, such as according to user Instruction perform start, shutdown or volume control etc. operation.
In correlation technique, volume control option is generally included in the terminal, predetermined registration operation is passed through when terminal detects user When triggering volume control option, the corresponding operation of volume control option is performed.As volume control option includes increase volume Option, reduction volume option and mute option etc., when terminal, which detects user, clicks on the increase volume option, perform increase The operation of currently playing sound, when terminal, which detects user, clicks on the mute option, performs the behaviour for closing currently playing sound Make.
The content of the invention
To overcome problem present in correlation technique, present disclose provides a kind of method for controlling volume and device.The skill Art scheme is as follows:
According to the first aspect of the embodiment of the present disclosure there is provided a kind of method for controlling volume, methods described includes:
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, multiple first sound are launched along the terminal front side outwardly direction Ripple signal;
For each first acoustic signals in the multiple first acoustic signals, when receiving first acoustic signals When reaching the second acoustic signals of testee back reflection, emission parameter and the rising tone based on first acoustic signals The reception parameter of ripple signal, determines the distance between the terminal front side and described 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.
Alternatively, the emission parameter of first acoustic signals includes amplitude when first acoustic signals are launched; The reception parameter of second acoustic signals includes amplitude when second acoustic signals are received;It is described to be based on described first The reception parameter of the emission parameter of acoustic signals and second acoustic signals, determines the terminal front side and the testee The distance between, including:
Calculate amplitude when amplitude when first acoustic signals are launched is received with second acoustic signals 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.
Alternatively, when the emission parameter of first acoustic signals includes transmitting when first acoustic signals are launched Between point;The reception parameter of second acoustic signals includes reception time point when second acoustic signals are received;It is described The reception parameter of emission parameter and second acoustic signals based on first acoustic signals, determine the terminal front side with The distance between described testee, including:
Calculate when launch time point when first acoustic signals are launched is received with second acoustic signals Receive the time difference between 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.
Alternatively, the distance between at least one described terminal front side described in the basis and the testee, to working as The volume of the preceding sound played is adjusted, including:
Chosen from the distance between at least one described described terminal front side and the testee and be less than pre-determined distance Distance;
It is determined that choose distance in ultimate range and minimum range between difference;
When it is determined that difference be more than preset difference value when, reduce the volume of sound being currently played;
When it is determined that difference be not more than the preset difference value when, the volume for the sound being currently played is set to zero.
Alternatively, it is described to launch multiple first acoustic signals along the terminal front side outwardly direction, including:
By the wave sounder part of the terminal, launch multiple first sound waves along the terminal front side outwardly direction and believe Number;
Second acoustic signals for receiving the first acoustic signals arrival testee back reflection, including:
By the acoustic receiver device of the terminal, first acoustic signals reach testee back reflection the is received Two acoustic signals.
Alternatively, the wave sounder part is the receiver at the top of the terminal, and the acoustic receiver device is the end Noise reduction microphone at the top of end.
Alternatively, it is described when the terminal front side is in unobstructed state, sent out along the terminal front side outwardly direction Penetrate before multiple first acoustic signals, in addition to:
Judge whether the terminal is in horizontality;
When the terminal is in horizontality and the terminal front side is in unobstructed state, perform described along the end Rectify the step of multiple first acoustic signals are launched in the direction faced out.
According to the second aspect of the embodiment of the present disclosure there is provided a kind of sound volume control device, described device includes:
First judge module, for when sound is currently played in the terminal, judging whether the terminal front side is located In unobstructed state;
Transmitter module, for when the terminal front side is in unobstructed state, along the terminal front side outwardly direction Launch multiple first acoustic signals;
Determining module, for for each first acoustic signals in the multiple first acoustic signals, when receiving When stating the second acoustic signals of the first acoustic signals arrival testee back reflection, the transmitting ginseng based on first acoustic signals The reception parameter of number and second acoustic signals, determines the distance between the terminal front side and described testee, with To the distance between terminal front side at least one described and the testee;
Adjusting module, it is right for according to the distance between at least one described described terminal front side and described testee The volume for the sound being currently played is adjusted.
Alternatively, the emission parameter of first acoustic signals includes amplitude when first acoustic signals are launched; The reception parameter of second acoustic signals includes amplitude when second acoustic signals are received;The determining module bag Include:
First calculating sub module, believes for calculating amplitude when first acoustic signals are launched with second sound wave The amplitude difference between amplitude when number being received;
First acquisition submodule, the attenuation coefficient for obtaining amplitude in propagation process of sound wave;
First determination sub-module, for based on the amplitude difference and the attenuation coefficient, determine the terminal front side with The distance between described testee.
Alternatively, when the emission parameter of first acoustic signals includes transmitting when first acoustic signals are launched Between point;The reception parameter of second acoustic signals includes reception time point when second acoustic signals are received;It is described Determining module includes:
Second calculating sub module, for calculating the launch time point and described second when first acoustic signals are launched The time difference received between time point when acoustic signals are received;
Second acquisition submodule, the spread speed for obtaining sound wave;
Second determination sub-module, for based on the time difference and the spread speed, determine the terminal front side with The distance between described testee.
Alternatively, the adjusting module includes:
Submodule is chosen, for being selected from the distance between at least one described described terminal front side and the testee Take the distance less than pre-determined distance;
The difference between ultimate range and minimum range in 3rd determination sub-module, the distance chosen for determination;
Reduce submodule, for when it is determined that difference be more than preset difference value when, reduce the sound of sound being currently played Amount;
Set submodule, for when it is determined that difference be not more than the preset difference value when, by the sound being currently played Volume be set to zero.
Alternatively, the transmitter module is additionally operable to:
By the wave sounder part of the terminal, launch multiple first sound waves along the terminal front side outwardly direction and believe Number;
Described device also includes:
Receiving module, for the acoustic receiver device by the terminal, receives first acoustic signals and reaches tested Second acoustic signals of object back reflection.
Alternatively, the wave sounder part is the receiver at the top of the terminal, and the acoustic receiver device is the end Noise reduction microphone at the top of end.
Alternatively, described device also includes:
Second judge module, for judging whether the terminal is in horizontality;
Performing module, for when the terminal is in horizontality and the terminal front side is in unobstructed state, holding The step of capable transmitting multiple first acoustic signals along the terminal front side outwardly direction.
According to the third aspect of the embodiment of the present disclosure there is provided a kind of sound volume control device, described device includes:
Processor;
Memory for storing processor-executable instruction;
Wherein, the processor is configured as:
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, multiple first sound are launched along the terminal front side outwardly direction Ripple signal;
For each first acoustic signals in the multiple first acoustic signals, when receiving first acoustic signals When reaching the second acoustic signals of testee back reflection, emission parameter and the rising tone based on first acoustic signals The reception parameter of ripple signal, determines the distance between the terminal front side and described 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 launch multiple first acoustic signals, because the second acoustic signals are 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 the second acoustic signals 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 is triggered volume control option by predetermined registration operation without user and then is realized to currently broadcasting The volume control for the sound put, so as to simplify the operation of user, improves the efficiency that terminal carries out volume control.
It should be appreciated that the general description of the above and detailed description hereinafter are only exemplary and explanatory, not The disclosure can be limited.
Brief description of the drawings
Accompanying drawing herein is merged in specification and constitutes the part of this specification, shows the implementation for meeting the present invention Example, and for explaining principle of the invention together with specification.
Fig. 1 is a kind of flow chart of method for controlling volume according to an exemplary embodiment;
Fig. 2A is a kind of flow chart of method for controlling volume according to another exemplary embodiment;
Fig. 2 B are a kind of schematic diagrames of terminal according to an exemplary embodiment;
Fig. 2 C are a kind of decay schematic diagrames of acoustic signals amplitude according to an exemplary embodiment;
Fig. 3 A are a kind of sound volume control device block diagrams according to an exemplary embodiment;
Fig. 3 B are a kind of determining module block diagrams according to an exemplary embodiment;
Fig. 3 C are a kind of determining module block diagrams according to another exemplary embodiment;
Fig. 3 D are a kind of sound volume control device block diagrams according to another exemplary embodiment;
Fig. 3 E are a kind of sound volume control device block diagrams according to another exemplary embodiment;
Fig. 4 is a kind of sound volume control device block diagram according to another exemplary embodiment.
Embodiment
Here exemplary embodiment will be illustrated in detail, its example is illustrated in the accompanying drawings.Following description is related to During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment Described in embodiment do not represent and the consistent all embodiments of the present invention.On the contrary, they be only with it is such as appended The example of the consistent apparatus and method of some aspects be described in detail in claims, the present invention.
Before detailed explanation is carried out to the embodiment of the present disclosure, first the application scenarios of the embodiment of the present disclosure are given Introduce.Sound is currently played applied to terminal in the method for controlling volume that the embodiment of the present disclosure is provided, and user was want to the end Hold in the scene that the volume for the sound played is adjusted.
In correlation technique, when sound is currently played in terminal, user can be by predetermined registration operation triggering terminal Volume controls option, to realize the volume control to currently playing sound.Especially, for the inconvenient using terminal of user Scene such as conference scenario, terminal is 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.Now in order to avoid the prompt tone is to the meeting Other users in scene are interfered, and user, which need to first pick up mobile phone and then trigger volume by predetermined registration operation, controls option, with The control to the volume of the prompt tone is realized, namely the method for controlling volume must be by the contact between terminal and user come real It is existing, cause user's operation relatively complicated, and volume control efficiency is relatively low.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 according to an exemplary embodiment, the method for controlling volume Applied in terminal, the terminal can be used in terminal for mobile phone, tablet personal computer, computer etc..As shown in figure 1, the volume control Method processed comprises 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 each first acoustic signals in multiple first acoustic signals, when receiving first sound When ripple signal reaches the second acoustic signals 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 launch multiple first acoustic signals, because the second acoustic signals are 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 the second acoustic signals 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 is triggered volume control option by predetermined registration operation without user and then is realized to currently broadcasting The volume control for the sound put, so as to simplify the operation of user, improves the efficiency that terminal carries out volume control.
Alternatively, the amplitude when emission parameter of the first acoustic signals first acoustic signals are launched;Second sound wave is believed Number reception parameter include amplitude of second acoustic signals when being 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, including:
Calculate between amplitude when amplitude and second acoustic signals 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.
Alternatively, 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 reception time point when the second acoustic signals are received;Hair based on the first acoustic signals Parameter and the reception parameter of the second acoustic signals are penetrated, the distance between terminal front side and testee is determined, including:
Calculate reception when launch time point when first acoustic signals are launched is received with second acoustic signals 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.
Alternatively, according to the distance between at least one terminal front side and testee, to the sound being currently played Volume be adjusted, including:
The distance less than pre-determined distance is chosen from the distance between at least one terminal front side and testee;
It is determined that choose distance in ultimate range and minimum range between difference;
When it is determined that difference be more than preset difference value when, reduce the volume of sound being currently played;
When it is determined that difference be not more than the preset difference value when, the volume for the sound being currently played is set to zero.
Alternatively, multiple first acoustic signals are launched along terminal front side outwardly direction, including:
By the wave sounder part of terminal, multiple first acoustic signals are launched along terminal front side outwardly direction;
The second acoustic signals that the first acoustic signals reach testee back reflection are received, including:
By the acoustic receiver device of terminal, the second sound wave letter that the first acoustic signals reach testee back reflection is received Number.
Alternatively, wave sounder part is the receiver at the top of terminal, and acoustic receiver device is the noise reduction Mike at the top of terminal Wind.
Alternatively, when terminal front side is in unobstructed state, multiple first sound are launched along terminal front side outwardly direction Before ripple signal, in addition to:
Judge whether terminal is in horizontality;
When terminal is in horizontality and terminal front side is in unobstructed state, perform along terminal front side outwardly direction The step of launching multiple first acoustic signals.
Above-mentioned all optional technical schemes, can form the alternative embodiment of the disclosure according to any combination, and the disclosure is real Example is applied no longer to repeat this one by one.
Fig. 2A is a kind of flow chart of method for controlling volume according to another exemplary embodiment, as shown in Figure 2 A, The method for controlling volume is used in terminal, comprises the following steps.
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 prompt tone of incoming ring tone or the notification message of wechat application, this When, if being currently conference scenario, user may want to be adjusted the volume of the sound of terminal plays.In order to simplify the behaviour of user Make, the embodiment of the present disclosure provides a kind of method that just can quickly control volume close to terminal front side by hand, and this is quick 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 the state of rapid volume control module is suitably started, so as to just start rapid volume control in a suitable case Module.
First, when terminal front side is blocked, such as when terminal on the table or is installed in user's pocket by back-off When, blocked because now terminal front side has had, therefore will be unable to judge the close action of user's hand exactly again.Mirror In this, can using the unobstructed state of terminal front side as suitably open rapid volume control module state, i.e., when terminal just Face just starts rapid volume control module when being in unobstructed state.
Secondly, it is contemplated that when user is without using terminal, it will usually place terminal on the table.Just because of terminal quilt Place on the table, user is just not desired to pick up terminal from desktop and realized again by triggering volume control option to currently playing The control of the volume of sound.Moreover, when terminal is placed on the table, terminal is generally in horizontality.In consideration of it, may be used also So that terminal to be in state during level as the state for suitably opening rapid volume control module, i.e., when terminal front side is in nothing Occlusion state and in horizontality when just startup rapid volume control module.
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 angle of inclination of terminal with respect to the horizontal plane, by the inclination angle of terminal with respect to the horizontal plane Spend state when in the range of predetermined angle threshold value and be defined as horizontality.Such as, the predetermined angle threshold value may range from [- 5 °, 5 °], or [- 10 °, 10 °] etc., the embodiment of the present disclosure is not limited the predetermined angle threshold value scope.
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..
So that the first sensor is photoelectric sensor as an example, the photoelectric sensor can be only fitted to the front of the terminal, than Such as disposed in terminal front side top, such as top receiver accessory position.Photoelectric sensor be one kind can optical signal (infrared light, Visible ray and ultraviolet laser light etc.) it is changed into the sensing device of electric signal, it is generally made up of light-emitting component and sensing element, should Light-emitting component can be LED (Light Emitting Diode, light emitting diode) etc..
The Cleaning Principle of photoelectric sensor is:When the light that light-emitting component is sent be blocked thing reflect when, sensing element It can sense, it is possible to produce interruption and handle accordingly.In the embodiment of the present disclosure, when photoelectric sensor is detected by luminous The light that element is sent is blocked thing when reflecting, and indication signal can be sent to controller, to indicate that the terminal front side is in There is occlusion state.When the light sent by light-emitting component be not blocked thing reflect when, can be sent to controller instruction letter Number with indicate the terminal front side be in unobstructed state, indication signal can not also be sent to controller.
In step 202., when the terminal front side is in unobstructed state and the terminal is in horizontality, along the terminal Launch multiple first acoustic signals in the direction of right-side-out.
When the terminal front side is in unobstructed state and the terminal is in horizontality, illustrate that the terminal is not made now With and in suitably start rapid volume control module state, then now the terminal can start the rapid volume control mould Block, the first acoustic signals are launched by the rapid volume control module of startup along the terminal front side outwardly direction.
In the embodiment of the present disclosure, the rapid volume control module can be sonic sensor module, pass through sonic sensor The acoustic signals that module is sent detect the close action of user's hand, so realize user's hand close to when to currently playing The volume of sound is adjusted.Significantly, since user wants the side being adjusted to the volume of currently playing sound Formula may have a variety of, such as reduce the volume of currently playing sound or the volume of currently playing sound is set to it is Jing Yin, therefore, In the embodiment of the present disclosure, multiple first acoustic signals need to be launched, terminal judges terminal front side according to the plurality of first acoustic signals With the change of the distance between user's hand, the tune of different modes is carried out to the volume of currently playing sound according to the distance change It is whole.
Wherein, the sonic sensor module includes wave sounder part and sound wave receiving device, and sound wave can be carried out respectively Transmitting and reception, and the distance between can be judged according to transmitting and the sound wave received with shelter.It that is to say, the terminal can So that by the wave sounder part, the first acoustic signals are launched along the terminal front side outwardly direction.
In practical application, the sonic sensor module is configured in terminal tip position, for example, can be configured at top and listen Near cylinder position.It is possible to further which the sonic sensor module and above-mentioned first sensor are configured in the same area, so as to When determining that terminal front side is blocked by the first sensor, detect the terminal with blocking by the sonic sensor module The distance between thing.
Alternatively, the wave sounder part can be the receiver at the top of the terminal, and the acoustic receiver device can be the end Noise reduction microphone at the top of end.Fig. 2 B are refer to, Fig. 2 B are a kind of schematic diagrames of terminal according to an exemplary embodiment. The terminal includes wave sounder part 21 and sound wave receiving device 22.
Alternatively, first acoustic signals can be ultrasonic signal.Wherein, due to the direction signal collection of ultrasonic signal In, thus be adapted to the embodiment of the present disclosure provide along this determination direction of terminal front side outwardly direction launch acoustic signals.It is super The frequency of acoustic signals is not limited here, and frequency exceedes the side shown by the 20KHz achievable embodiment of the present disclosure of sound wave 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 During level state, exemplified by just launching multiple first acoustic signals along the terminal front side outwardly direction.And in another embodiment, when It when sound is currently played in the terminal, can also only judge whether the terminal front side is in unobstructed state, work as terminal front side During in unobstructed state, i.e., launch multiple first acoustic signals along the terminal front side outwardly direction.Such as, terminal can be Slant setting on terminal support, and terminal front side be in unobstructed state when, along the terminal front side outwardly direction launch it is many Individual first acoustic signals.
In step 203, for each first acoustic signals in multiple first acoustic signals, when receiving first sound When ripple signal reaches the second acoustic signals 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 multiple first acoustic signals are launched, for each first sound wave in the plurality of first acoustic signals Signal, first acoustic signals can be received by the acoustic receiver device of the terminal and reach the rising tone after testee reflection Ripple signal.Second acoustic signals are that the first acoustic signals run into the formation of testee back reflection, and the first acoustic signals have Identical frequency, because propagation medium residing after reflection is identical, therefore the propagation of the second acoustic signals and the first acoustic signals is fast Degree is also identical.In addition, when user wants to be adjusted the volume of currently playing sound by hand motion, the testee can Think user's hand.
Alternatively, the acoustic receiver device is the noise reduction microphone at the top of terminal.The position of the acoustic receiver device herein Position with the wave sounder part in step 202 is corresponding, the scheme measuring accuracy provided due to the embodiment of the present disclosure The order of magnitude is that Centimeter Level and ultrasonic wave can be considered as along straightline propagation when measuring short distance, thus design the wave sounder part and During the position of the acoustic receiver device, should by the installation site between it as close to.Alternatively, the wave sounder part and Scope of the distance between the acoustic receiver device within one centimetre.
Wherein, the reception parameter of emission parameter and second acoustic signals based on first acoustic signals, determines the end Rectify face and the implementation of the distance between the testee, can include following two:
The first implementation:The emission parameter of first acoustic signals includes shaking when first acoustic signals are launched Width;The reception parameter of second acoustic signals includes amplitude when second acoustic signals are received;First sound wave should be based on The reception parameter of the emission parameter of signal and second acoustic signals, determines the distance between the terminal front side and the testee Comprise the following steps 1) -3):
1) calculate between amplitude when amplitude and second acoustic signals when first acoustic signals are launched are received Amplitude difference.
When acoustic signals are propagated in medium (air), the decay of energy is decided by the diffusion of acoustic signals, scattering and inhaled Receive.In perfect medium, the decay of sound wave comes solely from the diffusion of sound wave, i.e., the distance propagated with acoustic signals increases and caused The decrease of sonic energy signal.When scatter attenuation refers to that ultrasonic wave is propagated in media as well, granular boundary or stream in solid dielectric Suspended particles in body medium make sound wave produce diffraction, and a portion acoustic energy is no longer moved along the original direction of propagation, and is formed Scattering.Scatter attenuation is relevant with the property of the shape of scattering particles, size, quantity, the property of medium and scattering particles.Absorption declines It is due to medium viscosity to subtract, and ultrasonic wave is caused the interior friction between particle when propagating in media as well, so that a part of acoustic energy Heat energy is converted to, heat exchange is carried out by heat transfer, causes the loss of sonic energy signal.
Fig. 2 C are refer to, Fig. 2 C are a kind of decay signals of acoustic signals amplitude 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 represents the amplitude of acoustic signals, D Represent 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 Plant the graphical of damped manner to schematically illustrate, restriction is not formed to it.
When first acoustic signals are launched, its emission parameter will be recorded in the terminal., should in the first implementation Emission parameter includes amplitude when the first acoustic signals are launched, the mean amplitude of tide when amplitude can be the transmitting of the first acoustic signals Value, or or the first acoustic signals start emission time instantaneous amplitude value.Similarly, the second acoustic signals are connect In the time receiving, it receives parameter and will be recorded in the terminal.In the first implementation, the reception parameter includes the second acoustic signals Reception when amplitude, the amplitude can be average amplitude value when the second acoustic signals are received, or can also be the rising tone Ripple signal is terminating the instantaneous amplitude value of the time of reception.
So that the first acoustic signals that wave sounder part is launched are 96KHz ultrasonic signals 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 atmosphere, the ultrasonic signal it is flat Equal acoustic density is also gradually reduced.Therefore, the amplitude for the second acoustic signals that acoustic receiver device is received and the first sound wave are believed Number the distance that is propagated through of amplitude variations difference and above-mentioned two acoustic signals into positive correlation.The amplitude of second acoustic signals with The amplitude variations difference of first acoustic signals is bigger, and terminal and the distance between testee are longer.
2) attenuation coefficient of amplitude in propagation process of sound wave is obtained.
Wherein, terminal can obtain the ambient parameter of terminal surrounding by the environmental sensor in the terminal, according to environment The attenuation coefficient of amplitude in parameter acquiring propagation process of sound wave.The ambient parameter is included 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 media as well depends on attenuation coefficient when sound wave is propagated in the medium, and this declines Subtract the factors such as coefficient and the material, temperature and density of medium relevant.In the disclosed embodiments, the first acoustic signals and second Acoustic signals are propagated in atmosphere, and for air, it influences the factor of the attenuation coefficient of sonic wave amplitude mainly to include Temperature, air humidity and air pressure etc..
Therefore, in the disclosed embodiments, terminal can first by environmental sensor obtain terminal surrounding include temperature, The ambient parameter such as air humidity and air pressure.Afterwards, 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 the corresponding relation pre-set.
Attenuation coefficient can be obtained according to said temperature, three measured values of air humidity and air pressure, can also be according to it In at least one measured value obtain.Attenuation coefficient is not surveyed in addition in the case of being obtained according to wherein at least one measured value Preset value can be used in the ambient parameter of amount.For example, only measuring temperature, then air humidity is corresponding with air pressure 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, terminal prestores a list, and attenuation coefficient, amplitude are included in the list Corresponding relation between three kinds away from the distance between terminal front side data of difference and testee, declines in the list processing method It is continuous value to subtract coefficient and amplitude difference, with ensure a pair of attenuation coefficients and amplitude difference data can correspond to find by Object is surveyed away from the distance between terminal front side.
A user is prestored 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, the algorithm can be recorded 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 shaken Width difference, you can to obtain testee away from the distance between terminal front side.
In another method in the cards, terminal can be changed according to the amplitudes of first acoustic signals according to correlation Calculation relation, obtains the acoustic pressure and the sound intensity of the first acoustic signals, and according to the amplitude of the second acoustic signals, according to related conversion relation The acoustic pressure and the sound intensity of the second acoustic signals 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 the second acoustic signals;I1It is the first acoustic signals The sound intensity, I2It is the acoustic pressure of the second acoustic signals;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) testee can be drawn away from the distance between terminal front side x.
Alternatively, the terminal can be measured by continuously sending continual acoustic signals by multiple acoustic signals Aggregation of data draws testee away from the distance between terminal front side.For example, by determined in nearest a period of time it is multiple away from Averaged from value, as testee away from the distance between terminal front side.
In a possible embodiment, addition is marked in each acoustic signals that terminal is sent, when terminal is received During the second acoustic signals, you can the mark in the second acoustic signals received is corresponding with each acoustic signals sent. For example, the mark for the acoustic signals institute band that terminal is continuously sent is respectively: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.Such as terminal is A in emission mark1Sound One group of parameter is have recorded during ripple signal, and A is labeled as receiving1Acoustic signals when have recorded another group of data, now this two Group data are corresponding data, using this two groups of corresponding datas a testee can be drawn away from the distance between terminal front side.
At the same time, parameter when parameter when terminal launches the acoustic signals of other marks and reception is corresponded, 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, continuous continual acoustic signals is utilized to reach Testee is measured away from the distance between terminal front side, it is to avoid brought when being interfered because of indivedual sound waves to whole measurement result 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 second acoustic signals includes reception time point when second acoustic signals are received;The base In the emission parameter and the reception parameter of second acoustic signals of first acoustic signals, the terminal front side and the measured object are determined The distance between body comprises the following steps 1) -3):
1) connecing when launch time point when first acoustic signals are launched is received with second acoustic signals is calculated Receive the time difference between time point.
When first acoustic signals are launched, its emission parameter will be recorded in the terminal., should in second of implementation Emission parameter includes the launch time point during transmitting of the first acoustic signals.Similarly, when the second acoustic signals are received, it is received Parameter will be also recorded in the terminal.In second of implementation, when the reception parameter is received including the second acoustic signals Reception time point.
Reception time when being received according to the launch time point and the second acoustic signals during the transmitting of the first acoustic signals The difference of point, you can obtain time difference T.
2) spread speed of sound wave is obtained.
Wherein, terminal can obtain the ambient parameter of terminal surrounding by the environmental sensor in terminal, be joined according to environment Number obtains the spread speed of sound wave.The ambient parameter includes at least one of temperature, air humidity or air pressure.
Temperature, air humidity or effects of air pressure atmospheric density, and the aerial propagation speed of atmospheric density influence sound wave Degree, the spread speed of the more high then ultrasonic wave of density of air is faster, so the spread speed for wanting to obtain sound wave need to be first passed through Environmental sensor obtains ambient parameter.In measurement including after the ambient parameter including temperature, air humidity or air pressure, you can it is determined that First acoustic signals and the aerial spread speed V of the second acoustic signals.
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 represents testee away from the distance between terminal, and T represents the launch time point and of the first acoustic signals The difference at the reception time point of two acoustic signals, V represents the first acoustic signals and the aerial propagation speed of the second acoustic signals Degree.
It should be noted that for each first acoustic signals in the plurality of first acoustic signals, terminal can pass through Any distance to determine terminal and testee of above two implementation, can also be realized using above two simultaneously Mode determines to be not specifically limited herein in the distance of terminal and testee, 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 is received Signal is the transmission signal for having launched first acoustic signals in multiple first acoustic signals, namely each second sound wave letter Number there is its corresponding first acoustic signals, therefore, in the disclosed embodiments, need to take measures to believe the plurality of first sound wave Number make a distinction.
In a possible embodiment, addition is marked in each first acoustic signals that terminal is sent, and works as terminal When receiving the second acoustic signals, you can by the mark in the second acoustic signals received and each first acoustic signals sent It is corresponding, and reception parameter and the emission parameter of corresponding first acoustic signals according to the second acoustic signals received, really Determine the distance between terminal and testee.For example, the mark for the first acoustic signals institute band that terminal is continuously sent is respectively: A1、A2、A3……An, then can be according to A during terminal the second acoustic signals of reception1、A2、A3……AnDeng mark with launching First acoustic signals are corresponding.Such as terminal is A in emission mark1The first acoustic signals when have recorded one group of parameter, and Receive and be labeled as A1The second acoustic signals when have recorded another group of data, now this two groups of data be corresponding data, utilize this Two groups of corresponding datas can draw a testee away from the distance between terminal front side by above two implementation.Work as end End multiple first acoustic signals are performed both by the above operation when, can obtain one group of testee away between terminal front side away from From, namely obtain the distance between 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.
, can be according at least one terminal when terminal obtains the distance between at least one terminal front side and testee Front determines the change of the distance between testee and terminal front side the distance between with testee, then according to should be away from From change, the volume of the sound to being currently played is adjusted.That is, from least one terminal front side and measured object The distance less than pre-determined distance is chosen in the distance between body, it is determined that between the ultimate range and minimum range in the distance chosen Difference, when it is determined that difference be more than preset difference value when, reduce the volume of sound being currently played, when it is determined that difference not During more than the preset difference value, the volume for the sound being currently played is set to zero.
Wherein, pre-determined distance is the distance that pre-sets in terminal, namely only between testee and terminal front side , 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, it is to avoid because the operation of user necessarily causes the volume of the currently playing sound of terminal-pair to be adjusted, improved The precision of terminal control volume.
In addition, preset difference value is the distance difference pre-set, the preset difference value may be used to indicate that testee and end End the distance between whether changed, when it is determined that difference be more than preset difference value when, show now testee and terminal The distance between exist change, when it is determined that 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 the distance between testee and terminal do not change in pre-determined distance When, the volume for the sound being currently played is set to zero.
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 launch multiple first acoustic signals, because the second acoustic signals are 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 the second acoustic signals 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 is triggered volume control option by predetermined registration operation without user and then is realized to currently broadcasting The volume control for the sound put, so as to simplify the operation of user, improves the efficiency that terminal carries out volume control.Especially, When testee is user's hand, by user's hand close to terminal front side, you can realize the volume to currently playing sound Quick control.
Fig. 3 A are a kind of block diagrams of sound volume control device 300 according to an exemplary embodiment.Referring to Fig. 3 A, the dress Put including the first judge module 301, transmitter module 302, determining module 303 and adjusting module 304.
First judge module 301, for when sound is currently played in terminal, judging whether terminal front side is in without screening Gear state;
Transmitter module 302, for when terminal front side is in unobstructed state, launching many along terminal front side outwardly direction Individual first acoustic signals;
Determining module 303, for for each first acoustic signals in the plurality of first acoustic signals, when receiving this When first acoustic signals reach the second acoustic signals of testee back reflection, emission parameter based on first acoustic signals and The reception parameter of second acoustic signals, determines the distance between the terminal front side and the testee, to obtain at least one The distance between terminal front side and testee;
Adjusting module 304, 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.
Alternatively, referring to Fig. 3 B, the emission parameter of first acoustic signals is included when first acoustic signals are launched Amplitude;The reception parameter of second acoustic signals includes amplitude when second acoustic signals are received;The determining module 303 is wrapped Include:
First calculating sub module 3031, believes for calculating amplitude when first acoustic signals are launched with second sound wave The amplitude difference between amplitude when number being received;
First acquisition submodule 3032, the attenuation coefficient for obtaining amplitude in propagation process of sound wave;
First determination sub-module 3033, for based on the amplitude difference and the attenuation coefficient, determining the terminal front side with being somebody's turn to do The distance between testee.
Alternatively, referring to Fig. 3 C, the emission parameter of first acoustic signals is included when first acoustic signals are launched Launch time point;The reception parameter of second acoustic signals includes reception time point when second acoustic signals are received;Should Determining module 303 includes:
Second calculating sub module 3034, for calculate launch time point when first acoustic signals are launched with this second The time difference received between time point when acoustic signals are received;
Second acquisition submodule 3035, the spread speed for obtaining sound wave;
Second determination sub-module 3036, for based on the time difference and the spread speed, determining the terminal front side with being somebody's turn to do The distance between testee.
Alternatively, the adjusting module 304 includes:
Submodule is chosen, is less than for being chosen in the distance between at least one terminal front side from this and the testee The distance of pre-determined distance;
The difference between ultimate range and minimum range in 3rd determination sub-module, the distance chosen for determination;
Reduce submodule, for when it is determined that difference be more than preset difference value when, reduce the sound of sound being currently played Amount;
Set submodule, for when it is determined that difference be not more than the preset difference value when, by the sound being currently played Volume is set to zero.
Alternatively, referring to Fig. 3 D, the transmitter module 302 is used for:
By the wave sounder part of the terminal, multiple first acoustic signals are launched along the terminal front side outwardly direction;
The device 300 also includes:
Receiving module 305, for the acoustic receiver device by the terminal, receives the first acoustic signals and reaches testee Second acoustic signals of back reflection.
Alternatively, the wave sounder part is the receiver at the top of the terminal, and the acoustic receiver device is at the top of the terminal Noise reduction microphone.
Alternatively, referring to Fig. 3 E, the device 300 also includes:
Second judge module 306, for judging whether the terminal is in horizontality;
Performing module 307, for when the terminal is in horizontality and the terminal front side is in unobstructed state, performing The step of launching 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 launch multiple first acoustic signals, because the second acoustic signals are 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 the second acoustic signals 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 is triggered volume control option by predetermined registration operation without user and then is realized to currently broadcasting The volume control for the sound put, so as to simplify the operation of user, improves the efficiency that terminal carries out volume control.
On the device in above-described embodiment, wherein modules perform the concrete mode of operation in relevant this method Embodiment in be described in detail, explanation will be not set forth in detail herein.
Fig. 4 is a kind of block diagram of device 400 controlled for volume according to an exemplary embodiment.For example, dress It can be mobile phone, computer, messaging devices, game console, tablet device, Medical Devices, body-building equipment to put 400 Deng.
Reference picture 4, device 400 can include following one or more assemblies:Processing assembly 402, memory 404, power supply Component 406, multimedia groupware 408, audio-frequency assembly 410, the interface 412 of input/output (I/O), sensor cluster 414, and Communication component 416.
The integrated operation of the usual control device 400 of processing assembly 402, such as with display, call, data communication, phase Machine operates the operation associated with record operation.Processing assembly 402 can refer to including one or more processors 420 to perform Order, to complete all or part of step of above-mentioned method.In addition, processing assembly 402 can include one or more modules, just Interaction between processing assembly 402 and other assemblies.For example, processing assembly 402 can include multi-media module, it is many to facilitate Interaction between media component 408 and processing assembly 402.
Memory 404 is configured as storing various types of data supporting the operation in device 400.These data are shown Example includes the instruction of any application program or method for being operated on device 400, and contact data, 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 Close and realize, such as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM) is erasable to compile Journey read-only storage (EPROM), programmable read only memory (PROM), read-only storage (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 can include power management system System, one or more power supplys, and other components associated with generating, managing and distributing power supply for device 400.
Multimedia groupware 408 is included in the screen of one output interface of offer between described device 400 and user.One In a little embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen Curtain may be implemented as touch-screen, to receive the input signal from user.Touch panel includes one or more touch sensings Device is with the gesture on sensing touch, slip and touch panel.The touch sensor can not only sensing touch or sliding action Border, but also detection touches or slide related duration and pressure with described.In certain embodiments, many matchmakers Body component 408 includes a front camera and/or rear camera.When device 400 be in operator scheme, such as screening-mode or During video mode, front camera and/or rear camera can receive the multi-medium data of outside.Each front camera and Rear camera can be a fixed optical lens system or with focusing and optical zoom capabilities.
Audio-frequency assembly 410 is configured as output and/or input audio signal.For example, audio-frequency assembly 410 includes a Mike Wind (MIC), when device 400 be in operator scheme, when such as call model, logging mode and speech recognition mode, microphone by with It is set to reception external audio signal.The audio signal received can be further stored in memory 404 or via communication set Part 416 is sent.In certain embodiments, audio-frequency assembly 410 also includes a loudspeaker, for exports audio signal.
I/O interfaces 412 is provide interface between processing assembly 402 and peripheral interface module, above-mentioned peripheral interface module can To be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button and lock Determine button.
Sensor cluster 414 includes one or more sensors, and the state for providing various aspects for device 400 is commented Estimate.For example, sensor cluster 414 can detect opening/closed mode of device 400, the relative positioning of component is for example described Component is the display and keypad of device 400, and sensor cluster 414 can be with 400 1 components of detection means 400 or device Position change, the existence or non-existence that user contacts with device 400, the orientation of device 400 or acceleration/deceleration and device 400 Temperature change.Sensor cluster 414 can include proximity transducer, be configured to detect in not any physical contact The presence of neighbouring object.Sensor cluster 414 can also include optical sensor, such as CMOS or ccd image sensor, for into As being used in application.In certain embodiments, the sensor cluster 414 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 combinations thereof.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 also includes near-field communication (NFC) module, to promote junction service.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 circuits (ASIC), numeral Number processor (DSP), digital signal processing appts (DSPD), PLD (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for performing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instructing, example are additionally provided Such as include the memory 404 of instruction, above-mentioned instruction can be performed to complete the above method by the processor 420 of device 400.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 will readily occur to its of the present invention after considering specification and putting into practice invention disclosed herein Its embodiment.The application be intended to the present invention any modification, purposes or adaptations, these modifications, purposes or Person's adaptations follow the general principle of the present invention and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.Description and embodiments are considered only as exemplary, and true scope and spirit of the invention are by following Claim is pointed out.
It should be appreciated that the invention is not limited in the precision architecture for being described above and being shown in the drawings, and And various modifications and changes can be being carried out without departing from the scope.The scope of the present invention is only limited by appended claim.

Claims (15)

1. a kind of method for controlling volume, it is characterised in that applied in terminal, methods described includes:
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, launches multiple first sound waves along the terminal front side outwardly direction and believe Number;
For each first acoustic signals in the multiple first acoustic signals, reached when receiving first acoustic signals During the second acoustic signals 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 described testee are determined, to obtain at least one described terminal The distance between positive and described testee;
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.
2. according to the method described in claim 1, it is characterised in that the emission parameter of first acoustic signals includes described the Amplitude when one acoustic signals are launched;The reception parameter of second acoustic signals is received including second acoustic signals When amplitude;The reception parameter of the emission parameter based on first acoustic signals and second acoustic signals, it is determined that The distance between the terminal front side and the testee, including:
Calculate between amplitude when amplitude and second acoustic signals 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 described testee are determined.
3. according to the method described in claim 1, it is characterised in that the emission parameter of first acoustic signals includes described the Launch time point when one acoustic signals are launched;The reception parameter of second acoustic signals includes second acoustic signals Reception time point when being received;The emission parameter based on first acoustic signals and second acoustic signals connect Parameter is received, the distance between the terminal front side and described testee is determined, including:
Calculate reception when launch time point when first acoustic signals are launched is received with second acoustic signals 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 described testee are determined.
4. according to the method described in claim 1, it is characterised in that at least one described terminal front side and institute described in the basis The distance between testee is stated, the volume of the sound to being currently played is adjusted, including:
Chosen from the distance between at least one described described terminal front side and described testee less than pre-determined distance away from From;
It is determined that choose distance in ultimate range and minimum range between difference;
When it is determined that difference be more than preset difference value when, reduce the volume of sound being currently played;
When it is determined that difference be not more than the preset difference value when, the volume for the sound being currently played is set to zero.
5. according to the method described in claim 1, it is characterised in that described to launch multiple along the terminal front side outwardly direction First acoustic signals, including:
By the wave sounder part of the terminal, multiple first acoustic signals are launched along the terminal front side outwardly direction;
Second acoustic signals for receiving the first acoustic signals arrival testee back reflection, including:
By the acoustic receiver device of the terminal, the rising tone that first acoustic signals reach testee back reflection is received Ripple signal.
6. method according to claim 5, it is characterised in that the wave sounder part is listening at the top of the terminal Cylinder, the acoustic receiver device is the noise reduction microphone at the top of the terminal.
7. the method as described in claim 1-6 is any, it is characterised in that described when the terminal front side is in unobstructed state When, before launching multiple first acoustic signals along the terminal front side outwardly direction, in addition to:
Judge whether the terminal is in horizontality;
When the terminal, which is in horizontality and the terminal front side, is in unobstructed state, perform it is described along the terminal just The step of multiple first acoustic signals are launched in the direction faced out.
8. a kind of sound volume control device, it is characterised in that applied in terminal, described device includes:
First judge module, for when sound is currently played in the terminal, judging whether the terminal front side is in nothing Occlusion state;
Transmitter module, for when the terminal front side is in unobstructed state, launching along the terminal front side outwardly direction Multiple first acoustic signals;
Determining module, for for each first acoustic signals in the multiple first acoustic signals, when receiving described When one acoustic signals reach the second acoustic signals of testee back reflection, emission parameter based on first acoustic signals and The reception parameter of second acoustic signals, determines the distance between the terminal front side and described testee, with obtain to The distance between a few terminal front side and the testee;
Adjusting module, for according to the distance between at least one described described terminal front side and described testee, to current The volume for the sound played is adjusted.
9. device according to claim 8, it is characterised in that the emission parameter of first acoustic signals includes described the Amplitude when one acoustic signals are launched;The reception parameter of second acoustic signals is received including second acoustic signals When amplitude;The determining module includes:
First calculating sub module, for calculating amplitude when first acoustic signals are launched and the second acoustic signals quilt The amplitude difference between amplitude during reception;
First acquisition submodule, the attenuation coefficient for obtaining amplitude in propagation process of sound wave;
First determination sub-module, for based on the amplitude difference and the attenuation coefficient, determine the terminal front side with it is described The distance between testee.
10. device according to claim 8, it is characterised in that the emission parameter of first acoustic signals includes described Launch time point when first acoustic signals are launched;The reception parameter of second acoustic signals is believed including second sound wave Reception time point when number being received;The determining module includes:
Second calculating sub module, for calculating launch time point when first acoustic signals are launched and second sound wave The time difference received between time point when signal is received;
Second acquisition submodule, the spread speed for obtaining sound wave;
Second determination sub-module, for based on the time difference and the spread speed, determine the terminal front side with it is described The distance between testee.
11. device according to claim 8, it is characterised in that the adjusting module includes:
Submodule is chosen, for choosing small from the distance between at least one described described terminal front side and described testee In the distance of pre-determined distance;
The difference between ultimate range and minimum range in 3rd determination sub-module, the distance chosen for determination;
Reduce submodule, for when it is determined that difference be more than preset difference value when, reduce the volume of sound being currently played;
Set submodule, for when it is determined that difference be not more than the preset difference value when, by the sound for the sound being currently played Amount is set to zero.
12. device according to claim 8, it is characterised in that the transmitter module is additionally operable to:
By the wave sounder part of the terminal, multiple first acoustic signals are launched along the terminal front side outwardly direction;
Described device also includes:
Receiving module, for the acoustic receiver device by the terminal, receives first acoustic signals and reaches testee Second acoustic signals of back reflection.
13. device according to claim 12, it is characterised in that the wave sounder part is listening at the top of the terminal Cylinder, the acoustic receiver device is the noise reduction microphone at the top of the terminal.
14. the device as described in claim 8-13 is any, it is characterised in that described device also includes:
Second judge module, for judging whether the terminal is in horizontality;
Performing module, for when the terminal is in horizontality and the terminal front side is in unobstructed state, performing institute The step of stating along terminal front side outwardly direction transmitting multiple first acoustic signals.
15. a kind of sound volume control device, it is characterised in that described device includes:
Processor;
Memory for storing processor-executable instruction;
Wherein, the processor is configured as:
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, launches multiple first sound waves along the terminal front side outwardly direction and believe Number;
For each first acoustic signals in the multiple first acoustic signals, reached when receiving first acoustic signals During the second acoustic signals 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 described testee are determined, to obtain at least one described terminal The distance between positive and described testee;
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.
CN201710179766.4A 2017-03-23 2017-03-23 Method for controlling volume and device Active CN106980486B (en)

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 true CN106980486A (en) 2017-07-25
CN106980486B 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)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107613128A (en) * 2017-09-26 2018-01-19 努比亚技术有限公司 A kind of volume adjusting method, terminal and computer-readable recording medium
CN107888782A (en) * 2017-12-25 2018-04-06 出门问问信息科技有限公司 A kind of control method and device of volume
CN107894839A (en) * 2017-11-30 2018-04-10 努比亚技术有限公司 Terminal exports method, mobile terminal and the computer-readable recording medium of prompt tone
CN107995365A (en) * 2017-11-30 2018-05-04 努比亚技术有限公司 Terminal exports method, mobile terminal and the computer-readable recording medium of prompt tone
CN108040174A (en) * 2017-11-30 2018-05-15 努比亚技术有限公司 Incoming call prompting sound method for regulation of sound volume, mobile terminal and storage medium
CN108091330A (en) * 2017-12-13 2018-05-29 北京小米移动软件有限公司 Output sound intensity adjusting method, device, electronic equipment and storage medium
CN110161508A (en) * 2019-06-03 2019-08-23 Oppo广东移动通信有限公司 Distance measuring method, device, terminal and storage medium
CN110519450A (en) * 2019-07-31 2019-11-29 Oppo广东移动通信有限公司 Ultrasonic processing method, device, electronic equipment and computer-readable medium
CN111427531A (en) * 2020-03-17 2020-07-17 北京字节跳动网络技术有限公司 Prompting method and device and electronic equipment
CN112737535A (en) * 2019-10-28 2021-04-30 阿里巴巴集团控股有限公司 Sound signal processing method and device

Citations (7)

* Cited by examiner, † Cited by third party
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

Patent Citations (7)

* Cited by examiner, † Cited by third party
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

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107613128A (en) * 2017-09-26 2018-01-19 努比亚技术有限公司 A kind of volume adjusting method, terminal and computer-readable recording medium
CN107613128B (en) * 2017-09-26 2020-06-26 努比亚技术有限公司 Volume adjusting method, terminal and computer readable storage medium
CN108040174A (en) * 2017-11-30 2018-05-15 努比亚技术有限公司 Incoming call prompting sound method for regulation of sound volume, mobile terminal and storage medium
CN108040174B (en) * 2017-11-30 2021-07-23 努比亚技术有限公司 Incoming call prompt tone volume adjusting method, mobile terminal and storage medium
CN107894839A (en) * 2017-11-30 2018-04-10 努比亚技术有限公司 Terminal exports method, mobile terminal and the computer-readable recording medium of prompt tone
CN107995365A (en) * 2017-11-30 2018-05-04 努比亚技术有限公司 Terminal exports method, mobile terminal and the computer-readable recording medium of prompt tone
CN107995365B (en) * 2017-11-30 2021-05-21 努比亚技术有限公司 Method for outputting prompt tone by terminal, mobile terminal and computer readable storage medium
CN108091330A (en) * 2017-12-13 2018-05-29 北京小米移动软件有限公司 Output sound intensity adjusting method, device, electronic equipment and storage medium
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
CN110519450A (en) * 2019-07-31 2019-11-29 Oppo广东移动通信有限公司 Ultrasonic processing method, device, electronic equipment and computer-readable medium
US11777615B2 (en) 2019-07-31 2023-10-03 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Ultrasonic processing method, electronic device, and computer-readable 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

Also Published As

Publication number Publication date
CN106980486B (en) 2019-12-03

Similar Documents

Publication Publication Date Title
CN106980486B (en) Method for controlling volume and device
CN106933366A (en) Bright screen method and device
CN105451111B (en) Earphone control method for playing back, device and terminal
US20170126192A1 (en) Method, device, and computer-readable medium for adjusting volume
CN106546969B (en) The method and device of ultrasonic wave calibration
CN104301509B (en) Mobile terminal and its control method
KR20140118060A (en) Portable teriminal and sound output apparatus and method for providing locations of sound sources in the portable teriminal
CN106210294B (en) Screen state method for handover control and device
CN105139576A (en) Road condition prompting method and device
CN107749925A (en) Audio frequency playing method and device
CN106546970B (en) The ultrasonic wave calibration method and device of mobile device
CN107908275A (en) Control method, mobile terminal and the storage medium of mobile terminal
CN105607738B (en) Determine the method and device of one hand pattern
CN108989494A (en) A kind of electronic equipment
CN108076199A (en) The air-tightness detection method and device of microphone
CN108733535A (en) Clean method and device, the electronic equipment of electronic equipment Air Filter
CN106772390B (en) The device and method of distance detection
CN106357348B (en) Adjust the method and device of ultrasonic wave transmission power
CN107526084A (en) Distance measurement method and device
CN109543666A (en) Structure light assembly control method and device
CN105841297B (en) Control the method and device of operational mode
CN107526510A (en) sound playing method and device
CN106454494B (en) Processing method, system, multimedia equipment and the terminal device of multimedia messages
CN109116341A (en) Method for building up, distance detection method and device, the electronic equipment of range function
CN109769191A (en) Audio output detection method and device, electronic equipment

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