WO2016192187A1 - 一种识别耳机的方法和装置 - Google Patents

一种识别耳机的方法和装置 Download PDF

Info

Publication number
WO2016192187A1
WO2016192187A1 PCT/CN2015/084832 CN2015084832W WO2016192187A1 WO 2016192187 A1 WO2016192187 A1 WO 2016192187A1 CN 2015084832 W CN2015084832 W CN 2015084832W WO 2016192187 A1 WO2016192187 A1 WO 2016192187A1
Authority
WO
WIPO (PCT)
Prior art keywords
voltage
earphone
button
module
mic
Prior art date
Application number
PCT/CN2015/084832
Other languages
English (en)
French (fr)
Inventor
魏国华
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016192187A1 publication Critical patent/WO2016192187A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/02Constructional features of telephone sets

Definitions

  • This application relates to, but is not limited to, terminal technology.
  • FIG. 1 is a schematic structural view of a device for recognizing an earphone according to the related art.
  • the method for identifying an earphone according to the related art generally includes: a preset module pre-stores a voltage between a microphone (MIC) end and a correspondence between the keys, and the insertion and extraction detection module detects the insertion of the earphone to the modulus.
  • the conversion (ADC, Analog to Digital Converter) detection module sends a notification message; after receiving the notification message, the ADC detection module detects the voltage of the MIC terminal, and sends the detected voltage of the MIC terminal to the multi-button detection module; the multi-button detection module is in the corresponding relationship.
  • ADC Analog to Digital Converter
  • the button corresponding to the received voltage of the MIC terminal is searched; the button reporting subsystem converts the found button into a universal key value that the mobile terminal can recognize.
  • the multi-key detection module cannot find the button corresponding to the voltage of the received MIC terminal in the corresponding relationship, or the insertion and removal detection module detects that the earphone is pulled out, the process ends.
  • This paper proposes a method and apparatus for recognizing earphones that can recognize different earphones.
  • a method of identifying a headset comprising:
  • the user When the earphone insertion is detected, the user is sequentially sent an instruction to press a pre-saved button;
  • the correspondence further includes information indicating the inserted earphone.
  • it also includes:
  • the voltage of the MIC terminal is detected, and the button corresponding to the detected voltage of the MIC terminal is searched for in the corresponding relationship, and the found button is converted into a common key value.
  • the method further includes:
  • the method further includes:
  • the voltage of the MIC terminal is detected, and the button corresponding to the detected voltage of the MIC terminal is searched for in the corresponding relationship, and the found button is converted into a common key value.
  • the correspondence between the two also includes:
  • An instruction to input the information indicating the inserted earphone is transmitted to the user, and information indicating the inserted earphone from the user is received.
  • a device for identifying an earphone comprising:
  • the first detecting module is configured to: when detecting the insertion of the earphone, send a first notification message to the sending module;
  • the sending module is configured to: after receiving the first notification message, sequentially send an instruction to the user to press a pre-stored button, and send a second notification message to the second detecting module;
  • the second detecting module is configured to: receive the second notification message, and detect the voltage of the MIC terminal;
  • the storage module is configured to: determine that the absolute value of the difference between the detected voltage of the MIC terminal and the preset voltage is greater than or equal to a preset threshold, and save a correspondence between the pre-stored button and the detected voltage of the MIC terminal .
  • the storage module is configured to:
  • the device also includes:
  • the control module is configured to: search for a button corresponding to the detected voltage of the MIC end in the corresponding relationship, and convert the found button into a universal key value.
  • the device further includes a confirmation module,
  • the first detecting module is further configured to: when detecting the insertion of the earphone, send a third notification message to the confirmation module;
  • the confirmation module is configured to: confirm that the inserted headset is not recognized by itself, and send the first notification message to the sending module.
  • the confirmation module is further configured to:
  • the second detection module is further configured to:
  • the device also includes:
  • the control module is configured to: search for a button corresponding to the detected voltage of the MIC end in the corresponding relationship, and convert the found button into a universal key value.
  • the storage module is configured to:
  • a computer readable storage medium storing computer executable instructions for performing the method of any of the above.
  • the embodiment of the present invention includes: when detecting the insertion of the earphone, sequentially sending an instruction to the user to press a pre-stored button; detecting the voltage of the MIC terminal; determining the detected voltage between the MIC terminal and the preset voltage The absolute value of the difference is greater than or equal to the preset threshold, and the correspondence between the previously saved button and the detected voltage of the MIC terminal is saved.
  • the inserted earphones are identified by saving the corresponding relationship of the inserted earphones, so that different earphones can be identified.
  • FIG. 1 is a schematic structural diagram of a device for recognizing an earphone according to the related art
  • FIG. 2 is a schematic diagram of a hardware principle of a general-purpose earphone according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a method for identifying an earphone according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of an apparatus for identifying an earphone according to an embodiment of the present invention.
  • the earphone includes a switch S0, a switch S1, a switch S2, a switch S3, a switch S4, a resistor R0, a resistor R1, a resistor R2, a resistor R3, a resistor R4, and a resistor R5.
  • the switch S0, the switch S1, the switch S2, the switch S3, and the switch S4 respectively correspond to the five buttons of the earphone, respectively, a Play/Stop button, a volume+, a volume-, a forward, and a backward.
  • Different key values represent different impedances.
  • an embodiment of the present invention provides a method for identifying an earphone, including:
  • Step 300 When detecting the insertion of the earphone, sequentially send an instruction to the user to press a pre-stored button.
  • the general purpose input/output (GPIO) interrupt detection method can be used to detect whether there is a headphone insertion.
  • the GPIO can be pulled up to 1.8 volts (V).
  • V 1.8 volts
  • the GPIO level is high.
  • the GPIO level is low, so that the headphones can be judged according to the change of the GPIO level. The status is inserted or removed.
  • the pre-saved keys are: Play/Stop button, volume+, volume-, forward, back button, etc., which are set on the earphone.
  • This step can prompt the user to press these keys in order to identify and save the correspondence between each button and the voltage of the MIC terminal.
  • the method further includes: confirming that the inserted earphone is not recognized by itself.
  • the subsequent process is terminated, and the voltage of the MIC terminal is detected, and the button corresponding to the detected voltage of the MIC terminal is searched for in the corresponding relationship, and the found button is converted into a common key value.
  • the button corresponding to the detected voltage of the MIC terminal in the corresponding relationship includes: searching for the information indicating the inserted earphone and the detected voltage of the MIC terminal in the correspondence relationship. Corresponding buttons.
  • the method further includes: transmitting information indicating whether the identification is necessary to the user; and receiving information indicating that the user needs to be identified.
  • information indicating whether or not identification is necessary may be sent to the user in an inquiry manner.
  • the inserted earphone needs to be identified by using the method of the embodiment of the present invention; if the user selects that no identification is needed, the user inserts the earphone as a single-keyed earphone. Or without a button earphone, the inserted earphone need not be identified by the method of the embodiment of the invention.
  • this step it is possible to confirm whether the inserted earphone has been recognized by asking the user. For example, all the headphones in the correspondence saved by themselves are displayed to the user in the form of a list, and the user selects the earphone from the list or selects the earphone that is not saved with the insertion. When the user selects the earphone from the list, it indicates that the inserted earphone is recognized by itself; when the user selects that the inserted earphone is not saved, it indicates that the inserted earphone is not recognized by itself.
  • the user may also be prompted to input the inserted earphone, and the inserted earphone input by the user is matched with the earphone in the corresponding relationship saved by itself, and if it can be matched, it indicates that the earphone inserted by the user has been identified, and if it cannot be matched, it indicates that the earphone has not been recognized. Insert headphones.
  • the information indicating the inserted earphone in the corresponding relationship may be the model number, name, and the like of the earphone, and may be input by the user arbitrarily or may be generated by the system by default.
  • the user may be sent a command to press a pre-saved button in a display manner.
  • Step 301 Detect the voltage of the MIC terminal.
  • the voltage of the MIC terminal is detected within a preset time after the instruction to press the previously saved button is sent.
  • Step 302 Determine that the absolute value of the difference between the detected voltage of the MIC terminal and the preset voltage is greater than or equal to a preset threshold, and save a correspondence between the pre-stored button and the detected voltage of the MIC terminal.
  • the correspondence may also include information indicating the inserted earphone.
  • the preset voltage is the voltage of the ADC terminal detected when all the buttons are not pressed.
  • the detected voltage of the MIC terminal and the preset voltage are determined. Before the absolute value of the difference between the difference is greater than or equal to the preset threshold, before the correspondence between the pre-stored button and the detected voltage of the MIC terminal is saved, the method further includes:
  • An instruction to input information indicating the inserted earphone is transmitted to the user, and information indicating the inserted earphone from the user is received.
  • the user may send an instruction to press a button to detect the voltage of the MIC terminal, and then continue to send an instruction to the user to press another button until all the buttons are executed, and then each of the detected signals is separately determined. Whether the absolute value of the difference between the voltage of the MIC terminal corresponding to the button and the preset voltage is greater than or equal to a preset threshold.
  • the user may be prompted to input information indicating the inserted earphone, such as the name of the inserted earphone.
  • the user may also send a command to press a button to detect the voltage of the MIC terminal, and determine whether the absolute value of the difference between the detected voltage of the MIC terminal and the preset voltage is greater than or equal to a preset threshold, and if so, save the insertion.
  • the user After the correspondence between the earphone, the pre-saved button and the detected voltage of the MIC terminal, the user continues to send an instruction to press another button until all the buttons are executed.
  • the user may be prompted to input the name of the inserted earphone, and the like.
  • the method further includes:
  • the voltage of the MIC terminal is detected, and the button corresponding to the detected voltage of the MIC terminal is searched for in the corresponding relationship, and the found button is converted into a common key value.
  • the button corresponding to the detected voltage of the MIC terminal in the corresponding relationship includes: searching for the information indicating the inserted earphone and the detected voltage of the MIC terminal in the correspondence relationship. Corresponding buttons.
  • the inserted earphones are identified by saving the corresponding relationship of the inserted earphones, so that different earphones can be identified.
  • an embodiment of the present invention further provides a device for recognizing an earphone, which can be disposed in any device with a headphone jack, and includes at least:
  • the first detecting module 41 is configured to: when detecting the insertion of the earphone, send the first to the sending module 42 a notification message;
  • the sending module 42 is configured to: when receiving the first notification message, sequentially send an instruction to the user to press a pre-stored button, and send a second notification message to the second detecting module 43;
  • the second detecting module 43 is configured to: receive a second notification message, and detect a voltage of the MIC terminal;
  • the storage module 44 is configured to: determine that the absolute value of the difference between the detected voltage of the MIC terminal and the preset voltage is greater than or equal to a preset threshold, and save the correspondence between the pre-stored button and the detected voltage of the MIC terminal. relationship.
  • the storage module 44 is configured to:
  • the control module 45 is configured to: search for a button corresponding to the detected voltage of the MIC terminal in the corresponding relationship, and convert the found button into a universal key value.
  • the device of the embodiment of the present invention may further include a confirmation module 46.
  • the first detection module 41 is further configured to: when the headset is detected, send a third notification message to the confirmation module 46;
  • the confirmation module 46 is configured to confirm that the inserted earphone is not recognized by itself, and send a first notification message to the transmitting module 42.
  • the confirmation module 46 is further configured to:
  • the fourth notification message is sent to the second detecting module 43;
  • the second detecting module 43 is further configured to:
  • the control module 45 is configured to: search for a button corresponding to the detected voltage of the MIC terminal in the corresponding relationship, and convert the found button into a universal key value.
  • the storage module 44 is configured to:
  • Determining that the absolute value of the difference between the detected voltage of the MIC terminal and the preset voltage is greater than or equal to At a preset threshold, an instruction to input information indicating the inserted earphone is sent to the user, information indicating the inserted earphone from the user is received, information indicating the inserted earphone, pre-stored key and detected voltage of the MIC terminal are saved. Correspondence between the two.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • the device/function module/functional unit in the above embodiment When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the inserted earphone is identified by saving the corresponding relationship between the button of the inserted earphone and the voltage of the MIC terminal, so that different earphones can be identified.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)

Abstract

本文公布一种识别耳机的方法和装置,包括:检测到耳机插入时,依次向用户发送按下预先保存的按键的指令;检测麦克MIC端的电压;判断出检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值,保存预先保存的按键和检测到的MIC端的电压之间的对应关系。

Description

一种识别耳机的方法和装置 技术领域
本申请涉及但不限于终端技术。
背景技术
图1为相关技术的识别耳机的装置的结构组成示意图。如图1所示,相关技术的识别耳机的方法大致包括:预设模块预先保存有麦克(MIC)端的电压和按键之间的对应关系,插入拔出检测模块检测到耳机插入时,向模数转换(ADC,Analog to Digital Converter)检测模块发送通知消息;ADC检测模块接收到通知消息后,检测MIC端的电压,将检测得到的MIC端的电压发送给多按键检测模块;多按键检测模块在对应关系中查找接收到的MIC端的电压对应的按键;按键上报子系统将查找到的按键转换为移动终端能够识别的通用键值。其中,当多按键检测模块在对应关系中查找不到接收到的MIC端的电压对应的按键,或插入拔出检测模块检测到耳机拔出时,结束。
相关技术的识别耳机的方法中,由于当前在使用移动终端的过程中,很多移动终端售卖时不标配耳机,因此,用户往往需要自己购买耳机,而由于不同的耳机其按键对应的MIC端的电压各不相同,导致移动终端往往无法识别不同的耳机。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本文提出了一种识别耳机的方法和装置,能够识别不同的耳机。
一种识别耳机的方法,包括:
检测到耳机插入时,依次向用户发送按下预先保存的按键的指令;
检测MIC端的电压;
判断出检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值,保存预先保存的按键和检测到的MIC端的电压之间的对应关系。
可选地,所述对应关系还包括表示所述插入的耳机的信息。
可选地,还包括:
检测所述MIC端的电压,在所述对应关系中查找检测到的MIC端的电压对应的按键,将查找到的按键转换为通用键值。
可选地,所述检测到耳机插入后,在所述依次向用户发送按下预先保存的按键的指令之前还包括:
确认出自身未识别过所述插入的耳机。
可选地,当确认出自身识别过所述插入的耳机时,该方法还包括:
检测所述MIC端的电压,在所述对应关系中查找检测到的MIC端的电压对应的按键,将查找到的按键转换为通用键值。
可选地,所述判断出检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值后,在所述保存预先保存的按键和检测到的MIC端的电压之间的对应关系之前还包括:
向所述用户发送输入所述表示插入的耳机的信息的指令,接收到来自所述用户的表示插入的耳机的信息。
一种识别耳机的装置,包括:
第一检测模块,设置为:检测到耳机插入时,向发送模块发送第一通知消息;
发送模块,设置为:接收到第一通知消息,则依次向用户发送按下预先保存的按键的指令,并向第二检测模块发送第二通知消息;
第二检测模块,设置为:接收到第二通知消息,检测MIC端的电压;
存储模块,设置为:判断出检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值,保存预先保存的按键和检测到的MIC端的电压之间的对应关系。
可选地,所述存储模块是设置为:
判断出检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值,保存表示所述插入的耳机的信息、所述预先保存的按键和所述检测到的MIC端的电压之间的对应关系。
可选地,
所述装置还包括:
控制模块,设置为:在所述对应关系中查找检测到的MIC端的电压对应的按键,将查找到的按键转换为通用键值。
可选地,所述装置还包括确认模块,
所述第一检测模块还设置为:在检测到耳机插入时,向确认模块发送第三通知消息;
所述确认模块,设置为:确认出自身未识别过所述插入的耳机,向所述发送模块发送所述第一通知消息。
可选地,所述确认模块还设置为:
确认出自身识别过所述插入的耳机时,向所述第二检测模块发送第四通知消息;
所述第二检测模块还设置为:
接收到所述第四通知消息,检测所述MIC端的电压;
所述装置还包括:
控制模块,设置为:在所述对应关系中查找检测到的MIC端的电压对应的按键,将查找到的按键转换为通用键值。
可选地,所述存储模块是设置为:
判断出所述检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值,向所述用户发送输入所述表示插入的耳机的信息的指令,接收到来自所述用户的表示插入的耳机的信息,保存所述表示插入的耳机的信息、预先保存的按键和检测到的MIC端的电压之间的对应关系。
一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述任一项的方法。
与相关技术相比,本发明实施例包括:检测到耳机插入时,依次向用户发送按下预先保存的按键的指令;检测MIC端的电压;判断出检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值,保存预先保存的按键和检测到的MIC端的电压之间的对应关系。通过本发明实施例的方案,在检测到耳机插入时,通过保存插入的耳机的对应关系来对插入的耳机进行识别,从而能够识别出不同的耳机。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1为相关技术的识别耳机的装置的结构组成示意图;
图2为本发明实施例通用的耳机的硬件原理示意图;
图3为本发明实施例识别耳机的方法的流程图;
图4为本发明实施例识别耳机的装置的结构组成示意图。
本发明的实施方式
下面结合附图对本发明的实施方式作进一步的描述。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的各种方式可以相互组合。
图2为通用的耳机的硬件原理示意图。如图2所示,耳机包含有开关S0、开关S1、开关S2、开关S3、开关S4、电阻R0、电阻R1、电阻R2、电阻R3、电阻R4、电阻R5。
其中,开关S0、开关S1、开关S2、开关S3、开关S4分别对应耳机的五个按键,分别为Play/Stop键、音量+、音量-、前进、后退。不同的键值代表不同的阻抗,当某一个按键按下时,ADC端的电压是不同的,假设MIC端的电压为V1,耳机的电压为V,则
Figure PCTCN2015084832-appb-000001
其中R5和R0的值一般是固定的,为2.2K欧姆,上述公式中,当S0键按下时,V1=0伏特,当S1键按下时,R=R1,当S2键按下时,R=R1+R2,当S3键按下时, R=R1+R2+R3,当S4键按下时,R=R1+R2+R3+R4。R1,R2,R3,R4对于不同的厂家来说都是不同的,所以根据不同的ADC端的电压就可以判断出当前按下的是哪个按键,而不同的耳机对应的电阻R0、电阻R1、电阻R2、电阻R3、电阻R4都不尽相同,因此,为移动终端识别不同的耳机造成了困难。
针对上述问题,参见图3,本发明实施例提出了一种识别耳机的方法,包括:
步骤300、检测到耳机插入时,依次向用户发送按下预先保存的按键的指令。
本步骤中,可以采用通用输入/输出(GPIO,General Purpose Input Output)中断检测的方法检测是否有耳机插入。可以将GPIO上拉到1.8伏特(V),当耳机拔出时,GPIO电平为高电平,当耳机插入时GPIO电平为低电平,这样,根据GPIO电平的变化就能够判断耳机状态为插入或拔出。
本步骤中,预先保存的按键指:Play/Stop键、音量+、音量-、前进、后退键等这些设置在耳机上的键。本步骤可以提示用户按顺序按下这些键,以便进行识别和保存每个按键与MIC端的电压之间的对应关系。
本步骤中,检测到耳机插入后,在依次向用户发送按下预先保存的按键的指令之前还包括:确认出自身未识别过插入的耳机。
其中,当确认出自身识别过插入的耳机时,结束后续流程,并检测MIC端的电压,在对应关系中查找检测到的MIC端的电压对应的按键,将查找到的按键转换为通用键值。
其中,当对应关系中还包括表示插入的耳机的信息时,在对应关系中查找检测到的MIC端的电压对应的按键包括:在对应关系中查找表示插入的耳机的信息和检测到的MIC端的电压对应的按键。
本步骤中,检测到耳机插入后,在依次向用户发送按下预先保存的按键的指令之前还包括:向用户发送表示是否需要进行识别的信息;接收到来自用户的表示需要进行识别的信息。
其中,当接收到来自用户的表示不需要进行识别的信息,则结束后续流程。
其中,可以以询问的方式向用户发送表示是否需要进行识别的信息。
如果用户选择需要进行识别,表示用户插入的耳机为多按键耳机,则需要采用本发明实施例的方法对插入的耳机进行识别;如果用户选择不需要进行识别,表示用户插入的耳机为单按键耳机或无按键耳机,则不需要采用本发明实施例的方法对插入的耳机进行识别。
本步骤中,可以通过询问用户的方法来确认自身是否识别过插入的耳机。例如,将自身保存的对应关系中的所有耳机以列表的形式显示给用户,用户从列表中选择耳机或者选择未保存有插入的耳机。当用户从列表中选择耳机时,说明自身识别过插入的耳机;当用户选择未保存有插入的耳机时,说明自身未识别过插入的耳机。也可以提示用户输入插入的耳机,将用户输入的插入的耳机和自身保存的对应关系中的耳机进行匹配,如果能够匹配上,说明自身识别过插入的耳机,如果不能匹配,说明自身未识别过插入的耳机。
本步骤中,对应关系中的表示插入的耳机的信息可以是耳机的型号、名称等,可以由用户随意输入,也可以由系统默认生成。
本步骤中,可以采用显示的方式向用户发送按下预先保存的按键的指令。
步骤301、检测MIC端的电压。
本步骤中,发送按下预先保存的按键的指令后的预设时间内检测MIC端的电压。
步骤302、判断出检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值,保存预先保存的按键和检测到的MIC端的电压之间的对应关系。
本步骤中,对应关系中还可以包含有表示插入的耳机的信息。
本步骤中,当判断出检测到的MIC端的电压和预设电压之间的差值的绝对值小于预设阈值时,说明用户在预设时间内没有按下任何按键,则结束本流程。
本步骤中,预设电压是指所有按键均没有按下时检测到的ADC端的电压。
本步骤中,作为可选的步骤,判断出检测到的MIC端的电压和预设电压 之间的差值的绝对值大于或等于预设阈值后,在保存预先保存的按键和检测到的MIC端的电压之间的对应关系之前还包括:
向用户发送输入表示插入的耳机的信息的指令,接收到来自用户的表示插入的耳机的信息。
本发明实施例的方法中,可以向用户发送按下一个按键的指令,检测MIC端的电压后,继续向用户发送按下另一个按键的指令,直到所有按键执行完毕,再分别判断检测到的每个按键对应的MIC端的电压和预设电压之间的差值的绝对值是否大于或等于预设阈值。
其中,保存对应关系时,可以提示用户输入表示插入的耳机的信息,如插入的耳机的名称等。
也可以向用户发送按下一个按键的命令,检测MIC端的电压,判断检测到的MIC端的电压和预设电压之间的差值的绝对值是否大于或等于预设阈值,如果是,则保存插入的耳机、预先保存的按键和检测到的MIC端的电压之间的对应关系后,继续向用户发送按下另一个按键的指令,直到所有按键执行完毕。
其中,可以在保存第一个按键的对应关系时,提示用户输入插入的耳机的名称等。
在所有按键执行完毕后,作为可选的步骤,该方法还包括:
检测MIC端的电压,在对应关系中查找检测到的MIC端的电压对应的按键,将查找到的按键转换为通用键值。
其中,当对应关系中还包括表示插入的耳机的信息时,在对应关系中查找检测到的MIC端的电压对应的按键包括:在对应关系中查找表示插入的耳机的信息和检测到的MIC端的电压对应的按键。
通过本发明实施例的方案,在检测到耳机插入时,通过保存插入的耳机的对应关系来对插入的耳机进行识别,从而能够识别出不同的耳机。
参见图4,本发明实施例还提出了一种识别耳机的装置,可以设置在任何带有耳机插孔的设备中,至少包括:
第一检测模块41,设置为:检测到耳机插入时,向发送模块42发送第 一通知消息;
发送模块42,设置为:接收到第一通知消息,则依次向用户发送按下预先保存的按键的指令,并向第二检测模块43发送第二通知消息;
第二检测模块43,设置为:接收到第二通知消息,检测MIC端的电压;
存储模块44,设置为:判断出检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值,保存预先保存的按键和检测到的MIC端的电压之间的对应关系。
本发明实施例的装置中,存储模块44是设置为:
判断出检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值,保存表示所述插入的耳机的信息、所述预先保存的按键和所述检测到的MIC端的电压之间的对应关系。
本发明实施例的装置还可包括:
控制模块45,设置为:在对应关系中查找检测到的MIC端的电压对应的按键,将查找到的按键转换为通用键值。
本发明实施例的装置还可包括确认模块46,第一检测模块41还设置为:在检测到耳机插入时,向确认模块46发送第三通知消息;
确认模块46,设置为:确认出自身未识别过插入的耳机,向发送模块42发送第一通知消息。
本发明实施例的装置中,确认模块46还设置为:
确认出自身保存识别过插入的耳机时,向第二检测模块43发送第四通知消息;
第二检测模块43还设置为:
接收到第四通知消息,检测MIC端的电压;
控制模块45,设置为:在对应关系中查找检测到的MIC端的电压对应的按键,将查找到的按键转换为通用键值。
本发明实施例的装置中,存储模块44是设置为:
判断出检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等 于预设阈值,向用户发送输入表示插入的耳机的信息的指令,接收到来自用户的表示插入的耳机的信息,保存表示插入的耳机的信息、预先保存的按键和检测到的MIC端的电压之间的对应关系。
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。
上述实施例中的装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。
上述实施例中的装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。
工业实用性
通过本发明实施例的方案,在检测到耳机插入时,通过保存插入的耳机的按键与MIC端电压的对应关系来对插入的耳机进行识别,从而能够识别出不同的耳机。

Claims (13)

  1. 一种识别耳机的方法,包括:
    检测到耳机插入时,依次向用户发送按下预先保存的按键的指令;
    检测麦克MIC端的电压;
    判断出检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值,保存预先保存的按键和检测到的MIC端的电压之间的对应关系。
  2. 根据权利要求1所述的方法,其中,所述对应关系还包括表示所述插入的耳机的信息。
  3. 根据权利要求1或2所述的方法,还包括:
    检测所述MIC端的电压,在所述对应关系中查找检测到的MIC端的电压对应的按键,将查找到的按键转换为通用键值。
  4. 根据权利要求1或2所述的方法,其中,所述检测到耳机插入后,在所述依次向用户发送按下预先保存的按键的指令之前还包括:
    确认出自身未识别过所述插入的耳机。
  5. 根据权利要求4所述的方法,其中,当确认出自身识别过所述插入的耳机时,该方法还包括:
    检测所述MIC端的电压,在所述对应关系中查找检测到的MIC端的电压对应的按键,将查找到的按键转换为通用键值。
  6. 根据权利要求2所述的方法,其中,所述判断出检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值后,在所述保存预先保存的按键和检测到的MIC端的电压之间的对应关系之前还包括:
    向所述用户发送输入所述表示插入的耳机的信息的指令,接收到来自所述用户的表示插入的耳机的信息。
  7. 一种识别耳机的装置,包括:
    第一检测模块,设置为:检测到耳机插入时,向发送模块发送第一通知消息;
    发送模块,设置为:接收到第一通知消息,则依次向用户发送按下预先保存的按键的指令,并向第二检测模块发送第二通知消息;
    第二检测模块,设置为:接收到第二通知消息,检测麦克MIC端的电压;
    存储模块,设置为:判断出检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值,保存预先保存的按键和检测到的MIC端的电压之间的对应关系。
  8. 根据权利要求7所述的装置,其中,所述存储模块是设置为:
    判断出检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值,保存表示所述插入的耳机的信息、所述预先保存的按键和所述检测到的MIC端的电压之间的对应关系。
  9. 根据权利要求8所述的装置,还包括:
    控制模块,设置为:在所述对应关系中查找检测到的MIC端的电压对应的按键,将查找到的按键转换为通用键值。
  10. 根据权利要求7或8所述的装置,还包括确认模块,
    所述第一检测模块还设置为:在检测到耳机插入时,向确认模块发送第三通知消息;
    所述确认模块,设置为:确认出自身未识别过所述插入的耳机,向所述发送模块发送所述第一通知消息。
  11. 根据权利要求10所述的装置,还包括控制模块,
    所述确认模块还设置为:
    确认出自身识别过所述插入的耳机时,向所述第二检测模块发送第四通知消息;
    所述第二检测模块还设置为:
    接收到所述第四通知消息,检测所述MIC端的电压;
    所述控制模块,设置为:在所述对应关系中查找检测到的MIC端的电压对应的按键,将查找到的按键转换为通用键值。
  12. 根据权利要求7所述的装置,其中,所述存储模块是设置为:
    判断出所述检测到的MIC端的电压和预设电压之间的差值的绝对值大于或等于预设阈值,向所述用户发送输入所述表示插入的耳机的信息的指令,接收到来自所述用户的表示插入的耳机的信息,保存所述表示插入的耳机的信息、预先保存的按键和检测到的MIC端的电压之间的对应关系。
  13. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1-6任一项的方法。
PCT/CN2015/084832 2015-06-04 2015-07-22 一种识别耳机的方法和装置 WO2016192187A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510304422.2A CN106302971A (zh) 2015-06-04 2015-06-04 一种识别耳机的方法和装置
CN201510304422.2 2015-06-04

Publications (1)

Publication Number Publication Date
WO2016192187A1 true WO2016192187A1 (zh) 2016-12-08

Family

ID=57439976

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/084832 WO2016192187A1 (zh) 2015-06-04 2015-07-22 一种识别耳机的方法和装置

Country Status (2)

Country Link
CN (1) CN106302971A (zh)
WO (1) WO2016192187A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827803B (zh) * 2022-03-28 2023-05-09 荣耀终端有限公司 耳机、电子设备及耳机按键的检测方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101102337A (zh) * 2006-07-07 2008-01-09 上海晨兴电子科技有限公司 手机上实现多媒体线控耳机功能的一种方法
CN201039440Y (zh) * 2007-03-14 2008-03-19 中兴通讯股份有限公司 一种多个按键单个检测端的线控耳机
CN101719610A (zh) * 2009-12-30 2010-06-02 华为终端有限公司 一种有线耳机兼容方法和装置
CN101873367A (zh) * 2010-06-24 2010-10-27 深圳桑菲消费通信有限公司 一种扩展手机功能键的系统和方法
KR20120121057A (ko) * 2011-04-26 2012-11-05 삼성전자주식회사 휴대용 단말기에서 이어폰 인식 장치 및 방법

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1277202C (zh) * 2003-03-31 2006-09-27 联想(北京)有限公司 一种按键功能控制的实现方法
CN102256075B (zh) * 2011-07-12 2013-10-16 冠捷显示科技(厦门)有限公司 一种能够学习识别多种遥控器的电视机及其控制方法
CN103901791A (zh) * 2014-04-02 2014-07-02 联想(北京)有限公司 一种响应按键触控操作的方法、装置及电子设备
CN103945310B (zh) * 2014-04-29 2017-01-11 华为终端有限公司 一种传输方法、移动终端、多声道耳机及音频播放系统
CN104301824B (zh) * 2014-09-29 2018-03-23 广州酷狗计算机科技有限公司 线控设备、控制器、方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101102337A (zh) * 2006-07-07 2008-01-09 上海晨兴电子科技有限公司 手机上实现多媒体线控耳机功能的一种方法
CN201039440Y (zh) * 2007-03-14 2008-03-19 中兴通讯股份有限公司 一种多个按键单个检测端的线控耳机
CN101719610A (zh) * 2009-12-30 2010-06-02 华为终端有限公司 一种有线耳机兼容方法和装置
CN101873367A (zh) * 2010-06-24 2010-10-27 深圳桑菲消费通信有限公司 一种扩展手机功能键的系统和方法
KR20120121057A (ko) * 2011-04-26 2012-11-05 삼성전자주식회사 휴대용 단말기에서 이어폰 인식 장치 및 방법

Also Published As

Publication number Publication date
CN106302971A (zh) 2017-01-04

Similar Documents

Publication Publication Date Title
US8798285B2 (en) Electronic device and method thereof for identifying electronic accessory
US9306879B2 (en) Message-based identification of an electronic device
TWI633486B (zh) 耳機接口狀態偵測系統與方法
JP2016151608A (ja) 電子装置、情報端末システム、音声認識機能の起動プログラムおよび音声認識機能の起動方法
US11810541B2 (en) Electronic musical instrument, power control device for electronic musical instrument, and power control method
TWI539829B (zh) 偵測電路
US20230308976A1 (en) Seamless bluetooth switching system
WO2017166598A1 (zh) 一种耳机的声道调节方法及装置、电子设备及存储介质
EP3139377A1 (en) Guidance device, guidance method, program, and information storage medium
US9384752B2 (en) Audio device and storage medium
WO2016192187A1 (zh) 一种识别耳机的方法和装置
WO2017166606A1 (zh) 一种音频播放方法、装置、终端设备、电子设备及存储介质
KR20130007696A (ko) 이어잭을 이용한 휴대 단말기의 디버깅 시스템 및 방법
US10194231B2 (en) Circuit for detecting button action on earphone, terminal, and earphone
CN115426577A (zh) 耳机佩戴检测方法、装置、头戴式耳机及可读存储介质
US10602273B2 (en) Audio playing apparatus and audio transmission circuit
CN114501286A (zh) 蓝牙连接测试方法及装置
WO2016192675A1 (zh) 一种输出充电电流的方法及功率放大器
US20100053453A1 (en) Digital media controller
US10515025B2 (en) Communication protocol adapter
EP1511237A2 (en) Wireless Communication device and a method for establishing communication connection
EP3253067A1 (en) Terminal device, and signal transmission method and device
CN111031433A (zh) 无线耳机及其交互方法、交互系统
CN111988768B (zh) 蓝牙配对控制方法、装置、蓝牙设备及可读存储介质
US20220272253A1 (en) Image capturing apparatus including plurality of sound input units, control method, and recording medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15893843

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15893843

Country of ref document: EP

Kind code of ref document: A1