CN104640049B - A kind of method and system for distinguishing the earphone for whether supporting speech voice input function - Google Patents

A kind of method and system for distinguishing the earphone for whether supporting speech voice input function Download PDF

Info

Publication number
CN104640049B
CN104640049B CN201310554760.2A CN201310554760A CN104640049B CN 104640049 B CN104640049 B CN 104640049B CN 201310554760 A CN201310554760 A CN 201310554760A CN 104640049 B CN104640049 B CN 104640049B
Authority
CN
China
Prior art keywords
earphone
voice input
input function
speech voice
analog
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310554760.2A
Other languages
Chinese (zh)
Other versions
CN104640049A (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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201310554760.2A priority Critical patent/CN104640049B/en
Publication of CN104640049A publication Critical patent/CN104640049A/en
Application granted granted Critical
Publication of CN104640049B publication Critical patent/CN104640049B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Headphones And Earphones (AREA)
  • Circuit For Audible Band Transducer (AREA)

Abstract

The present invention provides a kind of method and system for the earphone distinguished and whether support speech voice input function:The earphone without mic functions is inserted, starts sound-recording function after recording parameter is set, generates the first recording data;Analog-digital converter obtains the first recording data of 320 points as the first Analog-digital Converter sampled value from first recording data;Calculate the mean difference x of the first Analog-digital Converter sampled value;Again insertable into earphone is appointed, set with starting sound-recording function after earphone identical recording parameter of the insertion without mic functions, generate the second recording data;Analog-digital converter obtains the second recording data of 320 points as the second Analog-digital Converter sampled value from the second recording data;Calculate the mean difference y of the second Analog-digital Converter sampled value;If the absolute value of mean difference y and mean difference x difference is more than predetermined threshold value, confirm described in again insertable into earphone be the earphone that has mic functions, it is on the contrary then be the earphone without mic functions.

Description

A kind of method and system for distinguishing the earphone for whether supporting speech voice input function
Technical field
It is more particularly to a kind of to distinguish whether support that voice is defeated the present invention relates to mobile device audio peripheral hardware detection technique field Enter the method and system of the earphone of function.
Background technology
In recent years, with the development of various audio-visual equipment, also there are various related peripheral products.From early stage with Body listen and CD player on the earphone for not supporting speech voice input function, the support speech voice input function used till now on intelligent machine Earphone.In order to all support these earphones in present equipment, then system is just needed to distinguish both equipment, so as to real Existing different audio strategy.
At present, realizing the method for detection mainly has two kinds, and a kind of is the detection that hardware audio chip itself supports the function, This just needs to consider when Model Selection Scheme, still, because the function is trickleer, it is easy to the personnel of being developed ignore, Cause the later stage can not realize differentiation.Another kind, which mainly passes through in hardware design, adds additional circuit, or operating system bottom Register manipulation audio register obtain that the mode of bias voltage whether there is phonetic entry to distinguish(Mic)Function, this side Method is more complicated, and flexibility is relatively low, requires higher to developer's own level, and can extend the construction cycle.
The content of the invention
The method and system of the earphone of speech voice input function whether is supported it is an object of the invention to provide a kind of differentiation, with Solve whether prior art differentiation supports that the method for the earphone of speech voice input function is complicated, flexibility is low, to developer itself water It is flat to require the problem of higher.
In order to solve the above technical problems, the present invention provides a kind of side for the earphone distinguished and whether support speech voice input function Method, including:
An earphone without speech voice input function is inserted, starts sound-recording function, the recording number of generation first after recording parameter is set According to;
Analog-digital converter obtains the first recording data of 320 points as the first simulation from first recording data Numeral conversion sampled value;
Calculate the mean difference x of the first Analog-digital Converter sampled value;
Again insertable into any earphone, set with starting after the one earphone identical recording parameter without speech voice input function of insertion Sound-recording function, generate the second recording data;
Analog-digital converter obtains the second recording data of 320 points as the second simulation from second recording data Numeral conversion sampled value;
Calculate the mean difference y of the second Analog-digital Converter sampled value;
If the absolute value of mean difference y and mean difference x difference is more than predetermined threshold value, confirm described in again insertable into earphone It is on the contrary then be the earphone without speech voice input function to there is an earphone of speech voice input function.
Further, in whether described differentiation supports the method for earphone of speech voice input function, the recording parameter Including:Sample rate is 8000Hz, single channel and sampling precision are 16bit.
Further, in whether described differentiation supports the method for earphone of speech voice input function, in insertion one without language In the step of earphone of sound input function, after the insertion of system detectio to earphone, the voice that audio input is arranged to system is defeated Enter, audio output is arranged to earphone output, while earphone insertion event is reported to upper level applications.
Further, in whether described differentiation supports the method for earphone of speech voice input function, described in confirmation again After the step of type of the earphone of insertion, in addition to:
According to the type of the earphone, audio strategy is reset.
Further, in whether described differentiation supports the method for earphone of speech voice input function, the audio strategy For:
When the earphone is the earphone without speech voice input function, audio input is arranged to the phonetic entry of system, will Audio output is arranged to earphone output;
When the earphone is the earphone for having speech voice input function, any operation is not done, is directly exited.
Meanwhile the present invention also provides a kind of system for the earphone distinguished and whether support speech voice input function, including:
First generation module, for inserting an earphone without speech voice input function, start recording work(after recording parameter is set Can, generate the first recording data;
Analog-digital converter, the first recording data for obtaining 320 points from first recording data are used as the One Analog-digital Converter sampled value;
First acquisition module, for calculating the mean difference x of the first Analog-digital Converter sampled value;
Second generation module, for again insertable into any earphone, setting with inserting an earphone phase without speech voice input function Start sound-recording function after same recording parameter, generate the second recording data;
Analog-digital converter, it is additionally operable to obtain the second recording data conduct of 320 points from second recording data Second Analog-digital Converter sampled value;
Second acquisition module, for calculating the mean difference y of the second Analog-digital Converter sampled value;
Judge module, if the absolute value for mean difference y and mean difference x difference is more than predetermined threshold value, described in confirmation Again insertable into earphone be the earphone that has speech voice input function, it is on the contrary then be the earphone without speech voice input function.
Further, in whether described differentiation supports the system of earphone of speech voice input function, it is characterised in that institute Stating recording parameter includes:Sample rate is 8000Hz, single channel and sampling precision are 16bit.
Further, in whether described differentiation supports the system of earphone of speech voice input function, in addition to first sets Module is put, after the insertion for system detectio to the earphone of the first generation module, the voice that audio input is arranged to system is defeated Enter, audio output is arranged to earphone output, while earphone insertion event is reported to upper level applications.
Further, in whether described differentiation supports the system of earphone of speech voice input function, in addition to:Second sets Module is put, for the type according to the earphone, resets audio strategy.
Further, in whether described differentiation supports the system of earphone of speech voice input function, set described second Put in module, when the earphone is the earphone without speech voice input function, audio input is arranged to the phonetic entry of system, will Audio output is arranged to earphone output;When the earphone is the earphone for having speech voice input function, any operation is not done, is directly moved back Go out.
The method and system provided by the invention for distinguishing the earphone for whether supporting speech voice input function, have below beneficial to effect Fruit:The present invention in systematic difference aspect it may determine that the state of earphone, without the hardware to system and bottom Driving has the deep understanding of comparison, while relative to other modes, the construction cycle is shorter, and difficulty is lower.
Brief description of the drawings
Fig. 1 is the schematic flow sheet for the method whether differentiation of the embodiment of the present invention supports the earphone of speech voice input function;
Fig. 2 is the structural representation for the system whether differentiation of the embodiment of the present invention supports the earphone of speech voice input function.
Embodiment
The earphone of speech voice input function whether is supported differentiation proposed by the present invention below in conjunction with the drawings and specific embodiments Method and system be described in further detail.According to following explanation and claims, advantages and features of the invention will more It is clear.It should be noted that accompanying drawing uses using very simplified form and non-accurately ratio, only to convenient, apparent Ground aids in illustrating the purpose of the embodiment of the present invention.
Fig. 1 is refer to, the present invention provides a kind of method for the earphone distinguished and whether support speech voice input function, including:
S11:An earphone without speech voice input function is inserted, starts sound-recording function, the record of generation first after recording parameter is set Sound data;
Specifically, the recording parameter includes:Sample rate is 8000Hz, single channel and sampling precision are 16bit.
Particularly, in the present embodiment, when inserting the earphone without speech voice input function, system can detect inserting for earphone Enter, audio input is then arranged to the phonetic entry of system, audio output is arranged to earphone output, while to upper layer application Program reports earphone insertion event.
S12:Analog-digital converter obtains the first recording data of 320 points as first from first recording data Analog-digital Converter sampled value;
Specifically, audio sample process is superimposed with after Mic bias voltage for outside Mic analog signals, via: Analog-digital converter(ADC)Sampling obtains required voice data of recording.
S13:Calculate the mean difference x of the first Analog-digital Converter sampled value;
S14:Again insertable into any earphone, after the one earphone identical recording parameter without speech voice input function of setting and insertion Start sound-recording function, generate the second recording data;
S15:Analog-digital converter obtains the second recording data of 320 points as second from second recording data Analog-digital Converter sampled value;
S16:Calculate the mean difference y of the second Analog-digital Converter sampled value;
S17:If the absolute value of mean difference y and mean difference x difference is more than predetermined threshold value, confirm described in again insertable into Earphone is the earphone for having speech voice input function(headset), it is on the contrary then be the earphone without speech voice input function(headphone).
Specifically, in the present embodiment, the predetermined threshold value is set to 2, but can be according to the environment of measure to the default threshold Value does appropriate adjustment, i.e. the selection of predetermined threshold value can refer to the result of experiment.
In the present invention, mean difference(Mean Deviation)Be represent difference degree between each variate-value numerical value it One.Refer to arithmetic average of each variate-value with the deviation absolute value of average.Calculation formula is:Mean differenceWherein Σ is the symbol amounted to, and x is variableFor arithmetic average, n is of variate-value Number.
In the present embodiment, it is directly grounded for the earphone without Mic, Mic pins, at this time ADC samples obtained value It is exactly bias value;But insertion is the earphone for having Mic, and ADC samples the fluctuation signal on obtained data i.e. Mic, due to Current noise and extraneous interference be present, the value that at this time ADC is sampled would is that after bias and the superposition of this fluctuation signal As a result.Both can be distinguished well according to difference.
Particularly, in the present embodiment, confirm it is described again insertable into earphone type the step of after, can be according to described The type of earphone, reset audio strategy.
Specifically audio strategy is:When the earphone for earphone without speech voice input function when, audio input is arranged to be The phonetic entry of system, audio output is arranged to earphone output;When the earphone is the earphone for having speech voice input function, do not do Any operation, is directly exited.
Meanwhile Fig. 2 is refer to, whether present invention simultaneously provides a kind of distinguish supports that the earphone of speech voice input function is System, including:
First generation module 21, for inserting an earphone without speech voice input function, start recording after recording parameter is set Function, generate the first recording data;
Specifically, the recording parameter includes:Sample rate is 8000Hz, single channel and sampling precision are 16bit.
Further comprise the first setup module 22, the insertion for system detectio to the earphone of the first generation module 21 Afterwards, audio input is arranged to the phonetic entry of system, audio output is arranged to earphone output, while to upper level applications Report earphone insertion event.
Analog-digital converter 23, for obtaining the first recording data conduct of 320 points from first recording data First Analog-digital Converter sampled value;
First acquisition module 24, for calculating the arithmetic average x of the first Analog-digital Converter sampled value;
Second generation module 25, for again insertable into any earphone, setting and one earphone without speech voice input function of insertion Start sound-recording function after identical recording parameter, generate the second recording data;
Analog-digital converter 23, the second recording data for being additionally operable to obtain 320 points from second recording data are made For the second Analog-digital Converter sampled value;
Second acquisition module 26, for calculating the mean difference y of the second Analog-digital Converter sampled value;
Judge module 27, if the absolute value for mean difference y and mean difference x difference is more than predetermined threshold value, confirm institute State again insertable into earphone be the earphone that has speech voice input function, it is on the contrary then be the earphone without speech voice input function.
Second setup module 28, for the type according to the earphone, reset audio strategy.
Specifically, in second setup module 28, when the earphone is the earphone without speech voice input function, by sound Frequency input is arranged to the phonetic entry of system, and audio output is arranged into earphone output;When the earphone is to have phonetic entry work( During the earphone of energy, any operation is not done, is directly exited.
The combination of summary structure, the present invention in systematic difference aspect it may determine that the state of earphone, without Needing the driving to the hardware and bottom of system has the deep understanding of comparison, while relative to other modes, the construction cycle is shorter, Difficulty is lower.
Foregoing description is only the description to present pre-ferred embodiments, not to any restriction of the scope of the invention, this hair Any change, the modification that the those of ordinary skill in bright field does according to the disclosure above content, belong to the protection of claims Scope.

Claims (10)

  1. A kind of 1. method for distinguishing the earphone for whether supporting speech voice input function, it is characterised in that including:
    An earphone without speech voice input function is inserted, starts sound-recording function after recording parameter is set, generates the first recording data;
    Analog-digital converter obtains the first recording data of 320 points as the first simulation numeral from first recording data Change sampled value;
    Calculate the mean difference x of the first Analog-digital Converter sampled value;
    Again insertable into any earphone, set and recorded with starting after the one earphone identical recording parameter without speech voice input function of insertion Function, generate the second recording data;
    Analog-digital converter obtains the second recording data of 320 points as the second simulation numeral from second recording data Change sampled value;
    Calculate the mean difference y of the second Analog-digital Converter sampled value;
    If the absolute value of mean difference y and mean difference x difference is more than predetermined threshold value, confirm it is described again insertable into earphone be to have The earphone of speech voice input function, it is on the contrary then be the earphone without speech voice input function.
  2. 2. the method as claimed in claim 1 for distinguishing the earphone for whether supporting speech voice input function, it is characterised in that the record Sound parameter includes:Sample rate is 8000Hz, single channel and sampling precision are 16bit.
  3. 3. the method as claimed in claim 1 for distinguishing the earphone for whether supporting speech voice input function, it is characterised in that inserting In the step of one earphone without speech voice input function, after the insertion of system detectio to earphone, audio input is arranged to system Phonetic entry, audio output is arranged to earphone output, while earphone insertion event is reported to upper level applications.
  4. 4. the method as claimed in claim 1 for distinguishing the earphone for whether supporting speech voice input function, it is characterised in that confirm institute State again insertable into earphone type the step of after, in addition to:
    According to the type of the earphone, audio strategy is reset.
  5. 5. the method as claimed in claim 4 for distinguishing the earphone for whether supporting speech voice input function, it is characterised in that the sound Frequency strategy is:
    When the earphone is the earphone without speech voice input function, audio input is arranged to the phonetic entry of system, by audio Output is arranged to earphone output;
    When the earphone is the earphone for having speech voice input function, any operation is not done, is directly exited.
  6. A kind of 6. system for distinguishing the earphone for whether supporting speech voice input function, it is characterised in that including:
    First generation module, for inserting an earphone without speech voice input function, start sound-recording function after recording parameter is set, it is raw Into the first recording data;
    Analog-digital converter, for obtaining the first recording data of 320 points from first recording data as the first mould Intend numeral conversion sampled value;
    First acquisition module, for calculating the mean difference x of the first Analog-digital Converter sampled value;
    Second generation module, for again insertable into any earphone, setting and the one earphone identical without speech voice input function of insertion Start sound-recording function after recording parameter, generate the second recording data;
    Analog-digital converter, it is additionally operable to obtain the second recording data of 320 points as second from second recording data Analog-digital Converter sampled value;
    Second acquisition module, for calculating the mean difference y of the second Analog-digital Converter sampled value;
    Judge module, if the absolute value for mean difference y and mean difference x difference is more than predetermined threshold value, described in confirmation again The earphone of insertion is the earphone for having speech voice input function, on the contrary then be the earphone without speech voice input function.
  7. 7. the system as claimed in claim 6 for distinguishing the earphone for whether supporting speech voice input function, it is characterised in that the record Sound parameter includes:Sample rate is 8000Hz, single channel and sampling precision are 16bit.
  8. 8. the system as claimed in claim 6 for distinguishing the earphone for whether supporting speech voice input function, it is characterised in that also include First setup module, after the insertion for system detectio to the earphone of the first generation module, audio input is arranged to system Phonetic entry, audio output is arranged to earphone output, while earphone insertion event is reported to upper level applications.
  9. 9. the system as claimed in claim 6 for distinguishing the earphone for whether supporting speech voice input function, it is characterised in that also wrap Include:Second setup module, for the type according to the earphone, reset audio strategy.
  10. 10. the system as claimed in claim 9 for distinguishing the earphone for whether supporting speech voice input function, it is characterised in that in institute State in the second setup module, when the earphone is the earphone without speech voice input function, audio input is arranged to the language of system Sound is inputted, and audio output is arranged into earphone output;When the earphone is the earphone for having speech voice input function, any behaviour is not Make, directly exit.
CN201310554760.2A 2013-11-08 2013-11-08 A kind of method and system for distinguishing the earphone for whether supporting speech voice input function Active CN104640049B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310554760.2A CN104640049B (en) 2013-11-08 2013-11-08 A kind of method and system for distinguishing the earphone for whether supporting speech voice input function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310554760.2A CN104640049B (en) 2013-11-08 2013-11-08 A kind of method and system for distinguishing the earphone for whether supporting speech voice input function

Publications (2)

Publication Number Publication Date
CN104640049A CN104640049A (en) 2015-05-20
CN104640049B true CN104640049B (en) 2017-12-22

Family

ID=53218267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310554760.2A Active CN104640049B (en) 2013-11-08 2013-11-08 A kind of method and system for distinguishing the earphone for whether supporting speech voice input function

Country Status (1)

Country Link
CN (1) CN104640049B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1856183A (en) * 2005-04-26 2006-11-01 佛山市顺德区顺达电脑厂有限公司 Method and apparatus for identifying earphone forms
CN1863239A (en) * 2005-07-08 2006-11-15 华为技术有限公司 Sound recording detecting system and method
CN200986697Y (en) * 2006-07-17 2007-12-05 陈重行 Microphone device for recording of USB interface
CN201479368U (en) * 2009-09-16 2010-05-19 沈阳晨讯希姆通科技有限公司 Earphone tester
CN101945172A (en) * 2010-09-17 2011-01-12 惠州Tcl移动通信有限公司 Mobile phone-based earphone recognition calling method and mobile phone
CN102638743A (en) * 2011-02-09 2012-08-15 苹果公司 Audio accessory type detection and connector pin signal assignment
WO2013000727A1 (en) * 2011-06-30 2013-01-03 Ams Ag Detection circuit and detection method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI469648B (en) * 2011-12-05 2015-01-11 Inventec Corp Audio testing system and audio testing method for under-testing device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1856183A (en) * 2005-04-26 2006-11-01 佛山市顺德区顺达电脑厂有限公司 Method and apparatus for identifying earphone forms
CN1863239A (en) * 2005-07-08 2006-11-15 华为技术有限公司 Sound recording detecting system and method
CN200986697Y (en) * 2006-07-17 2007-12-05 陈重行 Microphone device for recording of USB interface
CN201479368U (en) * 2009-09-16 2010-05-19 沈阳晨讯希姆通科技有限公司 Earphone tester
CN101945172A (en) * 2010-09-17 2011-01-12 惠州Tcl移动通信有限公司 Mobile phone-based earphone recognition calling method and mobile phone
CN102638743A (en) * 2011-02-09 2012-08-15 苹果公司 Audio accessory type detection and connector pin signal assignment
WO2013000727A1 (en) * 2011-06-30 2013-01-03 Ams Ag Detection circuit and detection method

Also Published As

Publication number Publication date
CN104640049A (en) 2015-05-20

Similar Documents

Publication Publication Date Title
CN104581605B (en) The system and method calibrated automatically for energy converter
CN104918177A (en) Signal processing apparatus, signal processing method, and program
CN104661169B (en) A kind of audio testing method and device
CN209608862U (en) The test calibration device of TWS noise cancelling headphone
US10506323B2 (en) User customizable headphone system
US20130051567A1 (en) Tap detection of sound output device
WO2012092731A1 (en) Electronic terminal and ring prompt method of the electronic terminal
CN105355213A (en) Method and device for directional recording
CN105659631B (en) Sound field measurement apparatus and sound field measuring method
CN103716729B (en) Export the method and electronic equipment of audio
CN207354556U (en) A kind of head circuit, earphone and mobile terminal
CN104244162A (en) Noise detecting method and device of loudspeaker
CN102780941B (en) The control method of built-in DSP active audio amplifiers
CN105307077B (en) Acoustics volume adjustment method based on range information and sound equipment
CN106909360A (en) A kind of electronic installation, sound play device and balanced device method of adjustment
CN103474082A (en) Multi-microphone vocal accompaniment marking system and method thereof
US20130259247A1 (en) Audio control system
CN104640049B (en) A kind of method and system for distinguishing the earphone for whether supporting speech voice input function
CN103974168A (en) Information processing method and electronic devices
CN103377674A (en) Audio player and control method thereof
CN206100419U (en) On -vehicle speaker broadcasting volume adjusting device and vehicle
CN105827209A (en) Sound output device and control method thereof
CN102855905B (en) Audio playing apparatus and method for controlling volume thereof
CN101600132A (en) Method and device at portable handheld device adjusted audio file play effect
CN103686580B (en) A kind of multi-path audio output interface automatic test approach and equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant