CN109240642A - A kind of method for regulation of sound volume of terminal device, device and terminal device - Google Patents

A kind of method for regulation of sound volume of terminal device, device and terminal device Download PDF

Info

Publication number
CN109240642A
CN109240642A CN201811124110.3A CN201811124110A CN109240642A CN 109240642 A CN109240642 A CN 109240642A CN 201811124110 A CN201811124110 A CN 201811124110A CN 109240642 A CN109240642 A CN 109240642A
Authority
CN
China
Prior art keywords
earphone
volume
terminal device
state
presently
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
CN201811124110.3A
Other languages
Chinese (zh)
Other versions
CN109240642B (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.)
Shenzhen City Wang Keming Communication Software Co Ltd
Original Assignee
Shenzhen City Wang Keming Communication 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 Shenzhen City Wang Keming Communication Software Co Ltd filed Critical Shenzhen City Wang Keming Communication Software Co Ltd
Priority to CN201811124110.3A priority Critical patent/CN109240642B/en
Publication of CN109240642A publication Critical patent/CN109240642A/en
Application granted granted Critical
Publication of CN109240642B publication Critical patent/CN109240642B/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
    • 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/162Interface to dedicated audio devices, e.g. audio drivers, interface to CODECs

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)
  • Circuit For Audible Band Transducer (AREA)

Abstract

This application discloses a kind of method for regulation of sound volume of terminal device, device, terminal device and computer readable storage mediums, wherein the method for regulation of sound volume includes: to sample according to voltage signal and current signal of the scheduled sample frequency to earphone interface;The impedance characteristic information of earphone speaker is calculated based on sampled result;State is presently according to earphone described in the impedance characteristic acquisition of information of the earphone speaker;The volume that state adjusts the terminal device is presently according to the earphone.So as to avoid in the case where the currently playing volume of terminal device is very big, earphone is inserted directly into the earphone interface of terminal device, human ear hearing is caused to damage since earpiece volume is excessive.

Description

A kind of method for regulation of sound volume of terminal device, device and terminal device
Technical field
The application belongs to field of terminal technology more particularly to a kind of method for regulation of sound volume of terminal device, device, terminal are set Standby and computer readable storage medium.
Background technique
With the fast development of the multimedia technology of mobile terminal, people get used on mobile phone listening to music and seeing view Frequently, the application of earphone is also more and more frequent therefore also most important by the real-time monitoring to earphone.For example, due to mobile phone Loudspeaker is small in size, and volume is small, therefore under outer mode playback, and people usually get used to for the volume of mobile phone being transferred to very greatly, at this In the case of kind, if earphone is inserted directly into mobile phone, the volume that earphone still maintains like, and big volume will make human ear hearing At damage.
Summary of the invention
In view of this, this application provides a kind of method for regulation of sound volume of terminal device, device, terminal device and computers Readable storage medium storing program for executing solves the problems, such as that existing terminal device be easy to cause human ear hearing impairment when playing audio.
The first aspect of the application provides a kind of method for regulation of sound volume of terminal device, and above-mentioned volume method includes:
It is sampled according to voltage signal and current signal of the scheduled sample frequency to earphone interface;
The impedance characteristic information of earphone speaker is calculated based on sampled result;
State is presently according to earphone described in the impedance characteristic acquisition of information of the earphone speaker;
The volume that state adjusts the terminal device is presently according to the earphone.
The second aspect of the application provides a kind of volume adjusting apparatus of terminal device, and above-mentioned apparatus includes:
Sampling unit, for being adopted according to voltage signal and current signal of the scheduled sample frequency to earphone interface Sample;
Impedance characteristic computing unit, for calculating the impedance characteristic information of earphone speaker based on sampled result;
Earphone is presently in state acquiring unit, for described in the impedance characteristic acquisition of information according to the earphone speaker Earphone is presently in state;
Volume adjustment unit, for being presently in the volume that state adjusts the terminal device according to the earphone.
The third aspect of the application provides a kind of terminal device, above-mentioned terminal device include memory, processor and It is stored in the computer program that can be run in above-mentioned memory and on above-mentioned processor, above-mentioned processor executes above-mentioned computer The step of method of first aspect as above is realized when program.
The fourth aspect of the application provides a kind of computer readable storage medium, and above-mentioned computer readable storage medium is deposited Computer program is contained, above-mentioned computer program realizes the method for first aspect as above when being executed by processor the step of.
The 5th aspect of the application provides a kind of computer program product, and above-mentioned computer program product includes computer Program, when above-mentioned computer program is executed by one or more processors the step of the realization such as method of above-mentioned first aspect.
Therefore sampled in application scheme by the voltage signal and current signal that are fed back to earphone interface, It calculates the impedance characteristic information of the earphone speaker of access terminal equipment in real time based on voltage signal and current signal, is based on institute It states impedance characteristic information and judges earphone current state, and state is presently according to earphone, the volume of terminal device is adjusted It is whole, so as to avoid in the case where the currently playing volume of terminal device is very big, earphone is inserted directly into the earphone of terminal device Interface causes to damage since earpiece volume is excessive to human ear hearing.
Detailed description of the invention
It in order to more clearly explain the technical solutions in the embodiments of the present application, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only some of the application Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of implementation process schematic diagram of the method for regulation of sound volume of terminal device provided by the embodiments of the present application;
Fig. 2 is ante-chamber structural schematic diagram provided by the embodiments of the present application;
Fig. 3 is impedance-frequency curve synoptic diagram provided by the embodiments of the present application;
Fig. 4 is a kind of structural block diagram of the volume adjusting apparatus of terminal device provided by the embodiments of the present application;
Fig. 5 is the schematic diagram of mobile terminal provided by the embodiments of the present application.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, so as to provide a thorough understanding of the present application embodiment.However, it will be clear to one skilled in the art that there is no these specific The application also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, so as not to obscure the description of the present application with unnecessary details.
In order to illustrate the above-mentioned technical solution of the application, the following is a description of specific embodiments.
Embodiment one
A kind of method for regulation of sound volume of terminal device provided by the embodiments of the present application is described below, the application is signified Terminal device be the electronic equipment with audio playing function, it is preferable that the terminal device has loudspeaker module, can be with Audio external play is carried out by the loudspeaker module.Above-mentioned terminal device for example may is that smart phone, tablet computer, desktop Brain or wearable electronic equipment.Referring to Fig. 1, the method for regulation of sound volume in the embodiment of the present application includes:
In step s101, it is adopted according to voltage signal and current signal of the scheduled sample frequency to earphone interface Sample.
In the embodiment of the present application, terminal device has the earphone interface with earphone wired connection, and the earphone interface is usual Using the form of earphone jack, the earphone interface be can be set in any position of terminal device, herein not to earphone interface Setting position be defined, it is preferable that the bottom of terminal device is arranged in the earphone interface.It can be according to scheduled sampling Frequency obtains the voltage signal and current signal of earphone interface feedback in real time.
In step s 102, the impedance characteristic information of earphone speaker is calculated based on sampled result.
In step s 103, the earphone according to the impedance characteristic acquisition of information of the earphone speaker is presently in shape State.
In step S104, the volume that state adjusts the terminal device is presently according to the earphone.
In the embodiment of the present application, it is sampled by the voltage signal and current signal that are fed back to earphone interface, it can be real-time The impedance characteristic information for being linked into the loudspeaker of earphone of terminal device is calculated, is believed according to the impedance characteristic of the loudspeaker of earphone Breath may determine that earphone current state, and the earphone can be the earphone with phonetic incepting function, such as with microphone Earphone, be also possible to the earphone for not having phonetic incepting function, the earphone current state includes that earphone is in and wears shape State and earphone are in not by wearing state.As shown in Fig. 2, when earphone is in wearing state, earphone and ear canal constitute ear The preceding cavity configuration of machine loudspeaker, the earphone of cavity configuration before being constituted with ear canal, its impedance compared with the earphone for not constituting preceding cavity configuration Feature has significantly different.By the voltage signal and current signal fed back to earphone interface, earphone speaker is calculated in real time Impedance characteristic information, so as to judge cavity configuration before whether earphone is constituted with ear canal, if earphone and ear canal constitute ante-chamber Structure then shows that earphone is in wearing state;If earphone and ear canal do not constitute preceding cavity configuration, shows that earphone is in and do not wear shape State.
The embodiment of the present application is sampled by the voltage signal and current signal fed back to earphone interface, is believed based on voltage Number and current signal calculate in real time access terminal equipment earphone speaker impedance characteristic information, be based on the impedance characteristic Information judges earphone current state, and is presently in state according to earphone and is adjusted to the volume of terminal device, to avoid In the case where terminal device currently playing volume is very big, earphone is inserted directly into the earphone interface of terminal device, due to ear Machine volume is excessive and causes to damage to human ear hearing.
Further, the impedance characteristic information of earphone speaker is calculated according to the following formula:
Wherein Ut=[ut(1), ut(2) ... ut(n)], It=[It(1), It(2) ... It(n)], Ut-1=[ut-1(1), ut-1 (2) ... ut-1(n)], It-1=[It-1(1), It-1(2) ... It-1(n)], t is the continuous period, includes n in each period A sampled point, n are the integer greater than 0, and Z is impedance characteristic information, and FFT is Fourier transformation, and w is weight coefficient, and real is represented Take real part.Wherein, the quantity n of sampled point can be adjusted according to the actual situation, and the default value of n is 4096.Weight coefficient w can With according to different earphone models, environment locating for terminal is adjusted, the default value of w is 0.2.Pass through above-mentioned calculation formula meter Obtained impedance characteristic information Z, as shown in Fig. 3, the longitudinal axis represents impedance value, and horizontal axis represents frequency, frequency reflection herein It is the spectral characteristic of the electrical characteristics signal (such as voltage signal-current signal) of earphone interface feedback, herein frequency and current earphone The audio signal of broadcasting is unrelated.Dotted line in Fig. 3 represents the impedance-frequency curve for constituting the earphone speaker of preceding cavity configuration. Solid line represents earphone speaker without the impedance-frequency curve under any attaching object state.Pass through above-mentioned calculation formula, it is only necessary to Sampled point in 0.1s is calculated, the impedance-frequency curve of earphone speaker can be obtained.Pass through impedance-frequency of acquisition Rate curve can accurately judge cavity configuration before whether earphone is constituted with ear canal, and then can determine the shape that earphone is presently in State is wearing state either non-wearing state.And the state being presently according to earphone adjusts the volume of terminal device It is whole.
The embodiment of the present application can be monitored the state of earphone speaker by way of software, without to movement The hardware of terminal is modified, and needs not rely on the signal of currently playing audio, only passes through monitoring earphone interface feedback Voltage-to-current signal can analyze the impedance of earphone speaker, and judge the state that earphone is presently in, and existing There is the calculation method of technology compared to easier.
Preferably, earphone described in the impedance characteristic acquisition of information according to the earphone speaker is presently in state, Include:
Step S201, obtains the frequency point of the corresponding impedance characteristic information Z of earphone current state, and the frequency point refers to that Z is got Corresponding frequency values when maximum value;
Step S202, judges whether the frequency point is greater than preset frequency value;
Step S203, if the frequency point is greater than the preset frequency value, the earphone is presently in state to wear shape State;
If the frequency point is less than or equal to the preset frequency value, it is not wear shape that the earphone, which is presently in state, State;
In the embodiment of the present application, as shown in figure 3, in f '0The corresponding earphone loudspeaking for constituting ante-chamber of frequency values at point The maximum impedance value of device impedance-frequency curve, f '0Point is the frequency point that earphone is presently in impedance characteristic information Z under state.Its Middle f0Point is frequency point of the earphone speaker without the impedance characteristic information Z under any attaching object state.The calculation formula of its intermediate-frequeney point It is as follows:
When user wears earphone, the loudspeaker of earphone can form preceding cavity configuration with ear canal, so as to cause frequency point to high frequency It shifts, wherein f0Point is the frequency point not shifted, f '0Point is the frequency point deviated.As f '0It puts to high frequency offset Show that the loudspeaker of earphone and ear canal form preceding cavity configuration when reaching a certain level, in the embodiment of the present application, can be set One preset frequency value fc, as f '0> fcWhen, then show that the loudspeaker of earphone and ear canal form preceding cavity configuration, determines that earphone is worked as Preceding status is wearing state;As f '0≤fcWhen, then show the loudspeaker of earphone and the not formed preceding cavity configuration of ear canal, determines ear It is non-wearing state that machine, which is presently in state,.
It is optionally, described that the volume that state adjusts the terminal device is presently according to the earphone, comprising:
If it is wearing state that the earphone, which is presently in state, the volume of the terminal device is adjusted;
If it is non-wearing state that the earphone, which is presently in state, the volume of the terminal device is not adjusted.
It in the embodiment of the present application, is the mould played by earphone by the pattern switching put outside mobile phone is being passed through as user Formula, since mobile phone is under outer mode playback, user is usually by volume adjustment to maximum, at this point, if earphone cable is inserted into earphone interface, Then can triggering terminal equipment voice-grade channel switching.If user has worn earphone at this time, switch when voice-grade channel occurs When, human ear may be caused to damage if terminal volume is excessive.Therefore, in the embodiment of the present application, if the current institute of the earphone Place's state is wearing state, then is adjusted to the volume of the terminal device;If it is not wear that the earphone, which is presently in state, State is worn, then the volume of the terminal device is not adjusted.So as to be cut in audio broadcasting by outer put of terminal device When changing to earphone broadcasting, avoid that human ear is caused to damage since earpiece volume is excessive.
Optionally, if it is wearing state that the earphone, which is presently in state, to the volume of the terminal device into Row adjustment, comprising:
Judge whether the volume of the terminal device is greater than predetermined volume value;
If the volume of the terminal device be greater than predetermined volume value, by the volume decrease as low as the predetermined volume value with Under;
If the volume of the terminal device is less than or equal to predetermined volume value, the volume of the terminal device is not carried out Adjustment.
In the embodiment of the present application, before the volume to terminal device is adjusted, it is current first to obtain terminal device Volume value shows terminal device even at putting outside if the current volume value of terminal device is less than or equal to predetermined volume value State, and the volume of present terminal equipment and little will not make human ear user wears earphone under current volume At damage, therefore, if the volume of the terminal device is less than or equal to predetermined volume value, without to the terminal device Volume is adjusted.That is, when audio play by terminal device it is outer put be switched to earphone and play when, keep present terminal equipment Volume.If the current volume value of terminal device is greater than predetermined volume value, show under current volume, user wears earphone It is possible that can cause to damage to the hearing of user, therefore, when the volume of the terminal device is greater than predetermined volume value, by the sound Amount is reduced to the predetermined volume value or less.Ensure to cause human ear hearing when generation voice-grade channel switches to earphone Damage.
Further, it is adopted described according to voltage signal and current signal of the scheduled sample frequency to earphone interface Before sample, comprising:
Monitor the insertion event of the earphone interface;
Accordingly, described to carry out sampling packet according to voltage signal and current signal of the scheduled sample frequency to earphone interface It includes:
If listening to the insertion event of the earphone interface, believe according to voltage of the scheduled sample frequency to earphone interface Number and current signal sampled.
In the embodiment of the present application, due to earphone interface voltage signal and current signal carry out sampling will increase movement The electric quantity consumption of terminal causes shorten the cruise duration of mobile terminal, and user might not also play commonly using earphone Audio.Therefore, in order to improve detection efficiency, just only start the voltage of earphone interface in the case where earphone cable is inserted into earphone interface Then the sampling step of signal and current signal calculates the impedance characteristic information of earphone speaker again, and according to this feature information Judge the state that earphone is presently in.The prior art wherein is referred to the monitoring of the insertion event of earphone interface, herein not It repeats.
Further, the method also includes:
Monitor the extraction event of the earphone interface.
If listening to the extraction event of the earphone interface, by the volume adjustment of the terminal device be insertion earphone it Preceding volume value.
In the embodiment of the present application, since the loudspeaker of mobile terminal is small in size, volume is small, thus using mobile terminal into It can be only achieved preferable result of broadcast when row audio external play, when needing volume being transferred to very big.Therefore, when listening to earphone interface The extraction time when, by the volume adjustment of mobile terminal be inserted into earphone before volume value.To avoid due to extracting earphone When voice-grade channel being caused to switch to mobile terminal, since terminal device volume is lower, it is logical that audio can be heard so as to cause user The audio content played after road switching.The prior art wherein is referred to the monitoring of the extraction event of earphone interface, herein It does not repeat.
Preferably, after the extraction event for listening to the earphone interface, in the volume tune of the terminal device Before volume value before the whole earphone for insertion, comprising:
Pop-up display control simultaneously prompts user's earphone to extract, and shows whether restore volume on the display control Option.
If user selects to restore volume, the volume adjustment of the terminal device is the volume value before being inserted into earphone.
If user's selection does not restore volume, the terminal device keeps current volume.
In the embodiment of the present application, when listening to earphone insertion event, the current volume value of the terminal device is recorded And stored, when listening to earphone extraction event, directly voice-grade channel is not switched over, but pop-up display control User is issued and is reminded, and the option for whether restoring volume is provided on display control.When user selects to restore volume, terminal Equipment reads the volume value of terminal device recorded and stored when earphone insertion, and the volume of the terminal device is restored to slotting Enter the volume value before earphone.When user's selection does not restore volume, then mobile terminal keeps current volume, and will listen to The volume value recorded and stored when earphone insertion event is removed, to save the memory space of terminal.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present application constitutes any limit It is fixed.
Embodiment two
Corresponding with the method for regulation of sound volume of a kind of terminal device that embodiment one provides, it is real that Fig. 4 shows the present invention second A kind of structural schematic diagram of the volume adjusting apparatus of terminal device of example offer is applied, which can be applied to mobile whole In end, for ease of description, only parts related to embodiments of the present invention are shown:
The volume adjusting apparatus 4 includes:
Sampling unit 41, for being adopted according to voltage signal and current signal of the scheduled sample frequency to earphone interface Sample;
Impedance characteristic computing unit 42, for calculating the impedance characteristic information of earphone speaker based on sampled result;
Earphone is presently in state acquiring unit 43, for the impedance characteristic acquisition of information institute according to the earphone speaker It states earphone and is presently in state;
Volume adjustment unit 44, for being presently in the volume that state adjusts the terminal device according to the earphone.
Optionally, the impedance characteristic information of earphone speaker is calculated according to the following formula:
Wherein Ut=[ut(1), ut(2) ... ut(n)], It=[It(1), It(2) ... It(n)], t is the continuous period, It include n sampled point in each period, Z is impedance characteristic information, and FFT is Fourier transformation, and w is weight coefficient, real generation Table takes real part.
Optionally, it includes wearing state and non-wearing state that the earphone, which is presently in state, and the earphone is presently in State acquiring unit 43 includes:
Frequency point obtains subelement, for obtaining the frequency point of the corresponding impedance characteristic information Z of earphone current state, the frequency point Refer to corresponding frequency values when Z gets maximum value;
Comparing subunit, for judging whether the frequency point is greater than preset frequency value;
State judgment sub-unit, if being greater than the preset frequency value for the frequency point, the earphone is presently in shape State is wearing state;
If the frequency point is less than or equal to the preset frequency value, it is not wear shape that the earphone, which is presently in state, State.
Optionally, the volume adjustment unit 44 is also used to:
If it is wearing state that the earphone, which is presently in state, the volume of the terminal device is adjusted;
If it is non-wearing state that the earphone, which is presently in state, the volume of the terminal device is not adjusted.
Optionally, if it is wearing state that the earphone, which is presently in state, to the volume of the terminal device into Row adjustment, comprising:
Judge whether the volume of the terminal device is greater than predetermined volume value;
If the volume of the terminal device be greater than predetermined volume value, by the volume decrease as low as the predetermined volume value with Under;
If the volume of the terminal device is less than or equal to predetermined volume value, the volume of the terminal device is not adjusted It is whole.
Optionally, it is sampled described according to voltage signal and current signal of the scheduled sample frequency to earphone interface Before, comprising:
Monitor the insertion event of the earphone interface;
Accordingly, described to carry out sampling packet according to voltage signal and current signal of the scheduled sample frequency to earphone interface It includes:
If listening to the insertion event of the earphone interface, believe according to voltage of the scheduled sample frequency to earphone interface Number and current signal sampled.
Optionally, described device further include:
Event monitoring unit is extracted, for monitoring the extraction event of the earphone interface;
Volume recovery unit, if the extraction event for listening to the earphone interface, by the sound of the terminal device Amount is adjusted to the volume value before insertion earphone.
Optionally, after the extraction event for listening to the earphone interface, in the volume tune of the terminal device Before volume value before the whole earphone for insertion, comprising:
Pop-up display control simultaneously prompts user's earphone to extract, and shows whether restore volume on the display control Option;
If user selects to restore volume, the volume adjustment of the terminal device is the volume value before being inserted into earphone;
If user's selection does not restore volume, the terminal device keeps current volume.
The embodiment of the present application is sampled by the voltage signal and current signal fed back to earphone interface, is believed based on voltage Number and current signal calculate in real time access terminal equipment earphone speaker impedance characteristic information, be based on the impedance characteristic Information judges earphone current state, and is presently in state according to earphone and is adjusted to the volume of terminal device, to avoid In the case where terminal device currently playing volume is very big, earphone is inserted directly into the earphone interface of terminal device, due to ear Machine volume is excessive and causes to damage to human ear hearing.
Embodiment three:
Fig. 5 is the schematic diagram for the mobile terminal that one embodiment of the invention provides.As shown in figure 5, the mobile end of the embodiment End 5 includes: processor 50, memory 51 and is stored in the meter that can be run in the memory 51 and on the processor 50 Calculation machine program 52.The processor 50 realizes the volume adjustment side of above-mentioned each terminal device when executing the computer program 52 Step in method embodiment, such as step S101 to S104 shown in FIG. 1.Alternatively, the processor 50 executes the computer The function of each module/unit in above-mentioned each Installation practice, such as the function of module 41 to 44 shown in Fig. 4 are realized when program 52.
Illustratively, the computer program 52 can be divided into one or more module/units, it is one or Multiple module/units are stored in the memory 51, and are executed by the processor 50, to complete the present invention.Described one A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for Implementation procedure of the computer program 52 in the mobile terminal 5 is described.For example, the computer program 52 can be divided It is cut into sampling unit, impedance characteristic computing unit, earphone and is presently in state acquiring unit and volume adjustment unit, each unit Concrete function is as follows:
Sampling unit, for being adopted according to voltage signal and current signal of the scheduled sample frequency to earphone interface Sample;
Impedance characteristic computing unit, for calculating the impedance characteristic information of earphone speaker based on sampled result;
Earphone is presently in state acquiring unit, for described in the impedance characteristic acquisition of information according to the earphone speaker Earphone is presently in state;
Volume adjustment unit, for being presently in the volume that state adjusts the terminal device according to the earphone.
The mobile terminal 5 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set It is standby.The mobile terminal may include, but be not limited only to, processor 50, memory 51.It will be understood by those skilled in the art that Fig. 5 The only example of mobile terminal 5 does not constitute the restriction to mobile terminal 5, may include than illustrating more or fewer portions Part perhaps combines certain components or different components, such as the mobile terminal can also include input-output equipment, net Network access device, bus etc..
Alleged processor 50 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 51 can be the internal storage unit of the mobile terminal 5, such as the hard disk or interior of mobile terminal 5 It deposits.The memory 41 is also possible to the External memory equipment of the mobile terminal 4, such as be equipped on the mobile terminal 5 Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge Deposit card (Flash Card) etc..Further, the memory 51 can also both include the storage inside list of the mobile terminal 5 Member also includes External memory equipment.The memory 51 is for storing needed for the computer program and the mobile terminal Other programs and data.The memory 51 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute The division of module or unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation, such as Multiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.Separately A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, device Or the INDIRECT COUPLING or communication connection of unit, it can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or In use, can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-mentioned implementation All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium It may include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic that can carry the computer program code Dish, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described The content that computer-readable medium includes can carry out increasing appropriate according to the requirement made laws in jurisdiction with patent practice Subtract, such as does not include electric carrier signal and electricity according to legislation and patent practice, computer-readable medium in certain jurisdictions Believe signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (11)

1. a kind of method for regulation of sound volume of terminal device, which is characterized in that the described method includes:
It is sampled according to voltage signal and current signal of the scheduled sample frequency to earphone interface;
The impedance characteristic information of earphone speaker is calculated based on sampled result;
State is presently according to earphone described in the impedance characteristic acquisition of information of the earphone speaker;
The volume that state adjusts the terminal device is presently according to the earphone.
2. method for regulation of sound volume as described in claim 1, which is characterized in that calculate the resistance of earphone speaker according to the following formula Anti- characteristic information:
Wherein Ut=[ut(1),ut(2),…ut(n)], It=[It(1),It(2),…It(n)], t is the continuous period, each It include n sampled point in period, Z is impedance characteristic information, and FFT is Fourier transformation, and w is weight coefficient, and real representative takes Real part.
3. method for regulation of sound volume as claimed in claim 2, which is characterized in that it includes wearing shape that the earphone, which is presently in state, State and non-wearing state, earphone described in the impedance characteristic acquisition of information according to the earphone speaker are presently in state, Include:
The frequency point of the corresponding impedance characteristic information Z of earphone current state is obtained, the frequency point refers to corresponding when Z gets maximum value Frequency values;
Judge whether the frequency point is greater than preset frequency value;
If the frequency point is greater than the preset frequency value, it is wearing state that the earphone, which is presently in state,;
If the frequency point is less than or equal to the preset frequency value, it is non-wearing state that the earphone, which is presently in state,.
4. method for regulation of sound volume as claimed in claim 3, which is characterized in that described to be presently in state tune according to the earphone The volume of the whole terminal device, comprising:
If it is wearing state that the earphone, which is presently in state, the volume of the terminal device is adjusted;
If it is non-wearing state that the earphone, which is presently in state, the volume of the terminal device is not adjusted.
5. method for regulation of sound volume as claimed in claim 4, which is characterized in that if the earphone is presently in state to wear State is worn, then the volume of the terminal device is adjusted, comprising:
Judge whether the volume of the terminal device is greater than predetermined volume value;
If the volume of the terminal device be greater than predetermined volume value, by the volume decrease as low as the predetermined volume value below;
If the volume of the terminal device is less than or equal to predetermined volume value, the volume of the terminal device is not adjusted It is whole.
6. method for regulation of sound volume as described in claim 1, which is characterized in that it is described according to scheduled sample frequency to earphone Before the voltage signal and current signal of interface are sampled, comprising:
Monitor the insertion event of the earphone interface;
Accordingly, it is described according to voltage signal and current signal of the scheduled sample frequency to earphone interface carry out sampling include:
If listening to the insertion event of the earphone interface, according to scheduled sample frequency to the voltage signal of earphone interface and Current signal is sampled.
7. method for regulation of sound volume as described in claim 1, which is characterized in that the method also includes:
Monitor the extraction event of the earphone interface;
If listening to the extraction event of the earphone interface, before being insertion earphone by the volume adjustment of the terminal device Volume value.
8. method for regulation of sound volume as claimed in claim 7, which is characterized in that in the extraction for listening to the earphone interface After event, before the volume value before the volume adjustment of the terminal device is insertion earphone, comprising:
Pop-up display control simultaneously prompts user's earphone to extract, and the choosing for whether restoring volume is shown on the display control ?;
If user selects to restore volume, the volume adjustment of the terminal device is the volume value before being inserted into earphone;
If user's selection does not restore volume, the terminal device keeps current volume.
9. a kind of volume tune device of terminal device, which is characterized in that described device includes:
Sampling unit, for being sampled according to voltage signal and current signal of the scheduled sample frequency to earphone interface;
Impedance characteristic computing unit, for calculating the impedance characteristic information of earphone speaker based on sampled result;
Earphone is presently in state acquiring unit, for earphone described in the impedance characteristic acquisition of information according to the earphone speaker It is presently in state;
Volume adjustment unit, for being presently in the volume that state adjusts the terminal device according to the earphone.
10. a kind of terminal device, including memory, processor and storage are in the memory and can be on the processor The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 8 when executing the computer program The step of any one the method.
11. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as claim 1 to 8 of realization the method.
CN201811124110.3A 2018-09-26 2018-09-26 Volume adjusting method and device of terminal equipment and terminal equipment Active CN109240642B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811124110.3A CN109240642B (en) 2018-09-26 2018-09-26 Volume adjusting method and device of terminal equipment and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811124110.3A CN109240642B (en) 2018-09-26 2018-09-26 Volume adjusting method and device of terminal equipment and terminal equipment

Publications (2)

Publication Number Publication Date
CN109240642A true CN109240642A (en) 2019-01-18
CN109240642B CN109240642B (en) 2021-09-03

Family

ID=65056161

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811124110.3A Active CN109240642B (en) 2018-09-26 2018-09-26 Volume adjusting method and device of terminal equipment and terminal equipment

Country Status (1)

Country Link
CN (1) CN109240642B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110927492A (en) * 2019-11-28 2020-03-27 歌尔股份有限公司 Wireless earphone state detection method and wireless earphone
CN111324808A (en) * 2020-01-19 2020-06-23 上海掌门科技有限公司 Method and equipment for providing information flow

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915751A (en) * 2012-09-26 2013-02-06 广东欧珀移动通信有限公司 Method for automatically regulating sound volume and terminal equipment thereof
US20140376736A1 (en) * 2013-06-21 2014-12-25 Chiun Mai Communication Systems, Inc. Control circuit for controlling audio signal output of earphone
CN106303815A (en) * 2015-05-22 2017-01-04 西安中兴新软件有限责任公司 Method for controlling volume and electronic equipment
CN106851486A (en) * 2016-11-29 2017-06-13 维沃移动通信有限公司 A kind of changing method and mobile terminal of earphone sound channel
CN108134969A (en) * 2017-11-30 2018-06-08 北京松果电子有限公司 The detection method and device of earphone wearing state
CN108540906A (en) * 2018-06-15 2018-09-14 歌尔股份有限公司 Volume adjusting method, earphone and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915751A (en) * 2012-09-26 2013-02-06 广东欧珀移动通信有限公司 Method for automatically regulating sound volume and terminal equipment thereof
US20140376736A1 (en) * 2013-06-21 2014-12-25 Chiun Mai Communication Systems, Inc. Control circuit for controlling audio signal output of earphone
CN106303815A (en) * 2015-05-22 2017-01-04 西安中兴新软件有限责任公司 Method for controlling volume and electronic equipment
CN106851486A (en) * 2016-11-29 2017-06-13 维沃移动通信有限公司 A kind of changing method and mobile terminal of earphone sound channel
CN108134969A (en) * 2017-11-30 2018-06-08 北京松果电子有限公司 The detection method and device of earphone wearing state
CN108540906A (en) * 2018-06-15 2018-09-14 歌尔股份有限公司 Volume adjusting method, earphone and computer readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110927492A (en) * 2019-11-28 2020-03-27 歌尔股份有限公司 Wireless earphone state detection method and wireless earphone
CN110927492B (en) * 2019-11-28 2022-04-22 歌尔股份有限公司 Wireless earphone state detection method and wireless earphone
CN111324808A (en) * 2020-01-19 2020-06-23 上海掌门科技有限公司 Method and equipment for providing information flow
CN111324808B (en) * 2020-01-19 2023-09-15 南京尚网网络科技有限公司 Method and equipment for providing information flow

Also Published As

Publication number Publication date
CN109240642B (en) 2021-09-03

Similar Documents

Publication Publication Date Title
CN208689384U (en) A kind of band has the smartwatch of voice interactive function earphone
CN104581494B (en) Method for protecting hearing ability, system and earphone based on earphone
CN104521247B (en) Bluetooth headset hearing aid and anti-noise method and apparatus
CN104410379B (en) A kind of volume adjusting method
CN108076226A (en) A kind of method, mobile terminal and the storage medium of speech quality adjustment
CN108733342A (en) volume adjusting method, mobile terminal and computer readable storage medium
CN106604167B (en) A kind of method and mobile terminal of adjust automatically earphone left and right acoustic channels output volume
CN104363510B (en) A kind of playback terminal
CN107205187B (en) A kind of method, apparatus and terminal device based on earphone control music
CN106791191A (en) A kind of control method for playing back and device
CN105517126B (en) Frequency range processing method, device and communication terminal in a kind of communication terminal
CN109240642A (en) A kind of method for regulation of sound volume of terminal device, device and terminal device
CN109739463A (en) Multimedia volume adjusting method and terminal
CN106686481A (en) Method of earphone de-noising and earphone
CN209017223U (en) A kind of wearable intelligent sound box and intelligent sound box system
CN108600526A (en) Alarm clock control method and related product
CN203909716U (en) Novel mind headset
CN105895126A (en) Method and apparatus for indicating and controlling playing audio/audio and video data
CN110505547A (en) A kind of earphone wearing state detection method and earphone
CN109040896A (en) A kind of earphone and apart from detection cut-in method
CN108289232A (en) A kind of control method of playback equipment, terminal device and storage medium
CN104581515B (en) A kind of audio playing apparatus, method and mobile terminal
CN109121042B (en) Voice data processing method and related product
CN109391869A (en) A kind of earphone and ear canal judge cut-in method
CN108121529A (en) Switching method, switching device and the terminal of audio-frequency play mode

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