WO2015143896A1 - Recognition circuit, method, apparatus and system for external device based on earphone socket - Google Patents
Recognition circuit, method, apparatus and system for external device based on earphone socket Download PDFInfo
- Publication number
- WO2015143896A1 WO2015143896A1 PCT/CN2014/093598 CN2014093598W WO2015143896A1 WO 2015143896 A1 WO2015143896 A1 WO 2015143896A1 CN 2014093598 W CN2014093598 W CN 2014093598W WO 2015143896 A1 WO2015143896 A1 WO 2015143896A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- volume
- value
- electronic device
- predetermined
- recording
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R5/00—Stereophonic arrangements
- H04R5/04—Circuit arrangements, e.g. for selective connection of amplifier inputs/outputs to loudspeakers, for loudspeaker detection, or for adaptation of settings to personal preferences or hearing impairments
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R2420/00—Details of connection covered by H04R, not provided for in its groups
- H04R2420/03—Connection circuits to selectively connect loudspeakers or headphones to amplifiers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R29/00—Monitoring arrangements; Testing arrangements
Definitions
- the present invention relates to a device identification technology, and in particular to an external device identification circuit, method, device and system based on a headphone jack.
- Intelligent electronic devices can be connected to external devices through their earphone sockets, such as smart electronic devices through their earphone sockets and earphones, Lara equipment, mobile phone infrared remote control or mobile phone button devices Wait for external devices to connect.
- the intelligent electronic device In the case that the intelligent electronic device is connected to the external device through its earphone socket, the intelligent electronic device should effectively identify the inserted external device. Otherwise, the smart electronic device considers that the external device inserted in the earphone socket is the earphone, thus, the smart electronic device The device outputs sound through the headphones, which may result in the user not being able to make and receive calls (in the case of smart electronic devices as smart mobile phones), listening to music, and watching videos.
- an intelligent electronic device to identify an external device inserted in its earphone socket: mode one: an external device based on the ultrasonic modulation and demodulation technology of the 10KHZ frequency band; mode 2, based on the MCU (micro control unit)
- the external device is identified, that is, when the earphone plug of the external device is inserted into the earphone socket, the MCU in the external device actively outputs a special audio signal to the intelligent electronic device, so that the intelligent electronic device can recognize the special audio signal received by the smart electronic device. Plug in an external device to the headphone jack.
- the inventor has found that, in the case of the above manner, in the case where the earphone socket of the intelligent electronic device is inserted into the earphone, if the ultrasonic external device of the 10KHZ frequency band is used for identification, a harsh high-frequency sound is generated. The stimulation to the human ear is very large, which will affect the user's feelings.
- the intelligent electronic device performs external device identification during the music playing, the concert played by it affects the accuracy of the external device identification; In other words, because the MCU is large in size and high in cost, setting the MCU in the external device may have a large impact on the volume and cost of the external device.
- the present invention has been made in order to provide an external device identification circuit based on a headphone jack that overcomes the above problems or at least partially solves the above problems, a corresponding external device identification method based on a headphone jack, and an external device identification based on a headphone jack
- the device and the external device identification system based on the earphone socket, the computer program, and the computer readable medium.
- an external device identification circuit based on a headphone jack includes: an earphone plug and a recording circuit; the earphone plug has a channel connection end, a microphone connection end, and a ground end; The circuit has a first connection end, a second connection end, and a third connection end; wherein the first connection end is connected to the channel connection end, and the second connection end is connected to the microphone connection end, The third connection end is connected to the ground end; the recording circuit is connected to the microphone in the smart electronic device through the earphone plug and the earphone socket in the smart electronic device, and the recording circuit and the earphone plug, the earphone socket and the microphone Together form a microphone circuit.
- a method for identifying an external device based on a headphone jack includes: triggering an intelligent electronic device to record after the earphone socket of the smart electronic device is inserted into the external device, and the smart electronic device is The current audio playback volume is set to a first predetermined value; in the case of the first predetermined value, the volume value of the sound obtained by the recording is acquired; the current audio playback volume of the intelligent electronic device is set to a second predetermined value; Predetermining an audio signal, and in the case of the second predetermined value, acquiring a volume value of the sound obtained by the recording; determining from a comparison between the volume value acquired for the first predetermined value and the volume value acquired for the second predetermined value Whether the external device is an external device provided with a recording circuit and a headphone plug, and the recording circuit forms a microphone circuit together with the earphone plug and the earphone socket and the microphone of the smart electronic device.
- an external device identification device based on a headphone jack, comprising: a first setting module, configured to trigger an intelligent electronic device to record after detecting that the earphone socket of the smart electronic device is inserted into the external device And setting a current audio playback volume of the smart electronic device to a first predetermined value; the first obtaining module is adapted to obtain a volume value of the sound obtained by the recording in the first predetermined value; the second setting a module adapted to set a current audio playback volume of the intelligent electronic device to a second predetermined value; a second acquisition module adapted to play a predetermined audio signal, and obtain, by the second predetermined value, the obtained by the recording a volume value of the sound; the identification module, configured to determine whether the external device is an external device provided with a recording loop and a headphone plug according to a comparison between a volume value acquired for the first predetermined value and a volume value obtained for the second predetermined value a device, and the recording circuit is shaped with
- an external device identification system based on a headphone jack comprising: an external device and an intelligent electronic device; wherein the external device is provided with the above identification circuit; the intelligent electronic device The above-mentioned external device identification device based on the earphone socket is provided.
- a computer program comprising computer readable code, when the electronic device runs the computer readable code, causes the DEBUG debugging method to be executed.
- a computer readable medium wherein a computer program as described above is stored.
- the earphone socket-based external device identification circuit, method, device and system of the present invention provide an external device identification circuit based on the earphone socket in the external device, and the recording circuit in the identification circuit passes through the earphone plug and the earphone in the smart electronic device
- the socket is connected with the microphone in the intelligent electronic device, and forms a microphone circuit, so that when the earphone socket of the intelligent electronic device is inserted into the external device having the identification circuit, the intelligent electronic device can realize recording through the microphone circuit;
- the volume value of the sound obtained by recording different sound sources in the audio playback volume has certain characteristics.
- the present invention can avoid the stimulation of the human ear by the ultrasonic wave during the identification process of the external device; since the identification circuit of the present invention uses the recording circuit ,and Large and costly sound effects can be realized using a simple circuit is usually cheaper components (such as capacitors and resistors, etc.), therefore, the present invention is to avoid the use of the MCU causing the external device to identify the volume of external devices.
- Figure 1 shows a schematic view of a headphone plug
- FIG. 2 is a schematic diagram showing a specific circuit structure of an external device identification circuit based on a headphone jack according to a first embodiment of the present invention
- FIG. 3 is a schematic diagram showing another specific circuit structure of an external device identification circuit based on a headphone jack according to a first embodiment of the present invention
- FIG. 4 is a schematic diagram showing still another specific circuit structure of an external device identification circuit based on a headphone jack according to the first embodiment of the present invention
- FIG. 5 is a flowchart of a method for identifying an external device based on a headphone jack according to a second embodiment of the present invention
- FIG. 6 is a flowchart of a method for identifying an external device based on a headphone jack according to a third embodiment of the present invention.
- FIG. 7 is a schematic diagram showing an initialization process in an external device identification method based on a headphone jack according to Embodiment 3 of the present invention.
- FIG. 8 is a schematic diagram of an external device identification device based on a headphone jack according to Embodiment 4 of the present invention.
- FIG. 9 is a schematic diagram of an external device identification device based on a headphone jack according to Embodiment 5 of the present invention.
- Figure 10 shows a block diagram of an electronic device for performing the method of the present invention
- Figure 11 shows a schematic diagram of a memory unit for holding or carrying program code implementing a method in accordance with the present invention.
- Embodiment 1 The external device identification circuit based on the earphone socket.
- the identification circuit of this embodiment will be described below with reference to Figs. 1, 2 and 3.
- the external device identification circuit based on the earphone socket of the embodiment mainly includes: an earphone plug and a recording circuit, wherein the recording circuit has a plurality of connecting ends, and the plurality of connecting ends are respectively connected with the plurality of connecting ends in the earphone plug.
- the current earphone plug usually has a channel connection end, a microphone connection end, and a ground end; when the earphone plug is a two-channel earphone plug, the above-mentioned channel connection end usually includes: a left channel connection end and a right channel connection When the earphone plug is a mono earphone plug, the above channel connection is usually a mono connection.
- FIG. 1 A specific example of a headphone plug is shown in Figure 1.
- the earphone plug of FIG. 1 conforms to the International Standard (CTIA)
- the earphone plug mainly includes: a microphone connection end 1, a ground connection terminal 2, a right channel connection end 3, and a left channel connection end 4.
- the earphone plug of FIG. 1 conforms to the National Standard (OMTP)
- the earphone plug mainly includes: a ground connection end 1, a microphone connection end 2, a right channel connection end 3, and a left channel connection end 4.
- the recording circuit of this embodiment is mainly used to form a microphone loop together with a microphone plug, a headphone jack, and a microphone in an intelligent electronic device, such as forming a condenser microphone loop.
- the recording circuit has a first connection end, a second connection end, and a third connection And the first connection end is connected to the channel connection end of the earphone plug, the second connection end is connected to the microphone connection end of the smart electronic device, and the third connection end is connected to the ground end of the earphone plug.
- the first connection end in the recording circuit is connected to the mono connection end of the earphone plug.
- the first connection end in the recording loop is connected to at least one of the left channel connection end and the right channel connection end; in general, the first in the recording loop A connection end is connected to the left channel connection end and the right channel connection end, respectively.
- the recording circuit usually includes components such as a capacitor and a resistor; a specific example of the recording circuit in this embodiment is shown in FIG.
- the recording circuit in FIG. 2 includes a capacitor C1, a resistor R1, and a resistor R2.
- One end of the capacitor C1 is the first connection end, and is connected to the right channel connection end and the left channel connection end of the earphone plug respectively, and the other end of the capacitor C1 is respectively connected with the resistor R1 and the resistor R2, and the capacitor C1 and the resistor R1 and The resistors R2 are connected in series, respectively.
- One end of the resistor R1 is the second connection end, and is connected to the ground connection end or the microphone connection end of the earphone plug, and the other end of the resistor R1 is connected to the capacitor C1.
- One end of the resistor R2 is the third connection end, and is connected to the microphone connection end or the ground connection end of the earphone plug, and the other end of the resistor R2 is connected to the capacitor C1.
- the resistor R1 and the resistor R2 are connected in parallel.
- the audio signal output by the intelligent electronic device can be transmitted back to the microphone in the intelligent electronic device through the earphone socket, the earphone plug and the recording circuit, and then the microphone circuit (capacitor) is formed. Microphone loop).
- both ends of the resistor R1 are connected to the ground connection end of the earphone plug and one end of the resistor R2 is connected to the earphone.
- the microphone connection end of the plug is connected, or one end of the resistor R1 is connected with the microphone connection end of the earphone plug, and one end of the resistor R2 is connected with the ground connection end of the earphone plug, and the recording circuit can be connected with the earphone plug and the earphone in the intelligent electronic device.
- the socket and the microphone together form a microphone circuit; thus the recording circuit shown in Figure 2 is applicable to both International Standard (CTIA) and National Standard (OMTP) headphone plugs.
- the capacitor C1 may be specifically a 1 uf (microfarad) capacitor, and the resistor R1 and the resistor R2 may be specifically a 1500 ohm resistor.
- the recording circuit in FIG. 2 can also optionally include: switch E1.
- the switch E1 is connected in series between the microphone connection end of the recording circuit and the ground connection end; when the switch E1 is closed, since the recording circuit no longer forms a condenser microphone circuit with the microphone in the intelligent electronic device, the external connection cannot be performed again. Whether the device is an identification process of an external device provided with the above identification circuit.
- FIG. 1 Another specific example of the recording circuit in this embodiment is shown in FIG. 1
- the recording circuit in Figure 3 includes: resistor R3, capacitor C2, and capacitor C3.
- One end of the resistor R3 is a first connection end, and is connected to the right channel connection end and the left channel connection end of the earphone plug, and the other end of the resistor R3 is respectively connected to the capacitor C2 and the capacitor C3, and the resistor R3 and the capacitor C2 and the capacitor are respectively connected.
- C3 is connected in series.
- One end of the capacitor C2 is a second connection end, and is connected to the ground connection end or the microphone connection end of the earphone plug, and the other end of the capacitor C2 is connected to the resistor R3.
- One end of the capacitor C3 is a third connection end, and is connected to the microphone connection end or the ground connection end of the earphone plug, and the other end of the capacitor C3 is connected to the resistor R3.
- the capacitor C2 and the capacitor C3 are connected in parallel.
- the resistor R3 in FIG. 3 is connected in series with the capacitor C2 and the capacitor C3, and the capacitor C2 is connected in parallel with the capacitor C3, both ends of the capacitor C2 are connected to the ground connection end of the earphone plug and one end of the capacitor C3 is connected to the earphone.
- the microphone connection end of the plug is connected, or one end of the capacitor C2 is connected with the microphone connection end of the earphone plug, and one end of the capacitor C3 is connected with the ground connection end of the earphone plug, and the recording circuit can be combined with the earphone plug and the intelligent electronic device.
- the headphone jack and the microphone together form a microphone circuit; thus the recording circuit shown in Figure 3 is applicable to both International Standard (CTIA) and National Standard (OMTP) headphone plugs.
- the resistor R3 may be a resistor of 100 ohms to 400 ohms, and the capacitor C2 and the capacitor C3 may be a 1 uf (microfarad) capacitor.
- the recording circuit in FIG. 3 can also optionally include: switch E1.
- the switch E1 is connected in series between the microphone connection end of the recording circuit and the ground connection end; when the switch E1 is closed, since the recording circuit no longer forms a condenser microphone circuit with the microphone in the intelligent electronic device, the external connection cannot be performed again. Whether the device is an identification process of an external device provided with the above identification circuit.
- FIG. 1 A further specific example of the recording circuit in this embodiment is shown in FIG. 1
- the recording circuit in FIG. 4 includes a resistor R4, a resistor R5, and a resistor R6.
- One end of the resistor R4 is a first connection end, and is connected to the right channel connection end and the left channel connection end of the earphone plug respectively, and the other end of the resistor R4 is respectively connected with the resistor R5 and the resistor R6, and the resistor R4 and the resistor R5 and the resistor are respectively connected.
- R6 is connected in series.
- One end of the resistor R5 is a second connection end, and is connected to the ground connection end or the microphone connection end of the earphone plug, and the other end of the resistor R5 is connected to the resistor R4.
- One end of the resistor R6 is a third connection end, and is connected to the microphone connection end or the ground connection end of the earphone plug, and the other end of the resistor R6 is connected to the resistor R4.
- the resistor R5 and the resistor R6 are connected in parallel.
- the earphone plug and the recording circuit after the audio signal output by the intelligent electronic device passes through the earphone socket, the earphone plug and the recording circuit, it can be transmitted back to the microphone in the intelligent electronic device by the earphone plug and the earphone socket, thereby forming a microphone circuit.
- the resistor R4 in FIG. 4 is connected in series with the resistor R5 and the resistor R6, and the resistor R5 is connected in parallel with the resistor R6, both ends of the resistor R5 are connected to the ground connection end of the earphone plug and one end of the resistor R6 is connected to the earphone.
- the microphone connection end of the plug is connected, or one end of the resistor R5 is connected to the microphone connection end of the earphone plug, and one end of the resistor R6 is connected with the ground connection end of the earphone plug, and the recording circuit can be combined with the earphone plug and the intelligent electronic device.
- the headphone jack and the microphone together form a microphone circuit; thus the recording circuit shown in Figure 4 is applicable to both International Standard (CTIA) and National Standard (OMTP) headphone plugs.
- the resistor R4 may be a 6k ohm resistor
- the resistor R5 may be a 6k ohm resistor
- the resistor R6 may be a 6k ohm resistor. It should be specially noted that the actual resistance values of the resistor R4, the resistor R5 and the resistor R6 in FIG. 4 may be the same or different; in the case where the sum of the resistances of any two resistors is in the range of 10k-15k,
- the recording circuit shown in 4 can be adapted to almost all types of mobile phones based on the Andriod operating system.
- the recording circuit in FIG. 4 can also optionally include: switch E1.
- the switch E1 is connected in series between the microphone connection end of the recording circuit and the ground connection end; when the switch E1 is closed, since the recording circuit no longer forms a condenser microphone circuit with the microphone in the intelligent electronic device, the external connection cannot be performed again. Whether the device is an identification process of an external device provided with the above identification circuit.
- Embodiment 2 An external device identification method based on a headphone jack. The method of this embodiment will be described below with reference to FIG.
- S400 after detecting that the earphone socket of the smart electronic device is inserted into the external device, triggers the recording of the intelligent electronic device, and sets the current audio playback volume of the smart electronic device to a first predetermined value.
- the smart electronic device in this embodiment may be an intelligent electronic device (such as a smart mobile phone or a tablet computer using the Andriod operating system) using the Andriod operating system.
- the embodiment may detect that the earphone socket of the smart electronic device is inserted into the external device (for example, receiving the broadcast of the operating system by registering the listener) The message, after determining that the external device is inserted into the earphone socket of the smart electronic device according to the received message, detecting the current state of the smart electronic device (for example, by reading the current log of the smart electronic device, etc.) If the current state of the smart electronic device is detected as a voice-related state such as a call state or a recording state, the subsequent external device identification operation in this embodiment should not be temporarily performed, but wait for the smart electronic device to end. After the voice-related operation (such as ending the call or ending the recording), the subsequent external device identification operation in this embodiment is
- the smart electronic device Since the external device identification process of the embodiment modifies the current audio playback volume of the smart electronic device, the smart electronic device is modified in the process of performing the external device identification in this embodiment. Before the current audio playback volume operation, the current audio playback volume of the smart electronic device should be obtained, and the current audio playback volume should be stored, so that when the external device identification process of the embodiment is completed, the current state of the smart electronic device can also be The audio playback volume is restored to the audio playback volume before the external device recognition operation. That is to say, after the current audio playback volume of the smart electronic device is stored, the smart electronic device is triggered to perform a recording operation, and the current audio playback volume of the smart electronic device is set to a first predetermined value.
- the first predetermined value may be a minimum value (ie, a mute value) of the smart electronic device, such as a first predetermined value of 0. That is, the embodiment may set the smart electronic device to a mute state.
- the operation of the triggering intelligent electronic device to perform the recording operation and the setting of the current audio playback volume of the intelligent electronic device to the first predetermined value may be limited.
- the two operations may be performed simultaneously; The recording operation is performed, and then the setting operation of the first predetermined value is performed; or, the setting operation of the first predetermined value may be performed first, and then the recording operation is performed.
- the above-mentioned operation of triggering the intelligent electronic device to perform the recording operation can be implemented by calling the recording function in the operating system of the intelligent electronic device.
- This embodiment does not limit the specific implementation manner of triggering the intelligent electronic device to perform the recording operation.
- the embodiment needs to acquire the volume value of the sound obtained by the recording if the current audio playback volume of the smart electronic device is set to the first predetermined value.
- the volume value of the sound obtained by the recording can be acquired.
- the current audio playback volume of the smart electronic device may be set to a first predetermined value. And waiting for the first predetermined time interval, the operation of acquiring the volume value of the sound obtained by the recording is performed.
- a plurality of volume values of the sound obtained by the recording may be obtained by using a timing acquisition manner, and an average value is calculated for the plurality of volume values, and the calculated volume average value is mainly used for a subsequent comparison process, and the volume is used for the subsequent comparison process.
- the average value can be referred to as a first volume average.
- the first volume average when calculating the first volume average, it may be determined whether the first volume average is greater than a predetermined volume value (eg, 1000), and if the first volume average is greater than a predetermined volume value (eg, greater than 1000), then The external device is not an external device provided with the identification circuit in the first embodiment, and the identification process of the external device ends; if the first volume average is not greater than a predetermined value (for example, less than or equal to 1000), the implementation continues. The subsequent identification steps of the example.
- a predetermined volume value eg, 1000
- the predetermined volume value may be preset in the smart electronic device according to experience; and the first predetermined time interval may be pre-set in the smart electronic device according to experience, or may be The sexuality is dynamically set in the intelligent electronic device for the actual situation of the intelligent electronic device.
- a specific example of dynamically setting the first predetermined time interval for the actual situation of the smart electronic device is: setting the current audio playback volume of the smart electronic device may be a volume that the user can manually adjust by means of a button, etc., for example, in an intelligent electronic device.
- the volume that can be manually adjusted by the user through buttons or the like is divided into 15 levels (the intelligent mobile phone of the Andriod operating system has 15 levels of volume that can be manually adjusted by the user).
- the 15 levels can be referred to as volume 0 to volume 14, respectively.
- the volume 0 indicates silence; according to the order of volume 1 to volume 14, the sound corresponding to each of volume 1 to volume 14 gradually increases, and the volume corresponding to volume 14 is the loudest.
- the specific setting process of the first predetermined time interval includes: first, in the case that the smart electronic device is first connected to the external device having the above identification circuit of the present embodiment through the earphone plug and the earphone socket In this embodiment, the initial setting operation may be performed on the external device.
- the current audio playback volume of the smart electronic device is set to a minimum volume other than the mute (ie, The above volume 1, that is, the volume corresponding to the minimum level other than the silent level); then, the triggering electronic device performs an operation of playing a locally stored audio signal (such as the second music built in the smart electronic device), and starts timing; After waiting for a period of time (such as 500 milliseconds), the smart electronic device is triggered to record, and after waiting for a period of time (such as 300 milliseconds), the volume value of the sound obtained by the recording is obtained (for example, obtaining the volume value returned by the operating system) And determine whether the volume value is greater than a predetermined value (such as 100) and whether the current timing value is A predetermined time period (for example, 2 seconds) is reached.
- a predetermined value such as 100
- a predetermined time period for example, 2 seconds
- the volume value of the sound obtained by the recording is obtained, and the volume value and the current timing value are determined. Step; if the volume value is greater than the predetermined value or the current timing value reaches the predetermined duration, the current timing value of the timing is set to the first predetermined time interval.
- the specific value of the first predetermined time interval in this embodiment is set to a value between the waiting time and the predetermined time length, for example, the minimum value of the first predetermined time interval is 300 milliseconds. And its maximum value is 2 seconds.
- the volume that the smart electronic device can provide for the user to manually adjust by means of a button or the like may be more or less.
- the current audio of the smart electronic device in this embodiment The playback volume may not be the volume that the user can manually adjust by pressing a button, etc., a specific example, the maximum playback volume of the intelligent electronic device is divided into 15 levels, such as calculating the maximum playback volume / 15, according to the volume corresponding to the above divided levels Value to set the current audio playback volume of the smart device.
- the current audio playback volume adjustment of the smart electronic device is set to a second predetermined value, and the second predetermined The value is greater than the first predetermined value.
- the second predetermined value may be preset in the smart electronic device according to experience, or may be dynamically set in the smart electronic device for the purpose of the smart electronic device.
- a specific example of dynamically setting the second predetermined value for the actual situation of the smart electronic device is: setting the first predetermined value to 0 (ie, the smart electronic device is in the mute state), and setting the current audio playback volume of the smart electronic device to 0.
- Obtaining the volume value of the sound obtained by the recording such as obtaining the volume value returned by the operating system
- calculating an average value (recorded as the first average value) for the obtained plurality of volume values (such as 10 volume values)
- Play local pre-stored audio signals such as playing the first music
- volume 1 such as the minimum volume other than mute
- periodically obtain the sound obtained through the recording Volume value such as obtaining the volume value returned by the operating system
- calculating an average value (recorded as a second average value) for the obtained plurality of volume values (such as 10 volume values), and then determining whether the second average value is Is a pre
- the volume value of the sound obtained by the recording is acquired.
- the present embodiment can perform an operation of acquiring a volume value of a sound obtained by recording after playing a locally stored predetermined audio signal (such as the first music built in the smart electronic device) and waiting for a second predetermined time interval.
- a locally stored predetermined audio signal such as the first music built in the smart electronic device
- a plurality of volume values obtained by recording can be obtained by using a timing acquisition method, and an average value (recorded as a second average value) is calculated for the obtained plurality of volume values, and the calculated volume average value is used. In the subsequent comparison process.
- the second predetermined time interval is preset in the smart electronic device, and the second predetermined time interval may be pre-set in the smart electronic device according to experience, or may be a purposeful situation for the smart electronic device. And dynamically set in the smart electronic device.
- a specific example of dynamically setting the second predetermined time interval for the actual situation of the intelligent electronic device is: in the process of performing the initial setting operation for the external device in this embodiment, after the first predetermined time interval is set, the smart electronic device continues to be triggered.
- the device plays a preset audio signal (such as the first music built into the smart electronic device) and starts timing, waiting for a while (such as waiting for 200) After milliseconds, obtain the volume value of the sound obtained by the recording (such as obtaining the volume value returned by the operating system), and determine whether the volume value is greater than a predetermined value (such as 100) and whether the current timing value reaches another predetermined duration (such as 1).
- the current timing value of the timing is set to the second predetermined time interval.
- the specific value of the second predetermined time interval in this embodiment is set to a value between the waiting duration and another predetermined duration, such as the minimum value of the second predetermined time interval. 200 milliseconds, and its maximum value is 1 second.
- S440 Determine, according to a comparison between the volume value acquired for the first predetermined value and the volume value acquired for the second predetermined value, whether the external device is an external device provided with the identification circuit in the first embodiment.
- the embodiment may determine whether an average value of the volume values calculated for the second predetermined value (ie, the second average value) reaches an average value of the volume values calculated for the first predetermined value (ie, the first average Another predetermined multiple of the value (for example, 7 times); if the second average value reaches 7 times of the first average value, it is determined that the external device is an external device provided with the identification circuit described in the first embodiment; If the two average values do not reach 7 times of the first average value, it is determined that the external device is not an external device provided with the identification circuit described in the first embodiment.
- the time taken for the entire process of the external device identification process of the present embodiment is usually less than 2 seconds.
- the input of the sound source recorded by the intelligent electronic device is a relatively low and relatively smooth sound, and in the case where the smart electronic device is set to be non-silent, when the music is played, the intelligent electronic device
- the volume of the input to the audio source will suddenly become larger; after repeated tests, the ratio of the average volume obtained in the two stages exceeds 7 times; the existing headphones receive the smart electronic device while the smart electronic device is muted.
- the volume of the input to the sound source is usually relatively stable. After repeated tests, the ratio of the volume average obtained in the two stages does not exceed 6 times; therefore, the ratio of the volume average value in different cases can be determined in this embodiment. It is accurately determined whether the external device of the intelligent electronic device is an external device provided with the above identification circuit, or is an external device such as an ordinary earphone.
- the information of the inserted external device that is the invalid earphone should be transmitted to the intelligent electronic device.
- Relevant parts in the system such as notifying the operating system or notifying the application related to the voice operation; thus, when the operating system or related application performs voice-related operations (such as answering a call, etc.), the current through the earphone socket and the smart can be known.
- the external device connected to the electronic device is not a headset, so it switches to the built-in microphone of the smart electronic device instead of using the headset. microphone.
- the switch E1 in the first embodiment Since the switch E1 in the first embodiment is in the off state, the audio signal output by the smart electronic device is played through the built-in microphone, and is not transmitted to the recording circuit through the earphone socket or the earphone plug, and passes through the recording circuit and the earphone plug. And the earphone socket is returned to the microphone. Therefore, the external device provided with the identification circuit described in the first embodiment does not affect the operation such as the normal call of the smart electronic device.
- Embodiment 3 An external device identification method based on a headphone jack.
- the apparatus of this embodiment will be described in detail below with reference to Figs. 6 and 7.
- the smart electronic device is used to check whether the smart electronic device is performing voice related. Processing (such as ongoing call or recording, etc.), if it is determined that the intelligent electronic device is performing voice-related processing, after waiting for the voice-related processing to end, acquiring the current audio playback volume of the intelligent electronic device, and storing the current Audio playback volume, then triggering the intelligent electronic device to perform a recording operation; setting the current audio playback volume of the smart electronic device to 0 (ie, the smart electronic device is in a mute state), and waiting for the first predetermined time interval time1, timing acquisition through the recording
- the volume value of the obtained sound for example, the volume value of the sound obtained by the recording every 70 milliseconds, and the volume average value AvgVolume1 is calculated for the obtained 10 volume values; in order to avoid the subsequent operation, there is a problem, and therefore, In the case where A
- AvgVolume2 is calculated for the obtained 10 volume values; in order to avoid problems with subsequent operations, if the calculated AvgVolume2 is 0, AvgVolume2 can be set to 1; determine AvgVolume1 Does the relationship with AvgVolume2 satisfy Av?
- gVolume2>AvgVolume1*7 if the condition is met, it is determined that the external device is an external device provided with the identification circuit described in the first embodiment, and the current audio playback volume of the intelligent electronic device is restored to the above After the current audio playback volume is stored, the identification process ends; if the condition is not satisfied, it is determined that the external device is not the external device provided with the identification circuit described in the first embodiment, and the current electronic device is After the audio playback volume is restored to the current audio playback volume stored above, the recognition process ends.
- the setting process of the first predetermined time interval time 1, the second predetermined time interval time2, and the second predetermined value Volume1 may be set by a process of initializing the setting of the external device provided with the above identification circuit.
- a specific example of the process of initializing the device in this embodiment is shown in FIG.
- the corresponding application in the smart electronic device is activated, and the initialization function in the application is clicked; the application can be adopted. Reading the smart electronic device log or the like to determine whether the smart electronic device is performing voice-related processing (such as playing music or making a call or recording, etc.), if it is determined that the smart electronic device is playing music, the application can prompt After the user closes the music being played, the initialization operation is performed.
- voice-related processing such as playing music or making a call or recording, etc.
- the application may prompt the user to wait for the call or perform the initialization operation after the recording is finished; if the intelligent electronic device is not performing voice related Processing, obtaining the current audio playback volume of the intelligent electronic device, and storing the current audio playback volume, and then setting the current audio playback volume of the smart electronic device to volume 1 (such as the minimum except for mute in the 15-level volume) Level volume) and play With the built-in music 2, after waiting for 500 milliseconds, the smart electronic device is triggered to perform the recording operation, and the timing is started; after waiting for 300 milliseconds, the volume value of the sound obtained by the recording is obtained, and it is judged whether the volume value is greater than 100, and the current time is Whether the timing value is less than 2 seconds, if the acquired volume value is not greater than 100 and the current timing value of the timing is less than 2 seconds, continue to obtain the volume value of the sound obtained by the recording and the above judgment operation; if the acquired volume value is greater than 100 or
- the volume value of the sound obtained by the recording and the above-mentioned judging operation if the acquired volume value is greater than 100 or the current timing value of the timing is not less than 1 second, the current timing value of the timing is taken as the second predetermined time interval time2, the second predetermined time The interval time2 should be between 200 milliseconds and 1 second; turn off the above music 1, and set the current audio playback volume of the smart electronic device to volume 0 (ie, mute), then wait for 300 milliseconds, then wait for the timing to pass.
- the volume value of the sound obtained by the recording for example, the volume value of the sound obtained by the recording every 70 milliseconds, and the volume average value AvgVolume1 is calculated for the obtained plurality of (for example, 10) volume values; after that, the intelligent electronic device is The current audio playback volume is set to volume 1 and the first music built into the smart electronic device is played; after waiting for the second predetermined time interval of 200 milliseconds, the volume value of the sound obtained by the recording is periodically acquired, for example, every 70 milliseconds.
- the volume value of the sound obtained by recording, and for multiple acquired calculates the volume average AvgVolume2; determines whether AvgVolume1 and AvgVolume2 satisfy the condition of AvgVolume2>AvgVolume1*9, and if this condition is satisfied, the above volume 1 is set to the first predetermined value, at the current state of the intelligent electronic device After the audio playback volume is restored to the current audio playback volume stored above, the initialization process ends; if the condition is not met, the current audio playback volume of the smart electronic device is set to volume 2, and the timing is returned to the above-mentioned timing.
- the initialization process ends.
- Embodiment 4 An external device identification device based on a headphone jack.
- the identification device is disposed in an intelligent electronic device, which may be an intelligent electronic device (such as a smart mobile phone or tablet using the Andriod operating system) using the Andriod operating system.
- the device shown in FIG. 8 mainly includes: a first setting module 700, a first obtaining module 710, a second setting module 720, a second obtaining module 730, and an identifying module 740.
- the device may further include: a first initializing module, The second initialization module and the third initialization module (not shown in FIG. 8).
- the first setting module 700 is connected to the first obtaining module 710.
- the first setting module 700 is mainly configured to trigger the recording of the smart electronic device after the earphone socket of the smart electronic device is detected to be inserted into the external device, and set the current audio playback volume of the smart electronic device to a first predetermined value.
- the first setting module 700 may insert the external device of the earphone socket of the smart electronic device (eg, by registering the listener) After the broadcast message of the operating system determines that the external device is inserted into the earphone socket of the smart electronic device according to the received message, detecting the current state of the smart electronic device (for example, by reading the current log of the intelligent electronic device) If the current state of the smart electronic device is detected as a voice-related state such as a call state or a recording state, the first setting module 700 should temporarily not set the current audio playback volume and trigger the recording. Operation, but waiting for the intelligent electronic device to end the voice-related operation (such as ending the call or ending the recording), the first setting module 700 resumes its operation of setting the current audio playback volume and triggering the recording.
- a voice-related state such as a call state or a recording state
- the first setting module 700 should acquire the smart electronic device before performing the current audio playback volume operation of setting the smart electronic device.
- the current audio playback volume, and the current audio playback volume is stored, so that after the identification module 740 performs the identification operation, the smart electronic device can also be The current audio playback volume of the device is restored to the audio playback volume before the external device recognition operation. That is, after the first setting module 700 stores the current audio playback volume of the smart electronic device, the smart electronic device is triggered to perform a recording operation, and the current audio playback volume of the smart electronic device is set to a first predetermined value.
- the first predetermined value may be a minimum value of the smart electronic device (ie, a mute value), such as the first predetermined value is 0, that is, the first setting module 700 may set the smart electronic device to a mute state.
- the operation of the first setting module 700 to trigger the intelligent electronic device to perform the recording operation and the current audio playback volume of the smart electronic device to be set to the first predetermined value may be limited without prioritization, for example, the first setting module 700 may perform simultaneously If the first setting module 700 can perform the recording operation, the first predetermined value setting operation is performed; and the first setting module 700 can also perform the setting operation of the first predetermined value, and then perform the recording operation. .
- the operation of the first setting module 700 to trigger the intelligent electronic device to perform the recording operation is implemented by calling the recording function in the operating system of the smart electronic device. This embodiment does not limit the specific implementation manner in which the first setting module 700 triggers the intelligent electronic device to perform the recording operation.
- the first acquisition module 710 is connected to the identification module 740 in addition to the first setting module 700.
- the first obtaining module 710 is mainly adapted to acquire a volume value of the sound obtained by the recording in the case of the first predetermined value.
- the first obtaining module 710 needs to acquire the sound obtained by the recording if the current audio playing volume of the smart electronic device is set to the first predetermined value. The volume value.
- the first obtaining module 710 may acquire the volume value of the sound obtained by the recording after the smart electronic device is triggered to perform the recording operation and wait for a certain time.
- the first setting module 700 may use the smart device in the first setting module 700.
- the current audio playback volume is set to a first predetermined value, and after waiting for the first predetermined time interval, an operation of acquiring the volume value of the sound obtained by the recording is performed.
- the first obtaining module 710 may obtain a plurality of volume values of the sound obtained by the recording by using a timing acquisition manner, and calculate an average value of the plurality of volume values, and the calculated volume average value is mainly used by the subsequent identification module 740.
- the calculated comparison process, the calculated volume average may be referred to as a first volume average.
- the identification module 740 may determine whether the first volume average is greater than a predetermined volume value (eg, 1000), if the first volume average is greater than a predetermined volume value (eg, greater than 1000) The identification module 740 can determine that the external device is not an external device provided with the identification circuit in the first embodiment, and the identification process of the external device ends; If the volume average is not greater than a predetermined value (e.g., less than or equal to 1000), the apparatus of the present embodiment should continue to perform the subsequent steps.
- a predetermined volume value eg. 1000
- the predetermined volume value (for example, 1000) may be preset in the smart electronic device according to experience; in addition, the first predetermined time interval may be preset in the smart electronic device according to experience, or may be purposeful The actual situation of the intelligent electronic device is dynamically set in the smart electronic device.
- a specific example of dynamically setting the first predetermined time interval for the actual situation of the smart electronic device is: setting the current audio playback volume of the smart electronic device may be a volume that the user can manually adjust by means of a button, etc., for example, in an intelligent electronic device.
- the volume that can be manually adjusted by the user through buttons or the like is divided into 15 levels (the intelligent mobile phone of the Andriod operating system has 15 levels of volume that can be manually adjusted by the user).
- the 15 levels can be referred to as volume 0 to volume 14, respectively.
- the volume 0 indicates silence; according to the order of volume 1 to volume 14, the sound corresponding to each of volume 1 to volume 14 gradually increases, and the volume corresponding to volume 14 is the loudest.
- the specific setting process of the first predetermined time interval includes: first, in the case that the smart electronic device is first connected to the external device having the above identification circuit of the present embodiment through the earphone plug and the earphone socket The device may perform an initial setting operation for the external device. Specifically, after the current audio playback volume of the intelligent electronic device is backed up, the first initialization module sets the current audio playback volume of the smart electronic device to a minimum level other than mute.
- the first initialization module triggers the electronic device to perform an operation of playing a locally stored audio signal (such as a second music built into the smart electronic device) and starts timing; waiting for a period of time (such as 500) After the millisecond, the first initialization module triggers the intelligent electronic device to record, and after waiting for a period of time (for example, 300 milliseconds), the first initialization module acquires the volume value of the sound obtained by the recording (for example, obtaining the volume value returned by the operating system) ), and determine whether the volume value is greater than a predetermined value (such as 100) to And whether the current timing value reaches a predetermined duration (for example, 2 seconds).
- a predetermined value such as 100
- the first initialization module If the acquired volume value is not greater than the predetermined value and the current timing value does not reach the predetermined duration, the first initialization module returns the volume value of the sound obtained by the recording and the The step of determining the volume value and the current timing value; if the volume value is greater than the predetermined value or the current timing value reaches the predetermined duration, the first initialization module sets the current timing value of the timing to the first predetermined time interval.
- the specific value of the first predetermined time interval in this embodiment is set by the first initialization module to a value between the waiting duration and the predetermined duration, such as the minimum of the first predetermined time interval.
- the value is 300 milliseconds and its maximum value is 2 seconds.
- the volume that the smart electronic device can provide for the user to manually adjust by means of a button or the like may be more or less.
- the current audio of the smart electronic device in this embodiment The playback volume may not be the volume that the user can manually adjust by pressing a button, etc., a specific example, the first initialization module will maximize the playback sound of the intelligent electronic device. The quantity is divided into 15 levels. If the maximum playback volume / 15 is calculated, the first initialization module sets the current audio playback volume of the intelligent electronic device according to the volume values of the divided levels.
- the second setting module 720 is connected to the second obtaining module 730.
- the second setting module 720 is mainly adapted to set the current audio playback volume of the intelligent electronic device to a second predetermined value.
- the second setting module 720 sets the current audio playback volume adjustment of the smart electronic device to a second predetermined value, and The second predetermined value is greater than the first predetermined value.
- the second predetermined value may be preset in the smart electronic device according to experience, or may be dynamically set in the smart electronic device for the purpose of the smart electronic device.
- a specific example of dynamically setting a second predetermined value for the actual situation of the intelligent electronic device is: setting a first predetermined value to 0 (ie, the smart electronic device is in a mute state), and the third initialization module plays the current audio of the smart electronic device.
- the volume is set to a first predetermined value, and the third initialization module periodically acquires the volume value of the sound obtained by the recording (such as obtaining the volume value returned by the operating system), and calculates for the obtained multiple volume values (such as 10 volume values).
- the average value (recorded as the first average value); the third initialization module triggers the intelligent electronic device to play the local pre-stored audio signal (such as playing the first music), and sets the current audio playback volume of the smart electronic device to the volume 1 (eg, The minimum level of sound other than mute); then, the third initialization module periodically acquires the volume value of the sound obtained by the recording (such as obtaining the volume value returned by the operating system), and for the obtained multiple volume values (such as 10) The volume value is calculated as an average value (recorded as a second average value), after which the third initialization module determines whether the second average value is a predetermined multiple of the first average value.
- the third initialization module sets the current audio playback volume of the smart electronic device to volume 2, And returning to the step of regularly obtaining the volume value of the sound obtained by the recording and calculating an average value (recorded as the second average value) for the obtained plurality of volume values and judging the multiple; if the second average value reaches the first average value
- the third initialization module determines the current audio playback volume of the smart electronic device as a second predetermined value.
- the second acquisition module 730 is connected to the identification module 740 in addition to the second setting module 720.
- the second acquisition module 730 is mainly adapted to play a predetermined audio signal, and in the case of the second predetermined value, acquire a volume value of the sound obtained by the recording.
- the second obtaining module 730 needs to acquire the volume value of the sound obtained by the recording if the current audio playback volume of the smart electronic device is adjusted to the second predetermined value by the second setting module 720.
- the second obtaining module 730 can play a locally stored predetermined audio signal (such as the first music built in the smart electronic device) on the smart electronic device, and after waiting for the second predetermined time interval, perform the volume value of acquiring the sound obtained by the recording. operating.
- a locally stored predetermined audio signal such as the first music built in the smart electronic device
- the second obtaining module 730 can obtain a plurality of volume values (such as 10 volume values) of the sound obtained by the recording in a manner of timing acquisition, and calculate an average value (recorded as a second average value) for the obtained plurality of volume values.
- the average value of the volume calculated by the second acquisition module 730 is used for the comparison process of the subsequent identification module 740.
- the second predetermined time interval is preset in the smart electronic device, and the second predetermined time interval may be pre-set in the smart electronic device according to experience, or may be a purposeful situation for the smart electronic device. And dynamically set in the smart electronic device.
- a specific example of dynamically setting the second predetermined time interval for the actual situation of the intelligent electronic device is: in the process of performing the initial setting operation for the external device by the device of the embodiment, the first predetermined time interval is set in the first initialization module. Afterwards, the second initialization module triggers the intelligent electronic device to play a preset audio signal (such as the first music built in the smart electronic device), and starts timing.
- a preset audio signal such as the first music built in the smart electronic device
- the second initialization module After waiting for a period of time (such as waiting 200 milliseconds), the second initialization module acquires The volume value of the sound obtained by recording (such as obtaining the volume value returned by the operating system), and determining whether the volume value is greater than a predetermined value (such as 100) and whether the current timing value reaches another predetermined duration (such as 1 second), if The second initialization module returns the volume value of the sound obtained by the recording and the step of determining the volume value and the current timing value. If the volume value is greater than the predetermined value or the current timing value reaches another predetermined Length, the second initialization module current timing value of the timer is set to a second predetermined time interval.
- a predetermined value such as 100
- the current timing value reaches another predetermined duration such as 1 second
- the specific value of the second predetermined time interval in this embodiment is set by the second initialization module to a value between the waiting duration and another predetermined duration, such as the second predetermined time interval.
- the minimum value is 200 milliseconds and its maximum value is 1 second.
- the identification module 740 is mainly adapted to determine whether the external device is an external device provided with the identification circuit described in the first embodiment, based on a comparison between the volume value acquired for the first predetermined value and the volume value acquired for the second predetermined value.
- the identification module 740 can determine whether the average value of the volume value calculated by the second obtaining module 730 for the second predetermined value (ie, the second average value) reaches the volume calculated by the first acquiring module 710 for the first predetermined value. Another predetermined multiple of the value (ie, the first average value described above) (eg, 7 times); if the second average value reaches 7 times the first average value, the identification module 740 determines that the external device is configured with the above The external device of the identification circuit of the first embodiment; if the second average value does not reach 7 times of the first average value, the identification module 740 determines that the external device is not the external device provided with the identification circuit described in the first embodiment. .
- the entire process of the identification process of the external device of the device usually takes less than 2 seconds.
- the input of the audio source recorded by the intelligent electronic device is relatively low and compared.
- Smooth sound while the smart electronic device is set to be non-silent, when the music is played, the volume of the audio input recorded by the intelligent electronic device suddenly becomes large; after several trials and verifications, the two stages are obtained.
- the ratio of the average value of the volume exceeds 7 times; the existing earphones in the case where the smart electronic device is muted, the volume of the input of the sound source received by the intelligent electronic device is generally relatively stable, and after several trials and verifications, the volume obtained in two stages is obtained.
- the ratio of the average value does not exceed 6 times; therefore, the device can accurately determine whether the external device of the intelligent electronic device is an external device provided with the above identification circuit by judging the ratio of the average value of the volume under different conditions, or other devices such as ordinary External devices such as headphones.
- the identification module 740 recognizes that the external device is an external device provided with the identification circuit described in the first embodiment, the information that the inserted external device is an invalid earphone should be transmitted to the intelligent electronic device.
- the relevant part in the process such as the identification module 740 notifying the operating system or notifying the application related to the voice operation, etc.; thus, when the operating system or related application performs the voice-related operation (such as answering a call, etc.), the current through the earphone can be known.
- the external device that connects the socket to the smart electronic device is not a headset, so it switches to the built-in microphone of the smart electronic device instead of the headset microphone.
- the switch E1 in the first embodiment Since the switch E1 in the first embodiment is in the off state, the audio signal output by the smart electronic device is played through the built-in microphone, and is not transmitted to the recording circuit through the earphone socket or the earphone plug, and passes through the recording circuit and the earphone plug. And the earphone socket is returned to the microphone. Therefore, the external device provided with the identification circuit described in the first embodiment does not affect the operation such as the normal call of the smart electronic device.
- the external device identification system based on the earphone socket mainly includes: an external device 800 and an intelligent electronic device 810; wherein the external device 800 is provided with the external device identification circuit based on the earphone socket described in the first embodiment, and the intelligent electronic device The device 810 is provided with the external device identification device based on the earphone socket described in the third embodiment, and the external device 800 is connected to the intelligent electronic device through the earphone plug.
- the specific structure of the identification circuit in the external device 800 is as described in the first embodiment.
- the structure of the identification device in the smart electronic device 810 is as described in the second embodiment.
- the description in the third embodiment will not be repeated here.
- modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
- Can be practical Modules or units or components in the embodiments are combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
- any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
- Each feature disclosed in this specification may be replaced by alternative features that provide the same, equivalent or similar purpose.
- the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement the earphone socket-based external device identification device and the earphone socket-based external device identification system according to an embodiment of the present invention. Some or all of the features of some or all of the components.
- the invention can also be implemented as a device or device program (such as a computer program and a computer program product) for performing some or all of the methods described herein. Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
- FIG. 10 shows an electronic device in which the earphone socket-based external device identification method of the present invention can be implemented.
- the electronic device conventionally includes a processor 1210 and a computer program product or computer readable medium in the form of a memory 1220.
- the memory 1220 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
- Memory 1220 has a memory space 1230 for program code 1231 for performing any of the method steps described above.
- storage space 1230 for program code may include various program codes 1231 for implementing various steps in the above methods, respectively.
- the program code can be read from or written to one or more computer program products.
- Such computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
- Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG.
- the storage unit may have a storage section or a storage space or the like arranged similarly to the storage 1220 in the electronic device of FIG.
- the program code can be compressed, for example, in an appropriate form.
- the storage unit comprises a program 1231' for performing the steps of the method according to the invention, ie a code readable by a processor such as 1210, which when executed by the electronic device causes the electronic device to perform the above The party described The various steps in the law.
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Acoustics & Sound (AREA)
- Signal Processing (AREA)
- Circuit For Audible Band Transducer (AREA)
Abstract
Disclosed are a recognition circuit, method, apparatus and system for an external device based on an earphone socket. The recognition circuit comprises an earphone plug and a sound recording loop. The earphone plug is provided with a sound channel connection end, a microphone connection end and a grounding end; and the sound recording loop is provided with a first connection end, a second connection end and a third connection end, wherein the first connection end is connected to the sound channel connection end, the second connection end is connected to the microphone connection end, and the third connection end is connected to the grounding end. The sound recording loop is connected to a microphone in an intelligent electronic device through the earphone plug and an earphone socket in the intelligent electronic device, and a megaphone circuit is formed by the sound recording loop, the earphone plug, the earphone socket and the microphone together.
Description
本发明涉及设备识别技术,具体涉及一种基于耳机插座的外接设备识别电路、方法、装置和系统。The present invention relates to a device identification technology, and in particular to an external device identification circuit, method, device and system based on a headphone jack.
智能电子设备(如基于Android操作系统的智能电子设备)可以通过其耳机插座与外接设备连接,如智能电子设备可以通过其耳机插座与耳机、拉卡拉设备、移动电话红外遥控器或者移动电话按键设备等外接设备连接。Intelligent electronic devices (such as intelligent electronic devices based on the Android operating system) can be connected to external devices through their earphone sockets, such as smart electronic devices through their earphone sockets and earphones, Lara equipment, mobile phone infrared remote control or mobile phone button devices Wait for external devices to connect.
在智能电子设备通过其耳机插座与外接设备连接的情况下,智能电子设备应对插入的外接设备进行有效识别,否则,智能电子设备会认为其耳机插座中插入的外接设备为耳机,这样,智能电子设备会通过耳机输出声音,从而可能会导致用户无法正常拨打接听电话(在智能电子设备为智能移动电话的情况下)、收听音乐及观看视频等。In the case that the intelligent electronic device is connected to the external device through its earphone socket, the intelligent electronic device should effectively identify the inserted external device. Otherwise, the smart electronic device considers that the external device inserted in the earphone socket is the earphone, thus, the smart electronic device The device outputs sound through the headphones, which may result in the user not being able to make and receive calls (in the case of smart electronic devices as smart mobile phones), listening to music, and watching videos.
目前,智能电子设备对其耳机插座中插入的外接设备进行识别的方式主要包括两种:方式一、基于10KHZ频段的超声波调制解调技术对外接设备进行识别;方式二、基于MCU(微控制单元)对外接设备进行识别,即在外接设备的耳机插头插入耳机插座时,外接设备中的MCU主动向智能电子设备输出特殊音频信号,以便于智能电子设备能够根据其接收到的特殊音频信号识别出插入耳机插座的外接设备。At present, there are two main ways for an intelligent electronic device to identify an external device inserted in its earphone socket: mode one: an external device based on the ultrasonic modulation and demodulation technology of the 10KHZ frequency band; mode 2, based on the MCU (micro control unit) The external device is identified, that is, when the earphone plug of the external device is inserted into the earphone socket, the MCU in the external device actively outputs a special audio signal to the intelligent electronic device, so that the intelligent electronic device can recognize the special audio signal received by the smart electronic device. Plug in an external device to the headphone jack.
发明人在实现本发明过程中发现,针对上述方式一而言,在智能电子设备的耳机插座插入耳机的情况下,如果采用10KHZ频段的超声波对外接设备进行识别,会产生刺耳的高频声音,对人耳的刺激非常大,从而会影响用户的感受;另外,如果智能电子设备在播放音乐过程中进行外接设备识别,则其播放的音乐会影响外接设备识别的准确率;针对上述方式二而言,由于MCU体积较大且成本较高,因此,在外接设备中设置MCU可能会对外接设备的体积以及成本产生较大的影响。In the process of implementing the present invention, the inventor has found that, in the case of the above manner, in the case where the earphone socket of the intelligent electronic device is inserted into the earphone, if the ultrasonic external device of the 10KHZ frequency band is used for identification, a harsh high-frequency sound is generated. The stimulation to the human ear is very large, which will affect the user's feelings. In addition, if the intelligent electronic device performs external device identification during the music playing, the concert played by it affects the accuracy of the external device identification; In other words, because the MCU is large in size and high in cost, setting the MCU in the external device may have a large impact on the volume and cost of the external device.
发明内容Summary of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的基于耳机插座的外接设备识别电路、相应的基于耳机插座的外接设备识别方法、基于耳机插座的外接设备识别装置以及基于耳机插座的外接设备识别系统、计算机程序以及计算机可读介质。
In view of the above problems, the present invention has been made in order to provide an external device identification circuit based on a headphone jack that overcomes the above problems or at least partially solves the above problems, a corresponding external device identification method based on a headphone jack, and an external device identification based on a headphone jack The device and the external device identification system based on the earphone socket, the computer program, and the computer readable medium.
依据本发明的第一个方面,提供了一种基于耳机插座的外接设备识别电路,包括:耳机插头以及录音回路;所述耳机插头具有声道连接端、麦克风连接端以及接地端;所述录音回路具有第一连接端、第二连接端和第三连接端;其中,所述第一连接端与所述声道连接端连接,所述第二连接端与所述麦克风连接端连接,所述第三连接端与所述接地端连接;所述录音回路通过所述耳机插头以及智能电子设备中的耳机插座与智能电子设备中的麦克风连接,且所述录音回路与耳机插头、耳机插座以及麦克风一起形成话筒电路。According to a first aspect of the present invention, an external device identification circuit based on a headphone jack includes: an earphone plug and a recording circuit; the earphone plug has a channel connection end, a microphone connection end, and a ground end; The circuit has a first connection end, a second connection end, and a third connection end; wherein the first connection end is connected to the channel connection end, and the second connection end is connected to the microphone connection end, The third connection end is connected to the ground end; the recording circuit is connected to the microphone in the smart electronic device through the earphone plug and the earphone socket in the smart electronic device, and the recording circuit and the earphone plug, the earphone socket and the microphone Together form a microphone circuit.
依据本发明的第二个方面,提供了一种基于耳机插座的外接设备识别方法,包括:在监测到智能电子设备的耳机插座插入外接设备后,触发智能电子设备录音,并将智能电子设备的当前音频播放音量设置为第一预定值;在所述第一预定值情况下,获取通过录音获得的声音的音量值;将所述智能电子设备的当前音频播放音量设置为第二预定值;播放预定音频信号,并在所述第二预定值情况下,获取通过录音获得的声音的音量值;根据针对第一预定值获取的音量值与针对第二预定值获取的音量值之间的比较确定所述外接设备是否为设置有录音回路和耳机插头的外接设备,且所述录音回路与所述耳机插头以及所述智能电子设备的耳机插座和麦克风一起形成话筒电路。According to a second aspect of the present invention, a method for identifying an external device based on a headphone jack includes: triggering an intelligent electronic device to record after the earphone socket of the smart electronic device is inserted into the external device, and the smart electronic device is The current audio playback volume is set to a first predetermined value; in the case of the first predetermined value, the volume value of the sound obtained by the recording is acquired; the current audio playback volume of the intelligent electronic device is set to a second predetermined value; Predetermining an audio signal, and in the case of the second predetermined value, acquiring a volume value of the sound obtained by the recording; determining from a comparison between the volume value acquired for the first predetermined value and the volume value acquired for the second predetermined value Whether the external device is an external device provided with a recording circuit and a headphone plug, and the recording circuit forms a microphone circuit together with the earphone plug and the earphone socket and the microphone of the smart electronic device.
根据本发明的第三个方面,提供了一种基于耳机插座的外接设备识别装置,包括:第一设置模块,适于在监测到智能电子设备的耳机插座插入外接设备后,触发智能电子设备录音,并将所述智能电子设备的当前音频播放音量设置为第一预定值;第一获取模块,适于在所述第一预定值情况下,获取通过录音获得的声音的音量值;第二设置模块,适于将所述智能电子设备的当前音频播放音量设置为第二预定值;第二获取模块,适于播放预定音频信号,并在所述第二预定值情况下,获取通过录音获得的声音的音量值;识别模块,适于根据针对第一预定值获取的音量值与针对第二预定值获取的音量值之间的比较确定所述外接设备是否为设置有录音回路和耳机插头的外接设备,且所述录音回路与所述耳机插头以及所述智能电子设备的耳机插座和麦克风一起形成话筒电路。According to a third aspect of the present invention, there is provided an external device identification device based on a headphone jack, comprising: a first setting module, configured to trigger an intelligent electronic device to record after detecting that the earphone socket of the smart electronic device is inserted into the external device And setting a current audio playback volume of the smart electronic device to a first predetermined value; the first obtaining module is adapted to obtain a volume value of the sound obtained by the recording in the first predetermined value; the second setting a module adapted to set a current audio playback volume of the intelligent electronic device to a second predetermined value; a second acquisition module adapted to play a predetermined audio signal, and obtain, by the second predetermined value, the obtained by the recording a volume value of the sound; the identification module, configured to determine whether the external device is an external device provided with a recording loop and a headphone plug according to a comparison between a volume value acquired for the first predetermined value and a volume value obtained for the second predetermined value a device, and the recording circuit is shaped with the earphone plug and a headphone jack and a microphone of the smart electronic device Microphone circuit.
根据本发明的第四个方面,提供了一种基于耳机插座的外接设备识别系统,该系统包括:外接设备以及智能电子设备;所述外接设备中设置有上述的识别电路;所述智能电子设备中设置有上述的基于耳机插座的外接设备识别装置。According to a fourth aspect of the present invention, an external device identification system based on a headphone jack is provided, the system comprising: an external device and an intelligent electronic device; wherein the external device is provided with the above identification circuit; the intelligent electronic device The above-mentioned external device identification device based on the earphone socket is provided.
根据本发明的第五个方面,提供了一种计算机程序,其包括计算机可读代码,当电子设备运行所述计算机可读代码时,导致所述的DEBUG调试方法被执行。
According to a fifth aspect of the invention, a computer program comprising computer readable code, when the electronic device runs the computer readable code, causes the DEBUG debugging method to be executed.
根据本发明的第六个方面,提供了一种计算机可读介质,其中存储了如上所述的计算机程序。According to a sixth aspect of the invention, a computer readable medium is provided, wherein a computer program as described above is stored.
本发明的基于耳机插座的外接设备识别电路、方法、装置和系统通过在外接设备中设置基于耳机插座的外接设备识别电路,且该识别电路中的录音回路通过耳机插头以及智能电子设备中的耳机插座与智能电子设备中的麦克风连接,并形成话筒电路,这样,在智能电子设备的耳机插座插入具有该识别电路的外接设备时,智能电子设备可以通过该话筒电路实现录音;由于在不同的当前音频播放音量情况下录制不同的音源所获得的声音的音量值具有一定的特点,因此,通过进行录制的声音的音量值的比较可以准确的识别出插入智能电子设备的耳机插座中的外接设备是否为设置有上述识别电路的外接设备;由于本发明中的音源可以采用普通音乐,因此,本发明可以避免在外接设备识别过程中超声波对人耳的刺激;由于本发明的识别电路采用了录音回路,而录音回路通常使用简单便宜的元器件(如电容以及电阻等)即可实现,因此,本发明可以避免利用MCU进行外接设备识别而对外接设备造成的体积较大且成本较高的影响。The earphone socket-based external device identification circuit, method, device and system of the present invention provide an external device identification circuit based on the earphone socket in the external device, and the recording circuit in the identification circuit passes through the earphone plug and the earphone in the smart electronic device The socket is connected with the microphone in the intelligent electronic device, and forms a microphone circuit, so that when the earphone socket of the intelligent electronic device is inserted into the external device having the identification circuit, the intelligent electronic device can realize recording through the microphone circuit; The volume value of the sound obtained by recording different sound sources in the audio playback volume has certain characteristics. Therefore, by comparing the volume values of the recorded sounds, it is possible to accurately recognize whether the external device inserted in the earphone socket of the intelligent electronic device is For the external device provided with the above identification circuit; since the sound source in the present invention can use ordinary music, the present invention can avoid the stimulation of the human ear by the ultrasonic wave during the identification process of the external device; since the identification circuit of the present invention uses the recording circuit ,and Large and costly sound effects can be realized using a simple circuit is usually cheaper components (such as capacitors and resistors, etc.), therefore, the present invention is to avoid the use of the MCU causing the external device to identify the volume of external devices.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solutions of the present invention, and the above-described and other objects, features and advantages of the present invention can be more clearly understood. Specific embodiments of the invention are set forth below.
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。本实施例的附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those skilled in the art from a The drawings of the present embodiments are only for the purpose of illustrating the preferred embodiments and are not intended to limit the invention. Throughout the drawings, the same reference numerals are used to refer to the same parts. In the drawing:
图1示出了耳机插头示意图;Figure 1 shows a schematic view of a headphone plug;
图2示出了根据本发明实施例一的基于耳机插座的外接设备识别电路的一个具体电路结构示意图;2 is a schematic diagram showing a specific circuit structure of an external device identification circuit based on a headphone jack according to a first embodiment of the present invention;
图3示出了根据本发明实施例一的基于耳机插座的外接设备识别电路的另一个具体电路结构示意图;3 is a schematic diagram showing another specific circuit structure of an external device identification circuit based on a headphone jack according to a first embodiment of the present invention;
图4示出了根据本发明实施例一的基于耳机插座的外接设备识别电路的再一个具体电路结构示意图;4 is a schematic diagram showing still another specific circuit structure of an external device identification circuit based on a headphone jack according to the first embodiment of the present invention;
图5示出了根据本发明实施例二的基于耳机插座的外接设备识别方法流程图;FIG. 5 is a flowchart of a method for identifying an external device based on a headphone jack according to a second embodiment of the present invention; FIG.
图6示出了根据本发明实施例三的基于耳机插座的外接设备识别方法流程
图;FIG. 6 is a flowchart of a method for identifying an external device based on a headphone jack according to a third embodiment of the present invention.
Figure
图7示出了根据本发明实施例三的基于耳机插座的外接设备识别方法中的初始化流程示意图;FIG. 7 is a schematic diagram showing an initialization process in an external device identification method based on a headphone jack according to Embodiment 3 of the present invention; FIG.
图8示出了根据本发明实施四的基于耳机插座的外接设备识别装置示意图;8 is a schematic diagram of an external device identification device based on a headphone jack according to Embodiment 4 of the present invention;
图9示出了根据本发明实施五的基于耳机插座的外接设备识别装置示意图;9 is a schematic diagram of an external device identification device based on a headphone jack according to Embodiment 5 of the present invention;
图10示出了用于执行本发明的方法的电子设备的框图;以及Figure 10 shows a block diagram of an electronic device for performing the method of the present invention;
图11示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元示意图。Figure 11 shows a schematic diagram of a memory unit for holding or carrying program code implementing a method in accordance with the present invention.
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the embodiments of the present invention have been shown in the drawings, the embodiments Rather, these embodiments are provided so that this disclosure will be more fully understood and the scope of the disclosure will be fully disclosed.
实施例一。 Embodiment 1.
实施例一、基于耳机插座的外接设备识别电路。下面结合图1、图2和图3对本实施例的识别电路进行说明。 Embodiment 1 The external device identification circuit based on the earphone socket. The identification circuit of this embodiment will be described below with reference to Figs. 1, 2 and 3.
本实施例的基于耳机插座的外接设备识别电路主要包括:耳机插头以及录音回路,其中,录音回路具有多个连接端,该多个连接端分别与耳机插头中的多个连接端连接。The external device identification circuit based on the earphone socket of the embodiment mainly includes: an earphone plug and a recording circuit, wherein the recording circuit has a plurality of connecting ends, and the plurality of connecting ends are respectively connected with the plurality of connecting ends in the earphone plug.
具体的,目前的耳机插头通常具有声道连接端、麦克风连接端以及接地端;在耳机插头为双声道耳机插头时,上述声道连接端通常包括:左声道连接端和右声道连接端;在耳机插头为单声道耳机插头时,上述声道连接端通常为单声道连接端。Specifically, the current earphone plug usually has a channel connection end, a microphone connection end, and a ground end; when the earphone plug is a two-channel earphone plug, the above-mentioned channel connection end usually includes: a left channel connection end and a right channel connection When the earphone plug is a mono earphone plug, the above channel connection is usually a mono connection.
耳机插头的一个具体的例子如图1所示。A specific example of a headphone plug is shown in Figure 1.
在图1中的耳机插头符合国际标准(CTIA)的情况下,该耳机插头主要包括:麦克风连接端1、地线连接端2、右声道连接端3以及左声道连接端4。In the case that the earphone plug of FIG. 1 conforms to the International Standard (CTIA), the earphone plug mainly includes: a microphone connection end 1, a ground connection terminal 2, a right channel connection end 3, and a left channel connection end 4.
在图1中的耳机插头符合国家标准(OMTP)的情况下,该耳机插头主要包括:地线连接端1、麦克风连接端2、右声道连接端3以及左声道连接端4。In the case that the earphone plug of FIG. 1 conforms to the National Standard (OMTP), the earphone plug mainly includes: a ground connection end 1, a microphone connection end 2, a right channel connection end 3, and a left channel connection end 4.
本实施例的录音回路主要用于与耳机插头、耳机插座以及智能电子设备中的麦克风一起形成话筒回路,如形成电容话筒回路。The recording circuit of this embodiment is mainly used to form a microphone loop together with a microphone plug, a headphone jack, and a microphone in an intelligent electronic device, such as forming a condenser microphone loop.
为了形成话筒回路,该录音回路具有第一连接端、第二连接端和第三连接
端,且第一连接端与耳机插头的声道连接端连接,第二连接端与智能电子设备的麦克风连接端连接,第三连接端与耳机插头的接地端连接。In order to form a microphone circuit, the recording circuit has a first connection end, a second connection end, and a third connection
And the first connection end is connected to the channel connection end of the earphone plug, the second connection end is connected to the microphone connection end of the smart electronic device, and the third connection end is connected to the ground end of the earphone plug.
在耳机插头为单声道耳机插头的情况下,录音回路中的第一连接端与耳机插头的单声道连接端连接。In the case where the earphone plug is a mono earphone plug, the first connection end in the recording circuit is connected to the mono connection end of the earphone plug.
在耳机插头为双声道耳机插头的情况下,录音回路中的第一连接端与左声道连接端以及右声道连接端中的至少一个连接端连接;通常情况下,录音回路中的第一连接端与左声道连接端和右声道连接端分别连接。In the case where the earphone plug is a two-channel earphone plug, the first connection end in the recording loop is connected to at least one of the left channel connection end and the right channel connection end; in general, the first in the recording loop A connection end is connected to the left channel connection end and the right channel connection end, respectively.
为了形成电容话筒回路,录音回路通常包含有电容和电阻等元器件;本实施例中的录音回路的一个具体例子如图2所示。In order to form a condenser microphone circuit, the recording circuit usually includes components such as a capacitor and a resistor; a specific example of the recording circuit in this embodiment is shown in FIG.
图2中的“1”、“2”、“3”以及“4”即为上述图1中的耳机插头的各个连接端的附图标记。图2中的录音回路包括:电容C1、电阻R1以及电阻R2。电容C1的一端为上述第一连接端,与耳机插头的右声道连接端和左声道连接端分别连接,电容C1的另一端与电阻R1以及电阻R2分别连接,且电容C1与电阻R1以及电阻R2分别串联。电阻R1的一端为上述第二连接端,与耳机插头的地线连接端或者麦克风连接端连接,电阻R1的另一端与电容C1连接。电阻R2的一端为上述第三连接端,与耳机插头的麦克风连接端或者地线连接端连接,电阻R2的另一端与电容C1连接。上述电阻R1和电阻R2并联。"1", "2", "3", and "4" in Fig. 2 are the reference numerals of the respective connection ends of the earphone plug in Fig. 1 described above. The recording circuit in FIG. 2 includes a capacitor C1, a resistor R1, and a resistor R2. One end of the capacitor C1 is the first connection end, and is connected to the right channel connection end and the left channel connection end of the earphone plug respectively, and the other end of the capacitor C1 is respectively connected with the resistor R1 and the resistor R2, and the capacitor C1 and the resistor R1 and The resistors R2 are connected in series, respectively. One end of the resistor R1 is the second connection end, and is connected to the ground connection end or the microphone connection end of the earphone plug, and the other end of the resistor R1 is connected to the capacitor C1. One end of the resistor R2 is the third connection end, and is connected to the microphone connection end or the ground connection end of the earphone plug, and the other end of the resistor R2 is connected to the capacitor C1. The resistor R1 and the resistor R2 are connected in parallel.
通过图2所示的录音回路,智能电子设备输出的音频信号可以通过耳机插座、耳机插头以及录音回路后,被耳机插头以及耳机插座回传给智能电子设备中的麦克风,从而形成话筒回路(电容话筒回路)。Through the recording circuit shown in FIG. 2, the audio signal output by the intelligent electronic device can be transmitted back to the microphone in the intelligent electronic device through the earphone socket, the earphone plug and the recording circuit, and then the microphone circuit (capacitor) is formed. Microphone loop).
另外,由于图2中的电容1与电阻R1以及电阻R2分别串联,且电阻R1以及电阻R2并联,因此,无论是电阻R1的一端与耳机插头的地线连接端连接且电阻R2的一端与耳机插头的麦克风连接端连接,还是电阻R1的一端与耳机插头的麦克风连接端连接且电阻R2的一端与耳机插头的地线连接端连接,该录音回路都可以与耳机插头以及智能电子设备中的耳机插座以及麦克风一起形成话筒电路;从而图2示出的录音回路对国际标准(CTIA)以及国家标准(OMTP)的耳机插头均可适用。In addition, since the capacitor 1 in FIG. 2 is connected in series with the resistor R1 and the resistor R2, and the resistor R1 and the resistor R2 are connected in parallel, both ends of the resistor R1 are connected to the ground connection end of the earphone plug and one end of the resistor R2 is connected to the earphone. The microphone connection end of the plug is connected, or one end of the resistor R1 is connected with the microphone connection end of the earphone plug, and one end of the resistor R2 is connected with the ground connection end of the earphone plug, and the recording circuit can be connected with the earphone plug and the earphone in the intelligent electronic device. The socket and the microphone together form a microphone circuit; thus the recording circuit shown in Figure 2 is applicable to both International Standard (CTIA) and National Standard (OMTP) headphone plugs.
上述电容C1可以具体为1uf(微法)的电容,上述电阻R1和电阻R2可以具体为1500欧的电阻。The capacitor C1 may be specifically a 1 uf (microfarad) capacitor, and the resistor R1 and the resistor R2 may be specifically a 1500 ohm resistor.
图2中的录音回路还可以可选的包括:开关E1。该开关E1串接在录音回路的麦克风连接端与地线连接端之间;在开关E1闭合时,由于该录音回路不再与智能电子设备中的麦克风形成电容话筒回路,从而不能够再进行外接设备是否为设置有上述识别电路的外接设备的识别过程。The recording circuit in FIG. 2 can also optionally include: switch E1. The switch E1 is connected in series between the microphone connection end of the recording circuit and the ground connection end; when the switch E1 is closed, since the recording circuit no longer forms a condenser microphone circuit with the microphone in the intelligent electronic device, the external connection cannot be performed again. Whether the device is an identification process of an external device provided with the above identification circuit.
本实施例中的录音回路的另一个具体例子如图3所示。
Another specific example of the recording circuit in this embodiment is shown in FIG.
图3中的“1”、“2”、“3”以及“4”为上述图1中的耳机插头的各连接端的标识。图3中的录音回路包括:电阻R3、电容C2以及电容C3。电阻R3的一端为第一连接端,与耳机插头的右声道连接端和左声道连接端分别连接,电阻R3的另一端与电容C2以及电容C3分别连接,且电阻R3与电容C2以及电容C3分别串联。电容C2的一端为第二连接端,与耳机插头的地线连接端或者麦克风连接端连接,电容C2的另一端与电阻R3连接。电容C3的一端为第三连接端,与耳机插头的麦克风连接端或者地线连接端连接,电容C3的另一端与电阻R3连接。上述电容C2以及电容C3并联。通过图3所示的录音电路,智能电子设备输出的音频信号通过耳机插座、耳机插头以及录音回路后,可以被耳机插头以及耳机插座回传给智能电子设备中的麦克风,从而形成话筒回路。"1", "2", "3", and "4" in Fig. 3 are the identifications of the respective connection ends of the earphone plug in Fig. 1 described above. The recording circuit in Figure 3 includes: resistor R3, capacitor C2, and capacitor C3. One end of the resistor R3 is a first connection end, and is connected to the right channel connection end and the left channel connection end of the earphone plug, and the other end of the resistor R3 is respectively connected to the capacitor C2 and the capacitor C3, and the resistor R3 and the capacitor C2 and the capacitor are respectively connected. C3 is connected in series. One end of the capacitor C2 is a second connection end, and is connected to the ground connection end or the microphone connection end of the earphone plug, and the other end of the capacitor C2 is connected to the resistor R3. One end of the capacitor C3 is a third connection end, and is connected to the microphone connection end or the ground connection end of the earphone plug, and the other end of the capacitor C3 is connected to the resistor R3. The capacitor C2 and the capacitor C3 are connected in parallel. Through the recording circuit shown in FIG. 3, after the audio signal output by the intelligent electronic device passes through the earphone socket, the earphone plug and the recording circuit, it can be transmitted back to the microphone in the intelligent electronic device by the earphone plug and the earphone socket, thereby forming a microphone circuit.
另外,由于图3中的电阻R3与电容C2以及电容C3分别串联,且电容C2与电容C3并联,因此,无论是电容C2的一端与耳机插头的地线连接端连接且电容C3的一端与耳机插头的麦克风连接端连接,还是电容C2的一端与耳机插头的麦克风连接端连接,且电容C3的一端与耳机插头的地线连接端连接,该录音回路都可以与耳机插头以及智能电子设备中的耳机插座和麦克风一起形成话筒电路;从而图3示出的录音回路对国际标准(CTIA)以及国家标准(OMTP)的耳机插头均可适用。In addition, since the resistor R3 in FIG. 3 is connected in series with the capacitor C2 and the capacitor C3, and the capacitor C2 is connected in parallel with the capacitor C3, both ends of the capacitor C2 are connected to the ground connection end of the earphone plug and one end of the capacitor C3 is connected to the earphone. The microphone connection end of the plug is connected, or one end of the capacitor C2 is connected with the microphone connection end of the earphone plug, and one end of the capacitor C3 is connected with the ground connection end of the earphone plug, and the recording circuit can be combined with the earphone plug and the intelligent electronic device. The headphone jack and the microphone together form a microphone circuit; thus the recording circuit shown in Figure 3 is applicable to both International Standard (CTIA) and National Standard (OMTP) headphone plugs.
上述电阻R3可以为100欧-400欧的电阻,上述电容C2和电容C3可以为1uf(微法)的电容。The resistor R3 may be a resistor of 100 ohms to 400 ohms, and the capacitor C2 and the capacitor C3 may be a 1 uf (microfarad) capacitor.
图3中的录音回路还可以可选的包括:开关E1。该开关E1串接在录音回路的麦克风连接端与地线连接端之间;在开关E1闭合时,由于该录音回路不再与智能电子设备中的麦克风形成电容话筒回路,从而不能够再进行外接设备是否为设置有上述识别电路的外接设备的识别过程。The recording circuit in FIG. 3 can also optionally include: switch E1. The switch E1 is connected in series between the microphone connection end of the recording circuit and the ground connection end; when the switch E1 is closed, since the recording circuit no longer forms a condenser microphone circuit with the microphone in the intelligent electronic device, the external connection cannot be performed again. Whether the device is an identification process of an external device provided with the above identification circuit.
本实施例中的录音回路的再一个具体例子如图4所示。A further specific example of the recording circuit in this embodiment is shown in FIG.
图4中的“1”、“2”、“3”以及“4”为上述图1中的耳机插头的各连接端的标识。图4中的录音回路包括:电阻R4、电阻R5以及电阻R6。电阻R4的一端为第一连接端,与耳机插头的右声道连接端和左声道连接端分别连接,电阻R4的另一端与电阻R5以及电阻R6分别连接,且电阻R4与电阻R5以及电阻R6分别串联。电阻R5的一端为第二连接端,与耳机插头的地线连接端或者麦克风连接端连接,电阻R5的另一端与电阻R4连接。电阻R6的一端为第三连接端,与耳机插头的麦克风连接端或者地线连接端连接,电阻R6的另一端与电阻R4连接。上述电阻R5以及电阻R6并联。通过图4所示的录音电路,智能电子设备输出的音频信号通过耳机插座、耳机插头以及录音回路后,可以被耳机插头以及耳机插座回传给智能电子设备中的麦克风,从而形成话筒回路。
"1", "2", "3", and "4" in Fig. 4 are the identifications of the respective connection ends of the earphone plug in Fig. 1 described above. The recording circuit in FIG. 4 includes a resistor R4, a resistor R5, and a resistor R6. One end of the resistor R4 is a first connection end, and is connected to the right channel connection end and the left channel connection end of the earphone plug respectively, and the other end of the resistor R4 is respectively connected with the resistor R5 and the resistor R6, and the resistor R4 and the resistor R5 and the resistor are respectively connected. R6 is connected in series. One end of the resistor R5 is a second connection end, and is connected to the ground connection end or the microphone connection end of the earphone plug, and the other end of the resistor R5 is connected to the resistor R4. One end of the resistor R6 is a third connection end, and is connected to the microphone connection end or the ground connection end of the earphone plug, and the other end of the resistor R6 is connected to the resistor R4. The resistor R5 and the resistor R6 are connected in parallel. Through the recording circuit shown in FIG. 4, after the audio signal output by the intelligent electronic device passes through the earphone socket, the earphone plug and the recording circuit, it can be transmitted back to the microphone in the intelligent electronic device by the earphone plug and the earphone socket, thereby forming a microphone circuit.
另外,由于图4中的电阻R4与电阻R5以及电阻R6分别串联,且电阻R5与电阻R6并联,因此,无论是电阻R5的一端与耳机插头的地线连接端连接且电阻R6的一端与耳机插头的麦克风连接端连接,还是电阻R5的一端与耳机插头的麦克风连接端连接,且电阻R6的一端与耳机插头的地线连接端连接,该录音回路都可以与耳机插头以及智能电子设备中的耳机插座和麦克风一起形成话筒电路;从而图4示出的录音回路对国际标准(CTIA)以及国家标准(OMTP)的耳机插头均可适用。In addition, since the resistor R4 in FIG. 4 is connected in series with the resistor R5 and the resistor R6, and the resistor R5 is connected in parallel with the resistor R6, both ends of the resistor R5 are connected to the ground connection end of the earphone plug and one end of the resistor R6 is connected to the earphone. The microphone connection end of the plug is connected, or one end of the resistor R5 is connected to the microphone connection end of the earphone plug, and one end of the resistor R6 is connected with the ground connection end of the earphone plug, and the recording circuit can be combined with the earphone plug and the intelligent electronic device. The headphone jack and the microphone together form a microphone circuit; thus the recording circuit shown in Figure 4 is applicable to both International Standard (CTIA) and National Standard (OMTP) headphone plugs.
上述电阻R4可以为6k欧的电阻,上述电阻R5可以为6k欧的电阻,上述电阻R6可以为6k欧的电阻。需要特别说明的是,图4中电阻R4、电阻R5以及电阻R6的实际阻值可以相同,也可以不相同;在任意两个电阻的阻值之和在10k-15k范围内的情况下,图4中示出的录音回路可以适配目前几乎各种类型的基于Andriod操作系统的移动电话。The resistor R4 may be a 6k ohm resistor, the resistor R5 may be a 6k ohm resistor, and the resistor R6 may be a 6k ohm resistor. It should be specially noted that the actual resistance values of the resistor R4, the resistor R5 and the resistor R6 in FIG. 4 may be the same or different; in the case where the sum of the resistances of any two resistors is in the range of 10k-15k, The recording circuit shown in 4 can be adapted to almost all types of mobile phones based on the Andriod operating system.
图4中的录音回路还可以可选的包括:开关E1。该开关E1串接在录音回路的麦克风连接端与地线连接端之间;在开关E1闭合时,由于该录音回路不再与智能电子设备中的麦克风形成电容话筒回路,从而不能够再进行外接设备是否为设置有上述识别电路的外接设备的识别过程。The recording circuit in FIG. 4 can also optionally include: switch E1. The switch E1 is connected in series between the microphone connection end of the recording circuit and the ground connection end; when the switch E1 is closed, since the recording circuit no longer forms a condenser microphone circuit with the microphone in the intelligent electronic device, the external connection cannot be performed again. Whether the device is an identification process of an external device provided with the above identification circuit.
实施例二、基于耳机插座的外接设备识别方法。下面结合图5对本实施例的方法进行说明。Embodiment 2: An external device identification method based on a headphone jack. The method of this embodiment will be described below with reference to FIG.
图5中,S400、在监测到智能电子设备的耳机插座插入外接设备后,触发智能电子设备录音,并将智能电子设备的当前音频播放音量设置为第一预定值。In FIG. 5, S400, after detecting that the earphone socket of the smart electronic device is inserted into the external device, triggers the recording of the intelligent electronic device, and sets the current audio playback volume of the smart electronic device to a first predetermined value.
具体的,本实施例中的智能电子设备可以为采用Andriod操作系统的智能电子设备(如采用Andriod操作系统的智能移动电话或平板电脑等)。为了避免本实施例的外接设备识别过程对智能电子设备正在进行的通话或者录音造成影响,本实施例可以在检测到智能电子设备的耳机插座插入外接设备(如通过注册监听器接收操作系统的广播消息,以根据接收到的消息确定出智能电子设备的耳机插座中插入了外接设备)后,检测智能电子设备的当前状态(如通过读取智能电子设备的当前日志等方式来判断智能电子设备的当前状态);如果检测到智能电子设备的当前状态为通话状态或者录音状态等与语音相关的状态,则应暂时不进行本实施例后续的外接设备识别操作,而是等待智能电子设备在结束与语音相关的操作(如结束通话或者结束录音)之后,再开始执行本实施例后续的外接设备识别操作。Specifically, the smart electronic device in this embodiment may be an intelligent electronic device (such as a smart mobile phone or a tablet computer using the Andriod operating system) using the Andriod operating system. In order to prevent the external device identification process of the embodiment from affecting the ongoing call or recording of the smart electronic device, the embodiment may detect that the earphone socket of the smart electronic device is inserted into the external device (for example, receiving the broadcast of the operating system by registering the listener) The message, after determining that the external device is inserted into the earphone socket of the smart electronic device according to the received message, detecting the current state of the smart electronic device (for example, by reading the current log of the smart electronic device, etc.) If the current state of the smart electronic device is detected as a voice-related state such as a call state or a recording state, the subsequent external device identification operation in this embodiment should not be temporarily performed, but wait for the smart electronic device to end. After the voice-related operation (such as ending the call or ending the recording), the subsequent external device identification operation in this embodiment is started.
由于本实施例的外接设备识别过程会对智能电子设备的当前音频播放音量进行修改,因此,本实施例在执行外接设备识别过程中的修改智能电子设备
的当前音频播放音量操作之前,应先获取智能电子设备的当前音频播放音量,并存储该当前音频播放音量,以便于在本实施例的外接设备识别过程完成时,还可以将智能电子设备的当前音频播放音量恢复为在外接设备识别操作之前的音频播放音量。也就是说,本实施例在先存储了智能电子设备的当前音频播放音量后,再触发智能电子设备执行录音操作,并将智能电子设备的当前音频播放音量设置为第一预定值。Since the external device identification process of the embodiment modifies the current audio playback volume of the smart electronic device, the smart electronic device is modified in the process of performing the external device identification in this embodiment.
Before the current audio playback volume operation, the current audio playback volume of the smart electronic device should be obtained, and the current audio playback volume should be stored, so that when the external device identification process of the embodiment is completed, the current state of the smart electronic device can also be The audio playback volume is restored to the audio playback volume before the external device recognition operation. That is to say, after the current audio playback volume of the smart electronic device is stored, the smart electronic device is triggered to perform a recording operation, and the current audio playback volume of the smart electronic device is set to a first predetermined value.
上述第一预定值可以为智能电子设备的音量最小值(即静音值),如第一预定值为0,也就是说,本实施例可以将智能电子设备设置为静音状态。The first predetermined value may be a minimum value (ie, a mute value) of the smart electronic device, such as a first predetermined value of 0. That is, the embodiment may set the smart electronic device to a mute state.
本实施例中的触发智能电子设备执行录音操作与将智能电子设备的当前音频播放音量设置为第一预定值的操作之间可以没有先后顺序的限定,如两操作可以同时执行;再如可以先执行录音操作,再执行第一预定值的设置操作;还有,也可以先执行第一预定值的设置操作,再执行录音操作。In the embodiment, the operation of the triggering intelligent electronic device to perform the recording operation and the setting of the current audio playback volume of the intelligent electronic device to the first predetermined value may be limited. For example, the two operations may be performed simultaneously; The recording operation is performed, and then the setting operation of the first predetermined value is performed; or, the setting operation of the first predetermined value may be performed first, and then the recording operation is performed.
上述触发智能电子设备执行录音的操作可以通过调用智能电子设备操作系统中的录音函数来实现,本实施例不限制触发智能电子设备执行录音操作的具体实现方式。The above-mentioned operation of triggering the intelligent electronic device to perform the recording operation can be implemented by calling the recording function in the operating system of the intelligent electronic device. This embodiment does not limit the specific implementation manner of triggering the intelligent electronic device to perform the recording operation.
S410、在第一预定值情况下,获取通过录音获得的声音的音量值。S410. Acquire a volume value of the sound obtained by the recording in a first predetermined value.
具体的,在触发智能电子设备执行录音操作后,本实施例需要在智能电子设备的当前音频播放音量被设置为第一预定值的情况下,获取通过录音获得的声音的音量值。Specifically, after the smart electronic device is triggered to perform the recording operation, the embodiment needs to acquire the volume value of the sound obtained by the recording if the current audio playback volume of the smart electronic device is set to the first predetermined value.
本实施例可以在触发智能电子设备执行录音操作并等待一定时间后,再获取通过录音获得的声音的音量值。一个具体的例子,在先触发智能电子设备执行录音操作,再设置智能电子设备的当前音频播放音量的情况下,本实施例可以在将智能电子设备的当前音频播放音量设置为第一预定值,并等待第一预定时间间隔之后,再执行获取通过录音获得的声音的音量值的操作。In this embodiment, after the smart electronic device is triggered to perform a recording operation and waits for a certain time, the volume value of the sound obtained by the recording can be acquired. In a specific example, in a case where the smart electronic device is triggered to perform a recording operation and then the current audio playback volume of the smart electronic device is set, the current audio playback volume of the smart electronic device may be set to a first predetermined value. And waiting for the first predetermined time interval, the operation of acquiring the volume value of the sound obtained by the recording is performed.
本实施例可以采用定时获取的方式获得多个通过录音获得的声音的音量值,并对这多个音量值计算出平均值,该计算出的音量平均值主要用于后续的比较过程,该音量平均值可以被称为第一音量平均值。In this embodiment, a plurality of volume values of the sound obtained by the recording may be obtained by using a timing acquisition manner, and an average value is calculated for the plurality of volume values, and the calculated volume average value is mainly used for a subsequent comparison process, and the volume is used for the subsequent comparison process. The average value can be referred to as a first volume average.
本实施例在计算出第一音量平均值时,可以判断该第一音量平均值是否大于预定音量值(如1000),如果第一音量平均值大于预定音量值(如大于1000),则可以确定出该外接设备不是设置有上述实施例一中的识别电路的外接设备,本次外接设备的识别过程结束;如果第一音量平均值不大于预定值(如小于等于1000),则继续执行本实施例后续的识别步骤。In this embodiment, when calculating the first volume average, it may be determined whether the first volume average is greater than a predetermined volume value (eg, 1000), and if the first volume average is greater than a predetermined volume value (eg, greater than 1000), then The external device is not an external device provided with the identification circuit in the first embodiment, and the identification process of the external device ends; if the first volume average is not greater than a predetermined value (for example, less than or equal to 1000), the implementation continues. The subsequent identification steps of the example.
上述预定音量值可以是根据经验预先设置于智能电子设备中的;且上述第一预定时间间隔可以是根据经验预先设置于智能电子设备中的,也可以是有目
的性的针对智能电子设备的实际情况而动态设置于智能电子设备中的。The predetermined volume value may be preset in the smart electronic device according to experience; and the first predetermined time interval may be pre-set in the smart electronic device according to experience, or may be
The sexuality is dynamically set in the intelligent electronic device for the actual situation of the intelligent electronic device.
针对智能电子设备的实际情况动态设置第一预定时间间隔的一个具体例子为:设定智能电子设备的当前音频播放音量可以是用户通过按键等方式能够手动调整的音量,例如,智能电子设备中的可供用户通过按键等方式手动调整的音量被划分为15级(Andriod操作系统的智能移动电话具有15级可供用户手工调整的音量)这15级可以被分别称为音量0至音量14,其中的音量0表示静音;依照音量1至音量14的排列顺序,音量1至音量14各自对应的声音逐渐增大,且音量14对应的声音最大。在当前音频播放音量为上述情况下,第一预定时间间隔的具体设置过程包括:首先,在智能电子设备首次与本实施例的具有上述识别电路的外接设备通过耳机插头以及耳机插座连接的情况下,本实施例可以针对该外接设备进行初始化设置操作,具体的,在备份智能电子设备的当前音频播放音量后,将智能电子设备的当前音频播放音量设置为除静音之外的最小级音量(即上述音量1,也就是除静音级之外的最小级对应的音量);然后,触发电子设备执行播放本地存储的音频信号(如智能电子设备中内置的第二音乐)的操作,并开始计时;在等待一段时间(如500毫秒)后,触发智能电子设备进行录音,之后,在等待一段时间(如300毫秒)后,获取通过录音获得的声音的音量值(如获取操作系统返回的音量值),并判断该音量值是否大于预定值(如100)以及当前计时值是否达到预定时长(如2秒),如果获取的音量值不大于预定值且当前计时值没有达到预定时长,则返回上述获取通过录音获得的声音的音量值以及针对音量值和当前计时值进行判断的步骤;如果音量值大于预定值或者当前计时值达到预定时长,则将上述计时的当前计时值设置为第一预定时间间隔。A specific example of dynamically setting the first predetermined time interval for the actual situation of the smart electronic device is: setting the current audio playback volume of the smart electronic device may be a volume that the user can manually adjust by means of a button, etc., for example, in an intelligent electronic device. The volume that can be manually adjusted by the user through buttons or the like is divided into 15 levels (the intelligent mobile phone of the Andriod operating system has 15 levels of volume that can be manually adjusted by the user). The 15 levels can be referred to as volume 0 to volume 14, respectively. The volume 0 indicates silence; according to the order of volume 1 to volume 14, the sound corresponding to each of volume 1 to volume 14 gradually increases, and the volume corresponding to volume 14 is the loudest. In the case where the current audio playback volume is the above, the specific setting process of the first predetermined time interval includes: first, in the case that the smart electronic device is first connected to the external device having the above identification circuit of the present embodiment through the earphone plug and the earphone socket In this embodiment, the initial setting operation may be performed on the external device. Specifically, after the current audio playback volume of the intelligent electronic device is backed up, the current audio playback volume of the smart electronic device is set to a minimum volume other than the mute (ie, The above volume 1, that is, the volume corresponding to the minimum level other than the silent level); then, the triggering electronic device performs an operation of playing a locally stored audio signal (such as the second music built in the smart electronic device), and starts timing; After waiting for a period of time (such as 500 milliseconds), the smart electronic device is triggered to record, and after waiting for a period of time (such as 300 milliseconds), the volume value of the sound obtained by the recording is obtained (for example, obtaining the volume value returned by the operating system) And determine whether the volume value is greater than a predetermined value (such as 100) and whether the current timing value is A predetermined time period (for example, 2 seconds) is reached. If the acquired volume value is not greater than the predetermined value and the current timing value does not reach the predetermined duration, the volume value of the sound obtained by the recording is obtained, and the volume value and the current timing value are determined. Step; if the volume value is greater than the predetermined value or the current timing value reaches the predetermined duration, the current timing value of the timing is set to the first predetermined time interval.
由上述具体的例子可知,本实施例的第一预定时间间隔的具体取值会被设置为上述等待的时长与预定时长之间的一个数值,如第一预定时间间隔的最小取值为300毫秒,且其最大取值为2秒。It can be seen from the above specific example that the specific value of the first predetermined time interval in this embodiment is set to a value between the waiting time and the predetermined time length, for example, the minimum value of the first predetermined time interval is 300 milliseconds. And its maximum value is 2 seconds.
另外,在实际应用中,智能电子设备为用户提供的通过按键等方式能够手动调整的音量也许更多或者更少,为了适应不同类型的智能电子设备,本实施例中的智能电子设备的当前音频播放音量可以不是用户通过按键等能够手动调整的音量,一个具体的例子,将智能电子设备的最大播放音量划分为15级,如计算最大播放音量/15,根据上述划分后的各级对应的音量值来设置智能电子设备的当前音频播放音量。In addition, in actual applications, the volume that the smart electronic device can provide for the user to manually adjust by means of a button or the like may be more or less. In order to adapt to different types of smart electronic devices, the current audio of the smart electronic device in this embodiment The playback volume may not be the volume that the user can manually adjust by pressing a button, etc., a specific example, the maximum playback volume of the intelligent electronic device is divided into 15 levels, such as calculating the maximum playback volume / 15, according to the volume corresponding to the above divided levels Value to set the current audio playback volume of the smart device.
S420、将智能电子设备的当前音频播放音量设置为第二预定值。S420. Set a current audio playback volume of the smart electronic device to a second predetermined value.
具体的,在针对第一预定值成功获取了通过录音获得的声音的音量值之后,将智能电子设备的当前音频播放音量调整设置为第二预定值,且第二预定
值大于第一预定值。Specifically, after the volume value of the sound obtained by the recording is successfully acquired for the first predetermined value, the current audio playback volume adjustment of the smart electronic device is set to a second predetermined value, and the second predetermined
The value is greater than the first predetermined value.
上述第二预定值可以是根据经验预先设置于智能电子设备中的,也可以是有目的性的针对智能电子设备的实际情况而动态设置于智能电子设备中的。The second predetermined value may be preset in the smart electronic device according to experience, or may be dynamically set in the smart electronic device for the purpose of the smart electronic device.
针对智能电子设备的实际情况而动态设置第二预定值的一个具体例子为:设定第一预定值为0(即智能电子设备处于静音状态),将智能电子设备的当前音频播放音量设置为0,定时获取通过录音获得的声音的音量值(如获取操作系统返回的音量值),并针对获取到的多个音量值(如10个音量值)计算平均值(记为第一平均值);播放本地预先存储的音频信号(如播放第一音乐),并将智能电子设备的当前音频播放音量设置为音量1(如除静音之外的最小级音量);然后,定时获取通过录音获得的声音的音量值(如获取操作系统返回的音量值),并针对获取到的多个音量值(如10个音量值)计算平均值(记为第二平均值),之后,判断第二平均值是否为第一平均值的预定倍数(该预定倍数应大于7倍,如可以采用9倍),如果第二平均值没有达到第一平均值的预定倍数,则将智能电子设备的当前音频播放音量设置为音量2,并返回到定时获取通过录音获得的声音的音量值并针对获取到的多个音量值计算平均值(记为第二平均值)以及判断倍数的步骤;如果第二平均值达到第一平均值的预定倍数,则将智能电子设备的当前音频播放音量确定为第二预定值。A specific example of dynamically setting the second predetermined value for the actual situation of the smart electronic device is: setting the first predetermined value to 0 (ie, the smart electronic device is in the mute state), and setting the current audio playback volume of the smart electronic device to 0. Obtaining the volume value of the sound obtained by the recording (such as obtaining the volume value returned by the operating system), and calculating an average value (recorded as the first average value) for the obtained plurality of volume values (such as 10 volume values); Play local pre-stored audio signals (such as playing the first music), and set the current audio playback volume of the smart electronic device to volume 1 (such as the minimum volume other than mute); then, periodically obtain the sound obtained through the recording Volume value (such as obtaining the volume value returned by the operating system), and calculating an average value (recorded as a second average value) for the obtained plurality of volume values (such as 10 volume values), and then determining whether the second average value is Is a predetermined multiple of the first average value (the predetermined multiple should be greater than 7 times, if 9 times can be used), if the second average does not reach a predetermined multiple of the first average, then the smart electronic The current audio playback volume is set to volume 2, and returns to the step of timingly obtaining the volume value of the sound obtained by the recording and calculating an average value (recorded as the second average value) for the obtained plurality of volume values and judging the multiple; If the second average value reaches a predetermined multiple of the first average value, the current audio playback volume of the intelligent electronic device is determined to be a second predetermined value.
S430、播放预定音频信号,并在第二预定值情况下,获取通过录音获得的声音的音量值。S430. Play a predetermined audio signal, and in a second predetermined value, acquire a volume value of the sound obtained by the recording.
具体的,本实施例需要在智能电子设备的当前音频播放音量被调整设置为第二预定值的情况下,获取通过录音获得的声音的音量值。Specifically, in this embodiment, when the current audio playback volume of the smart electronic device is adjusted to be set to a second predetermined value, the volume value of the sound obtained by the recording is acquired.
本实施例可以在播放本地存储的预定音频信号(如智能电子设备中内置的第一音乐),且等待第二预定时间间隔后,执行获取通过录音获得的声音的音量值的操作。The present embodiment can perform an operation of acquiring a volume value of a sound obtained by recording after playing a locally stored predetermined audio signal (such as the first music built in the smart electronic device) and waiting for a second predetermined time interval.
本实施例可以采用定时获取的方式获得多个通过录音获得的声音的音量值,并对获取到的多个音量值计算出平均值(记为第二平均值),计算出的音量平均值用于后续的比较过程。In this embodiment, a plurality of volume values obtained by recording can be obtained by using a timing acquisition method, and an average value (recorded as a second average value) is calculated for the obtained plurality of volume values, and the calculated volume average value is used. In the subsequent comparison process.
上述第二预定时间间隔是预先设置在智能电子设备中的,且该第二预定时间间隔可以是根据经验预先设置于智能电子设备中的,也可以是有目的性的针对智能电子设备的实际情况而动态设置于智能电子设备中的。The second predetermined time interval is preset in the smart electronic device, and the second predetermined time interval may be pre-set in the smart electronic device according to experience, or may be a purposeful situation for the smart electronic device. And dynamically set in the smart electronic device.
针对智能电子设备的实际情况动态设置第二预定时间间隔的一个具体例子为:在本实施例针对该外接设备进行初始化设置操作的过程中,在设置了第一预定时间间隔之后,继续触发智能电子设备播放预先设置的音频信号(如智能电子设备中内置的第一音乐),并开始计时,在等待一段时间(如等待200
毫秒)后,获取通过录音获得的声音的音量值(如获取操作系统返回的音量值),并判断该音量值是否大于预定值(如100)以及当前计时值是否达到另一预定时长(如1秒),如果获取的音量值不大于预定值且当前计时值没有达到另一预定时长,则返回上述获取通过录音获得的声音的音量值以及针对音量值和当前计时值进行判断的步骤;如果音量值大于预定值或者当前计时值达到另一预定时长,则将上述计时的当前计时值设置为第二预定时间间隔。A specific example of dynamically setting the second predetermined time interval for the actual situation of the intelligent electronic device is: in the process of performing the initial setting operation for the external device in this embodiment, after the first predetermined time interval is set, the smart electronic device continues to be triggered. The device plays a preset audio signal (such as the first music built into the smart electronic device) and starts timing, waiting for a while (such as waiting for 200)
After milliseconds, obtain the volume value of the sound obtained by the recording (such as obtaining the volume value returned by the operating system), and determine whether the volume value is greater than a predetermined value (such as 100) and whether the current timing value reaches another predetermined duration (such as 1). Second), if the acquired volume value is not greater than the predetermined value and the current timing value does not reach another predetermined duration, return to the above-mentioned step of obtaining the volume value of the sound obtained by the recording and determining for the volume value and the current timing value; When the value is greater than the predetermined value or the current timing value reaches another predetermined length of time, the current timing value of the timing is set to the second predetermined time interval.
由上述具体的例子可知,本实施例的第二预定时间间隔的具体取值会被设置为上述等待的时长与另一预定时长之间的一个数值,如第二预定时间间隔的最小取值为200毫秒,且其最大取值为1秒。It can be seen from the above specific example that the specific value of the second predetermined time interval in this embodiment is set to a value between the waiting duration and another predetermined duration, such as the minimum value of the second predetermined time interval. 200 milliseconds, and its maximum value is 1 second.
S440、根据针对第一预定值获取的音量值与针对第二预定值获取的音量值之间的比较确定外接设备是否为设置有上述实施例一中的识别电路的外接设备。S440. Determine, according to a comparison between the volume value acquired for the first predetermined value and the volume value acquired for the second predetermined value, whether the external device is an external device provided with the identification circuit in the first embodiment.
具体的,本实施例可以判断针对第二预定值计算出的音量值的平均值(即上述第二平均值)是否达到针对第一预定值计算出的音量值的平均值(即上述第一平均值)的另一预定倍数(如7倍);如果第二平均值达到第一平均值的7倍,则确定出该外接设备为设置有上述实施例一记载的识别电路的外接设备;如果第二平均值没有达到第一平均值的7倍,则确定出该外接设备不为设置有上述实施例一记载的识别电路的外接设备。Specifically, the embodiment may determine whether an average value of the volume values calculated for the second predetermined value (ie, the second average value) reaches an average value of the volume values calculated for the first predetermined value (ie, the first average Another predetermined multiple of the value (for example, 7 times); if the second average value reaches 7 times of the first average value, it is determined that the external device is an external device provided with the identification circuit described in the first embodiment; If the two average values do not reach 7 times of the first average value, it is determined that the external device is not an external device provided with the identification circuit described in the first embodiment.
本实施例的外接设备识别过程的整个过程的用时通常不超过2秒。在智能电子设备处于静音的情况下,智能电子设备录制到的音源输入是比较低且比较平稳的声音,而在将智能电子设备设置为非静音的情况下,在有音乐播放时,智能电子设备录制到的音源输入的音量会突然变大;经过多次试验验证,两个阶段获取的音量平均值的比值超过7倍;现有的耳机在智能电子设备处于静音的情况下,智能电子设备接收到的音源输入的音量通常都比较平稳,经过多次试验验证,两个阶段获取的音量平均值的比值不超过6倍;因此,本实施例通过判断不同情况下的音量平均值的比值即可以准确判断出智能电子设备的外接设备是设置有上述识别电路的外接设备,还是其他设备如普通的耳机等外接设备。The time taken for the entire process of the external device identification process of the present embodiment is usually less than 2 seconds. In the case that the smart electronic device is muted, the input of the sound source recorded by the intelligent electronic device is a relatively low and relatively smooth sound, and in the case where the smart electronic device is set to be non-silent, when the music is played, the intelligent electronic device The volume of the input to the audio source will suddenly become larger; after repeated tests, the ratio of the average volume obtained in the two stages exceeds 7 times; the existing headphones receive the smart electronic device while the smart electronic device is muted. The volume of the input to the sound source is usually relatively stable. After repeated tests, the ratio of the volume average obtained in the two stages does not exceed 6 times; therefore, the ratio of the volume average value in different cases can be determined in this embodiment. It is accurately determined whether the external device of the intelligent electronic device is an external device provided with the above identification circuit, or is an external device such as an ordinary earphone.
另外,需要说明的是,本实施例在识别出外接设备是设置有上述实施例一所记载的识别电路的外接设备的情况下,应将插入的外接设备是无效耳机的信息传输给智能电子设备中的相关部分,如通知操作系统或者通知与语音操作相关的应用等;这样,在操作系统或者相关应用在执行与语音相关的操作(如接听电话等)时,可以获知当前通过耳机插座与智能电子设备连接的外接设备不是耳机,从而会进行切换至智能电子设备的内置话筒的操作,而不再使用耳机
话筒。由于在上述实施例一中的开关E1处于断开状态时,智能电子设备输出的音频信号通过内置话筒播放,而不会在通过耳机插座、耳机插头传输至录音回路,并通过录音回路、耳机插头以及耳机插座回传至麦克风,因此,设置有上述实施例一所记载的识别电路的外接设备不会对智能电子设备的正常通话等操作产生影响。In addition, it should be noted that, in the case where the external device is identified as the external device provided with the identification circuit described in the first embodiment, the information of the inserted external device that is the invalid earphone should be transmitted to the intelligent electronic device. Relevant parts in the system, such as notifying the operating system or notifying the application related to the voice operation; thus, when the operating system or related application performs voice-related operations (such as answering a call, etc.), the current through the earphone socket and the smart can be known. The external device connected to the electronic device is not a headset, so it switches to the built-in microphone of the smart electronic device instead of using the headset.
microphone. Since the switch E1 in the first embodiment is in the off state, the audio signal output by the smart electronic device is played through the built-in microphone, and is not transmitted to the recording circuit through the earphone socket or the earphone plug, and passes through the recording circuit and the earphone plug. And the earphone socket is returned to the microphone. Therefore, the external device provided with the identification circuit described in the first embodiment does not affect the operation such as the normal call of the smart electronic device.
实施例三、基于耳机插座的外接设备识别方法。下面结合图6和图7对本实施例的装置进行详细说明。Embodiment 3: An external device identification method based on a headphone jack. The apparatus of this embodiment will be described in detail below with reference to Figs. 6 and 7.
图6中,在通过接收操作系统发送的通知等方式判断出外接设备的耳机插头插入智能电子设备的耳机插座之后,采用读取智能电子设备的日志等方式判断智能电子设备是否正在进行与语音相关的处理(如正在进行通话或者录音等),如果确定出智能电子设备正在进行与语音相关的处理,则等待与语音相关的处理结束后,获取智能电子设备的当前音频播放音量,并存储该当前音频播放音量,然后,触发智能电子设备执行录音操作;将智能电子设备的当前音频播放音量设置为0(即智能电子设备处于静音状态),并等待第一预定时间间隔time1后,定时获取通过录音获得的声音的音量值,例如每隔70毫秒获取一次通过录音获得的声音的音量值,并针对获取到的10个音量值计算音量平均值AvgVolume1;为避免后续运算存在问题,因此,在计算出的AvgVolume1为0的情况下,可以将AvgVolume1设置为1;之后,判断AvgVolume1是否超过预定音量值1000,如果超过预定音量值1000,则确定出该外接设备不是设置有上述实施例一中记载的识别电路的外接设备,在将智能电子设备的当前音频播放音量恢复为上述存储的当前音频播放音量后,本次识别过程结束;如果AvgVolume1没有超过预定音量值1000,则继续后续的判断操作;之后,将智能电子设备的当前音频播放音量设置为第二预定值Volume1,并播放智能电子设备内置的第一音乐;在等待第二预定时间间隔time2后,定时获取通过录音获得的声音的音量值,例如每隔70毫秒获取一次通过录音获得的声音的音量值,并针对获取到的10个音量值计算音量平均值AvgVolume2;为避免后续运算存在问题,因此,在计算出的AvgVolume2为0的情况下,可以将AvgVolume2设置为1;判断AvgVolume1和AvgVolume2之间的关系是否满足AvgVolume2>AvgVolume1*7这一条件,如果满足这一条件,则确定出该外接设备为设置有上述实施例一中记载的识别电路的外接设备,在将智能电子设备的当前音频播放音量恢复为上述存储的当前音频播放音量后,本次识别过程结束;如果不满足这一条件,则确定出外接设备不为设置有上述实施例一中记载的识别电路的外接设备,在将智能电子设备的当前音频播放音量恢复为上述存储的当前音频播放音量后,本次识别过程结束。
In FIG. 6, after the headset plug of the external device is inserted into the earphone socket of the smart electronic device by receiving a notification sent by the operating system, etc., the smart electronic device is used to check whether the smart electronic device is performing voice related. Processing (such as ongoing call or recording, etc.), if it is determined that the intelligent electronic device is performing voice-related processing, after waiting for the voice-related processing to end, acquiring the current audio playback volume of the intelligent electronic device, and storing the current Audio playback volume, then triggering the intelligent electronic device to perform a recording operation; setting the current audio playback volume of the smart electronic device to 0 (ie, the smart electronic device is in a mute state), and waiting for the first predetermined time interval time1, timing acquisition through the recording The volume value of the obtained sound, for example, the volume value of the sound obtained by the recording every 70 milliseconds, and the volume average value AvgVolume1 is calculated for the obtained 10 volume values; in order to avoid the subsequent operation, there is a problem, and therefore, In the case where AvgVolume1 is 0, Setting AvgVolume1 to 1; after that, determining whether AvgVolume1 exceeds a predetermined volume value of 1000, and if the predetermined volume value is exceeded 1000, determining that the external device is not an external device provided with the identification circuit described in Embodiment 1 above, After the current audio playback volume of the device is restored to the current audio playback volume stored above, the identification process ends; if AvgVolume1 does not exceed the predetermined volume value of 1000, the subsequent determination operation is continued; after that, the current audio playback volume of the smart electronic device is turned on. Set to a second predetermined value Volume1, and play the first music built in the smart electronic device; after waiting for the second predetermined time interval time2, periodically obtain the volume value of the sound obtained by the recording, for example, obtaining the recording by using the recording every 70 milliseconds. The volume value of the sound, and the volume average value AvgVolume2 is calculated for the obtained 10 volume values; in order to avoid problems with subsequent operations, if the calculated AvgVolume2 is 0, AvgVolume2 can be set to 1; determine AvgVolume1 Does the relationship with AvgVolume2 satisfy Av? gVolume2>AvgVolume1*7, if the condition is met, it is determined that the external device is an external device provided with the identification circuit described in the first embodiment, and the current audio playback volume of the intelligent electronic device is restored to the above After the current audio playback volume is stored, the identification process ends; if the condition is not satisfied, it is determined that the external device is not the external device provided with the identification circuit described in the first embodiment, and the current electronic device is After the audio playback volume is restored to the current audio playback volume stored above, the recognition process ends.
在本实施例中,上述第一预定时间间隔time1、第二预定时间间隔time2以及第二预定值Volume1的设置过程可以通过对设置有上述识别电路的外接设备进行初始化设置的过程来设置。本实施例进行初始化设备的过程的一个具体例子如图7所示。In the present embodiment, the setting process of the first predetermined time interval time 1, the second predetermined time interval time2, and the second predetermined value Volume1 may be set by a process of initializing the setting of the external device provided with the above identification circuit. A specific example of the process of initializing the device in this embodiment is shown in FIG.
图7中,在将设置有上述识别电路的外接设备的耳机插头插入智能电子设备的耳机插孔之后,启动智能电子设备中的相应应用,并点选该应用中的初始化功能;该应用可以采用读取智能电子设备的日志等方式判断智能电子设备是否正在进行与语音相关的处理(如正在播放音乐或者正在进行通话或者录音等),如果确定出智能电子设备正在播放音乐,则该应用可以提示用户关闭正在播放的音乐后再进行初始化操作,如果确定出智能电子设备正在通话或者录音,则该应用可以提示用户等待通话或者录音结束后再进行初始化操作;如果智能电子设备没有正在进行与语音相关的处理,则获取智能电子设备的当前音频播放音量,并存储该当前音频播放音量,然后,将智能电子设备的当前音频播放音量设置为音量1(如在15级音量中除静音之外的最小级音量),并播放应用内置的音乐2,在等待500毫秒后触发智能电子设备执行录音操作,开始计时;等待300毫秒后,获取通过录音获得的声音的音量值,并判断该音量值是否大于100,且计时的当前计时值是否小于2秒,如果获取的音量值不大于100且计时的当前计时值小于2秒,则继续上述获取通过录音获得的声音的音量值以及上述判断操作;如果获取的音量值大于100或者计时的当前计时值不小于2秒,则将计时的当前计时值作为第一预定时间间隔time1,该第一预定时间间隔time1的取值应在300毫秒至2秒之间;关闭上述音乐2,并等待300毫秒;然后,播放应用内置的音乐1,并开始计时,等待200毫秒之后,获取通过录音获得的声音的音量值,并判断该音量值是否大于100,且计时的当前计时值是否小于1秒,如果获取的音量值不大于100且计时的当前计时值小于1秒,则继续上述获取通过录音获得的声音的音量值以及上述判断操作;如果获取的音量值大于100或者计时的当前计时值不小于1秒,则将计时的当前计时值作为第二预定时间间隔time2,该第二预定时间间隔time2的取值应在200毫秒至1秒之间;关闭上述音乐1,并将智能电子设备的当前音频播放音量设置为音量0(即静音),然后,等待300毫秒,然后,定时获取通过录音获得的声音的音量值,例如每隔70毫秒获取一次通过录音获得的声音的音量值,并针对获取到的多个(如10个)音量值计算音量平均值AvgVolume1;之后,将智能电子设备的当前音频播放音量设置为音量1,并播放智能电子设备内置的第一音乐;在等待第二预定时间间隔200毫秒后,定时获取通过录音获得的声音的音量值,例如每隔70毫秒获取一次通过录音获得的声音的音量值,并针对获取到的多个(如10
个)音量值计算音量平均值AvgVolume2;判断AvgVolume1和AvgVolume2是否满足AvgVolume2>AvgVolume1*9这一条件,如果满足这一条件,则将上述音量1设置为第一预定值,在将智能电子设备的当前音频播放音量恢复为上述存储的当前音频播放音量后,本次初始化过程结束;如果不满足这一条件,则将智能电子设备的当前音频播放音量设置为音量2,并返回到上述定时获取通过录音获得的声音的音量值,并计算音量平均值AvgVolume2以及判断AvgVolume1和AvgVolume2是否满足上述条件的步骤;以此类推,直到AvgVolume1和AvgVolume2的关系满足AvgVolume2>AvgVolume1*9这一条件为止,将当前音频播放音量设置为第一预定值,并将智能电子设备的当前音频播放音量恢复为上述存储的当前音频播放音量后,本次初始化过程结束。In FIG. 7, after the earphone plug of the external device provided with the above identification circuit is inserted into the earphone jack of the smart electronic device, the corresponding application in the smart electronic device is activated, and the initialization function in the application is clicked; the application can be adopted. Reading the smart electronic device log or the like to determine whether the smart electronic device is performing voice-related processing (such as playing music or making a call or recording, etc.), if it is determined that the smart electronic device is playing music, the application can prompt After the user closes the music being played, the initialization operation is performed. If it is determined that the smart electronic device is talking or recording, the application may prompt the user to wait for the call or perform the initialization operation after the recording is finished; if the intelligent electronic device is not performing voice related Processing, obtaining the current audio playback volume of the intelligent electronic device, and storing the current audio playback volume, and then setting the current audio playback volume of the smart electronic device to volume 1 (such as the minimum except for mute in the 15-level volume) Level volume) and play With the built-in music 2, after waiting for 500 milliseconds, the smart electronic device is triggered to perform the recording operation, and the timing is started; after waiting for 300 milliseconds, the volume value of the sound obtained by the recording is obtained, and it is judged whether the volume value is greater than 100, and the current time is Whether the timing value is less than 2 seconds, if the acquired volume value is not greater than 100 and the current timing value of the timing is less than 2 seconds, continue to obtain the volume value of the sound obtained by the recording and the above judgment operation; if the acquired volume value is greater than 100 or If the current timing value of the timing is not less than 2 seconds, the current timing value of the timing is taken as the first predetermined time interval time1, and the value of the first predetermined time interval time1 should be between 300 milliseconds and 2 seconds; And wait for 300 milliseconds; then, play the built-in music 1 of the application, and start timing, wait for 200 milliseconds, obtain the volume value of the sound obtained by the recording, and determine whether the volume value is greater than 100, and whether the current timing value of the timing is less than 1 second, if the acquired volume value is not greater than 100 and the current timing value of the timing is less than 1 second, the above acquisition is continued. The volume value of the sound obtained by the recording and the above-mentioned judging operation; if the acquired volume value is greater than 100 or the current timing value of the timing is not less than 1 second, the current timing value of the timing is taken as the second predetermined time interval time2, the second predetermined time The interval time2 should be between 200 milliseconds and 1 second; turn off the above music 1, and set the current audio playback volume of the smart electronic device to volume 0 (ie, mute), then wait for 300 milliseconds, then wait for the timing to pass. The volume value of the sound obtained by the recording, for example, the volume value of the sound obtained by the recording every 70 milliseconds, and the volume average value AvgVolume1 is calculated for the obtained plurality of (for example, 10) volume values; after that, the intelligent electronic device is The current audio playback volume is set to volume 1 and the first music built into the smart electronic device is played; after waiting for the second predetermined time interval of 200 milliseconds, the volume value of the sound obtained by the recording is periodically acquired, for example, every 70 milliseconds. The volume value of the sound obtained by recording, and for multiple acquired (such as 10
The volume value calculates the volume average AvgVolume2; determines whether AvgVolume1 and AvgVolume2 satisfy the condition of AvgVolume2>AvgVolume1*9, and if this condition is satisfied, the above volume 1 is set to the first predetermined value, at the current state of the intelligent electronic device After the audio playback volume is restored to the current audio playback volume stored above, the initialization process ends; if the condition is not met, the current audio playback volume of the smart electronic device is set to volume 2, and the timing is returned to the above-mentioned timing. The volume value of the obtained sound, and the volume average value AvgVolume2 and the steps of judging whether AvgVolume1 and AvgVolume2 satisfy the above conditions; and so on, until the relationship between AvgVolume1 and AvgVolume2 satisfies the condition of AvgVolume2>AvgVolume1*9, the current audio is played. After the volume is set to the first predetermined value and the current audio playback volume of the smart electronic device is restored to the current stored audio playback volume, the initialization process ends.
实施例四、基于耳机插座的外接设备识别装置。该识别装置设置于智能电子设备中,该智能电子设备可以为采用Andriod操作系统的智能电子设备(如采用Andriod操作系统的智能移动电话或平板电脑等)。Embodiment 4: An external device identification device based on a headphone jack. The identification device is disposed in an intelligent electronic device, which may be an intelligent electronic device (such as a smart mobile phone or tablet using the Andriod operating system) using the Andriod operating system.
下面结合图8对本实施例的装置进行详细说明。The apparatus of this embodiment will be described in detail below with reference to FIG.
图8示出的装置主要包括:第一设置模块700、第一获取模块710、第二设置模块720、第二获取模块730以及识别模块740;另外,该装置还可以包括:第一初始化模块、第二初始化模块以及第三初始化模块(图8中未示出)。The device shown in FIG. 8 mainly includes: a first setting module 700, a first obtaining module 710, a second setting module 720, a second obtaining module 730, and an identifying module 740. In addition, the device may further include: a first initializing module, The second initialization module and the third initialization module (not shown in FIG. 8).
第一设置模块700与第一获取模块710连接。第一设置模块700主要适于在监测到智能电子设备的耳机插座插入外接设备后,触发智能电子设备录音,并将智能电子设备的当前音频播放音量设置为第一预定值。The first setting module 700 is connected to the first obtaining module 710. The first setting module 700 is mainly configured to trigger the recording of the smart electronic device after the earphone socket of the smart electronic device is detected to be inserted into the external device, and set the current audio playback volume of the smart electronic device to a first predetermined value.
具体的,为了避免本装置的外接设备识别过程对智能电子设备正在进行的通话或者录音造成影响,第一设置模块700可以在检测到智能电子设备的耳机插座插入外接设备(如通过注册监听器接收操作系统的广播消息,以根据接收到的消息确定出智能电子设备的耳机插座中插入了外接设备)后,检测智能电子设备的当前状态(如通过读取智能电子设备的当前日志等方式来判断智能电子设备的当前状态);如果检测到智能电子设备的当前状态为通话状态或者录音状态等与语音相关的状态,则第一设置模块700应暂时不进行其设置当前音频播放音量以及触发录音的操作,而是等待智能电子设备在结束与语音相关的操作(如结束通话或者结束录音)之后,第一设置模块700再开始执行其设置当前音频播放音量以及触发录音的操作。Specifically, in order to prevent the external device identification process of the device from affecting the ongoing call or recording of the smart electronic device, the first setting module 700 may insert the external device of the earphone socket of the smart electronic device (eg, by registering the listener) After the broadcast message of the operating system determines that the external device is inserted into the earphone socket of the smart electronic device according to the received message, detecting the current state of the smart electronic device (for example, by reading the current log of the intelligent electronic device) If the current state of the smart electronic device is detected as a voice-related state such as a call state or a recording state, the first setting module 700 should temporarily not set the current audio playback volume and trigger the recording. Operation, but waiting for the intelligent electronic device to end the voice-related operation (such as ending the call or ending the recording), the first setting module 700 resumes its operation of setting the current audio playback volume and triggering the recording.
由于本装置的外接设备识别过程会对智能电子设备的当前音频播放音量进行修改,因此,第一设置模块700在执行其设置智能电子设备的当前音频播放音量操作之前,应先获取智能电子设备的当前音频播放音量,并存储该当前音频播放音量,以便于在识别模块740执行完识别操作后,还可以将智能电子
设备的当前音频播放音量恢复为在外接设备识别操作之前的音频播放音量。也就是说,第一设置模块700在先存储了智能电子设备的当前音频播放音量后,再触发智能电子设备执行录音操作,并将智能电子设备的当前音频播放音量设置为第一预定值。Since the external device identification process of the device modifies the current audio playback volume of the smart electronic device, the first setting module 700 should acquire the smart electronic device before performing the current audio playback volume operation of setting the smart electronic device. The current audio playback volume, and the current audio playback volume is stored, so that after the identification module 740 performs the identification operation, the smart electronic device can also be
The current audio playback volume of the device is restored to the audio playback volume before the external device recognition operation. That is, after the first setting module 700 stores the current audio playback volume of the smart electronic device, the smart electronic device is triggered to perform a recording operation, and the current audio playback volume of the smart electronic device is set to a first predetermined value.
上述第一预定值可以为智能电子设备的音量最小值(即静音值),如第一预定值为0,也就是说,第一设置模块700可以将智能电子设备设置为静音状态。The first predetermined value may be a minimum value of the smart electronic device (ie, a mute value), such as the first predetermined value is 0, that is, the first setting module 700 may set the smart electronic device to a mute state.
第一设置模块700执行的触发智能电子设备执行录音操作以及将智能电子设备的当前音频播放音量设置为第一预定值的操作之间可以没有先后顺序的限定,如第一设置模块700可以同时执行两操作;再如第一设置模块700可以先执行录音操作,再执行第一预定值的设置操作;还有,第一设置模块700也可以先执行第一预定值的设置操作,再执行录音操作。The operation of the first setting module 700 to trigger the intelligent electronic device to perform the recording operation and the current audio playback volume of the smart electronic device to be set to the first predetermined value may be limited without prioritization, for example, the first setting module 700 may perform simultaneously If the first setting module 700 can perform the recording operation, the first predetermined value setting operation is performed; and the first setting module 700 can also perform the setting operation of the first predetermined value, and then perform the recording operation. .
第一设置模块700触发智能电子设备执行录音的操作可以通过调用智能电子设备操作系统中的录音函数来实现,本实施例不限制第一设置模块700触发智能电子设备执行录音操作的具体实现方式。The operation of the first setting module 700 to trigger the intelligent electronic device to perform the recording operation is implemented by calling the recording function in the operating system of the smart electronic device. This embodiment does not limit the specific implementation manner in which the first setting module 700 triggers the intelligent electronic device to perform the recording operation.
第一获取模块710除了与第一设置模块700连接之外,还与识别模块740连接。第一获取模块710主要适于在第一预定值情况下,获取通过录音获得的声音的音量值。The first acquisition module 710 is connected to the identification module 740 in addition to the first setting module 700. The first obtaining module 710 is mainly adapted to acquire a volume value of the sound obtained by the recording in the case of the first predetermined value.
具体的,在第一设置模块700触发智能电子设备执行录音操作后,第一获取模块710需要在智能电子设备的当前音频播放音量被设置为第一预定值的情况下,获取通过录音获得的声音的音量值。Specifically, after the first setting module 700 triggers the smart electronic device to perform the recording operation, the first obtaining module 710 needs to acquire the sound obtained by the recording if the current audio playing volume of the smart electronic device is set to the first predetermined value. The volume value.
第一获取模块710可以在触发智能电子设备执行录音操作并等待一定时间后,再获取通过录音获得的声音的音量值。一个具体的例子,在第一设置模块700先触发智能电子设备执行录音操作,再设置智能电子设备的当前音频播放音量的情况下,第一获取模块710可以在第一设置模块700将智能电子设备的当前音频播放音量设置为第一预定值,并等待第一预定时间间隔之后,再执行获取通过录音获得的声音的音量值的操作。The first obtaining module 710 may acquire the volume value of the sound obtained by the recording after the smart electronic device is triggered to perform the recording operation and wait for a certain time. In a specific example, in a case where the first setting module 700 first triggers the smart electronic device to perform a recording operation, and then sets the current audio playback volume of the smart electronic device, the first obtaining module 710 may use the smart device in the first setting module 700. The current audio playback volume is set to a first predetermined value, and after waiting for the first predetermined time interval, an operation of acquiring the volume value of the sound obtained by the recording is performed.
第一获取模块710可以采用定时获取的方式获得多个通过录音获得的声音的音量值,并对这多个音量值计算出平均值,该计算出的音量平均值主要用于后续识别模块740所执行的比较过程,该计算出的音量平均值可以被称为第一音量平均值。The first obtaining module 710 may obtain a plurality of volume values of the sound obtained by the recording by using a timing acquisition manner, and calculate an average value of the plurality of volume values, and the calculated volume average value is mainly used by the subsequent identification module 740. The calculated comparison process, the calculated volume average may be referred to as a first volume average.
在第一获取模块710计算出第一音量平均值时,识别模块740可以判断该第一音量平均值是否大于预定音量值(如1000),如果第一音量平均值大于预定音量值(如大于1000),则识别模块740可以确定出该外接设备不是设置有上述实施例一中的识别电路的外接设备,本次外接设备的识别过程结束;如果第
一音量平均值不大于预定值(如小于等于1000),则本实施例的装置应继续执行后续的步骤。When the first acquisition module 710 calculates the first volume average, the identification module 740 may determine whether the first volume average is greater than a predetermined volume value (eg, 1000), if the first volume average is greater than a predetermined volume value (eg, greater than 1000) The identification module 740 can determine that the external device is not an external device provided with the identification circuit in the first embodiment, and the identification process of the external device ends;
If the volume average is not greater than a predetermined value (e.g., less than or equal to 1000), the apparatus of the present embodiment should continue to perform the subsequent steps.
上述预定音量值(如1000)可以是根据经验预先设置于智能电子设备中的;另外,上述第一预定时间间隔可以是根据经验预先设置于智能电子设备中的,也可以是有目的性的针对智能电子设备的实际情况而动态设置于智能电子设备中的。The predetermined volume value (for example, 1000) may be preset in the smart electronic device according to experience; in addition, the first predetermined time interval may be preset in the smart electronic device according to experience, or may be purposeful The actual situation of the intelligent electronic device is dynamically set in the smart electronic device.
针对智能电子设备的实际情况动态设置第一预定时间间隔的一个具体例子为:设定智能电子设备的当前音频播放音量可以是用户通过按键等方式能够手动调整的音量,例如,智能电子设备中的可供用户通过按键等方式手动调整的音量被划分为15级(Andriod操作系统的智能移动电话具有15级可供用户手工调整的音量)这15级可以被分别称为音量0至音量14,其中的音量0表示静音;依照音量1至音量14的排列顺序,音量1至音量14各自对应的声音逐渐增大,且音量14对应的声音最大。在当前音频播放音量为上述情况下,第一预定时间间隔的具体设置过程包括:首先,在智能电子设备首次与本实施例的具有上述识别电路的外接设备通过耳机插头以及耳机插座连接的情况下,本装置可以针对该外接设备进行初始化设置操作,具体的,第一初始化模块在备份智能电子设备的当前音频播放音量后,将智能电子设备的当前音频播放音量设置为除静音之外的最小级音量(即上述音量1);然后,第一初始化模块触发电子设备执行播放本地存储的音频信号(如智能电子设备中内置的第二音乐)的操作,并开始计时;在等待一段时间(如500毫秒)后,第一初始化模块触发智能电子设备进行录音,之后,在等待一段时间(如300毫秒)后,第一初始化模块获取通过录音获得的声音的音量值(如获取操作系统返回的音量值),并判断该音量值是否大于预定值(如100)以及当前计时值是否达到预定时长(如2秒),如果获取的音量值不大于预定值且当前计时值没有达到预定时长,则第一初始化模块返回上述获取通过录音获得的声音的音量值以及针对音量值和当前计时值进行判断的步骤;如果音量值大于预定值或者当前计时值达到预定时长,则第一初始化模块将上述计时的当前计时值设置为第一预定时间间隔。A specific example of dynamically setting the first predetermined time interval for the actual situation of the smart electronic device is: setting the current audio playback volume of the smart electronic device may be a volume that the user can manually adjust by means of a button, etc., for example, in an intelligent electronic device. The volume that can be manually adjusted by the user through buttons or the like is divided into 15 levels (the intelligent mobile phone of the Andriod operating system has 15 levels of volume that can be manually adjusted by the user). The 15 levels can be referred to as volume 0 to volume 14, respectively. The volume 0 indicates silence; according to the order of volume 1 to volume 14, the sound corresponding to each of volume 1 to volume 14 gradually increases, and the volume corresponding to volume 14 is the loudest. In the case where the current audio playback volume is the above, the specific setting process of the first predetermined time interval includes: first, in the case that the smart electronic device is first connected to the external device having the above identification circuit of the present embodiment through the earphone plug and the earphone socket The device may perform an initial setting operation for the external device. Specifically, after the current audio playback volume of the intelligent electronic device is backed up, the first initialization module sets the current audio playback volume of the smart electronic device to a minimum level other than mute. Volume (ie, the above volume 1); then, the first initialization module triggers the electronic device to perform an operation of playing a locally stored audio signal (such as a second music built into the smart electronic device) and starts timing; waiting for a period of time (such as 500) After the millisecond, the first initialization module triggers the intelligent electronic device to record, and after waiting for a period of time (for example, 300 milliseconds), the first initialization module acquires the volume value of the sound obtained by the recording (for example, obtaining the volume value returned by the operating system) ), and determine whether the volume value is greater than a predetermined value (such as 100) to And whether the current timing value reaches a predetermined duration (for example, 2 seconds). If the acquired volume value is not greater than the predetermined value and the current timing value does not reach the predetermined duration, the first initialization module returns the volume value of the sound obtained by the recording and the The step of determining the volume value and the current timing value; if the volume value is greater than the predetermined value or the current timing value reaches the predetermined duration, the first initialization module sets the current timing value of the timing to the first predetermined time interval.
由上述具体的例子可知,本实施例的第一预定时间间隔的具体取值会被第一初始化模块设置为上述等待的时长与预定时长之间的一个数值,如第一预定时间间隔的最小取值为300毫秒,且其最大取值为2秒。It can be seen from the above specific example that the specific value of the first predetermined time interval in this embodiment is set by the first initialization module to a value between the waiting duration and the predetermined duration, such as the minimum of the first predetermined time interval. The value is 300 milliseconds and its maximum value is 2 seconds.
另外,在实际应用中,智能电子设备为用户提供的通过按键等方式能够手动调整的音量也许更多或者更少,为了适应不同类型的智能电子设备,本实施例中的智能电子设备的当前音频播放音量可以不是用户通过按键等能够手动调整的音量,一个具体的例子,第一初始化模块将智能电子设备的最大播放音
量划分为15级,如计算最大播放音量/15,第一初始化模块根据上述划分后的各级的音量值来设置智能电子设备的当前音频播放音量。In addition, in actual applications, the volume that the smart electronic device can provide for the user to manually adjust by means of a button or the like may be more or less. In order to adapt to different types of smart electronic devices, the current audio of the smart electronic device in this embodiment The playback volume may not be the volume that the user can manually adjust by pressing a button, etc., a specific example, the first initialization module will maximize the playback sound of the intelligent electronic device.
The quantity is divided into 15 levels. If the maximum playback volume / 15 is calculated, the first initialization module sets the current audio playback volume of the intelligent electronic device according to the volume values of the divided levels.
第二设置模块720与第二获取模块730连接。第二设置模块720主要适于将智能电子设备的当前音频播放音量设置为第二预定值。The second setting module 720 is connected to the second obtaining module 730. The second setting module 720 is mainly adapted to set the current audio playback volume of the intelligent electronic device to a second predetermined value.
具体的,在针对第一预定值第一获取模块710成功获取了通过录音获得的声音的音量值之后,第二设置模块720将智能电子设备的当前音频播放音量调整设置为第二预定值,且第二预定值大于第一预定值。Specifically, after the first acquisition module 710 successfully acquires the volume value of the sound obtained by the recording for the first predetermined value, the second setting module 720 sets the current audio playback volume adjustment of the smart electronic device to a second predetermined value, and The second predetermined value is greater than the first predetermined value.
上述第二预定值可以是根据经验预先设置于智能电子设备中的,也可以是有目的性的针对智能电子设备的实际情况而动态设置于智能电子设备中的。The second predetermined value may be preset in the smart electronic device according to experience, or may be dynamically set in the smart electronic device for the purpose of the smart electronic device.
针对智能电子设备的实际情况而动态设置第二预定值的一个具体例子为:设定第一预定值为0(即智能电子设备处于静音状态),第三初始化模块将智能电子设备的当前音频播放音量设置为第一预定值,第三初始化模块定时获取通过录音获得的声音的音量值(如获取操作系统返回的音量值),并针对获取到的多个音量值(如10个音量值)计算平均值(记为第一平均值);第三初始化模块触发智能电子设备播放本地预先存储的音频信号(如播放第一音乐),并将智能电子设备的当前音频播放音量设置为音量1(如除静音之外的最小级音量);然后,第三初始化模块定时获取通过录音获得的声音的音量值(如获取操作系统返回的音量值),并针对获取到的多个音量值(如10个音量值)计算平均值(记为第二平均值),之后,第三初始化模块判断第二平均值是否为第一平均值的预定倍数(该预定倍数应大于7倍,如可以采用9倍),如果第二平均值没有达到第一平均值的预定倍数,则第三初始化模块将智能电子设备的当前音频播放音量设置为音量2,并返回到定时获取通过录音获得的声音的音量值并针对获取到的多个音量值计算平均值(记为第二平均值)以及判断倍数的步骤;如果第二平均值达到第一平均值的预定倍数,则第三初始化模块将智能电子设备的当前音频播放音量确定为第二预定值。A specific example of dynamically setting a second predetermined value for the actual situation of the intelligent electronic device is: setting a first predetermined value to 0 (ie, the smart electronic device is in a mute state), and the third initialization module plays the current audio of the smart electronic device. The volume is set to a first predetermined value, and the third initialization module periodically acquires the volume value of the sound obtained by the recording (such as obtaining the volume value returned by the operating system), and calculates for the obtained multiple volume values (such as 10 volume values). The average value (recorded as the first average value); the third initialization module triggers the intelligent electronic device to play the local pre-stored audio signal (such as playing the first music), and sets the current audio playback volume of the smart electronic device to the volume 1 (eg, The minimum level of sound other than mute); then, the third initialization module periodically acquires the volume value of the sound obtained by the recording (such as obtaining the volume value returned by the operating system), and for the obtained multiple volume values (such as 10) The volume value is calculated as an average value (recorded as a second average value), after which the third initialization module determines whether the second average value is a predetermined multiple of the first average value. (The predetermined multiple should be greater than 7 times, if 9 times can be used), if the second average does not reach a predetermined multiple of the first average, the third initialization module sets the current audio playback volume of the smart electronic device to volume 2, And returning to the step of regularly obtaining the volume value of the sound obtained by the recording and calculating an average value (recorded as the second average value) for the obtained plurality of volume values and judging the multiple; if the second average value reaches the first average value When the multiple is predetermined, the third initialization module determines the current audio playback volume of the smart electronic device as a second predetermined value.
第二获取模块730除了与第二设置模块720连接之外,还与识别模块740连接。第二获取模块730主要适于播放预定音频信号,并在第二预定值情况下,获取通过录音获得的声音的音量值。The second acquisition module 730 is connected to the identification module 740 in addition to the second setting module 720. The second acquisition module 730 is mainly adapted to play a predetermined audio signal, and in the case of the second predetermined value, acquire a volume value of the sound obtained by the recording.
具体的,第二获取模块730需要在智能电子设备的当前音频播放音量被第二设置模块720调整设置为第二预定值的情况下,获取通过录音获得的声音的音量值。Specifically, the second obtaining module 730 needs to acquire the volume value of the sound obtained by the recording if the current audio playback volume of the smart electronic device is adjusted to the second predetermined value by the second setting module 720.
第二获取模块730可以在智能电子设备播放本地存储的预定音频信号(如智能电子设备中内置的第一音乐),且等待第二预定时间间隔后,执行获取通过录音获得的声音的音量值的操作。
The second obtaining module 730 can play a locally stored predetermined audio signal (such as the first music built in the smart electronic device) on the smart electronic device, and after waiting for the second predetermined time interval, perform the volume value of acquiring the sound obtained by the recording. operating.
第二获取模块730可以采用定时获取的方式获得多个通过录音获得的声音的音量值(如10个音量值),并对获取到的多个音量值计算出平均值(记为第二平均值),第二获取模块730计算出的音量平均值用于后续识别模块740的比较过程。The second obtaining module 730 can obtain a plurality of volume values (such as 10 volume values) of the sound obtained by the recording in a manner of timing acquisition, and calculate an average value (recorded as a second average value) for the obtained plurality of volume values. The average value of the volume calculated by the second acquisition module 730 is used for the comparison process of the subsequent identification module 740.
上述第二预定时间间隔是预先设置在智能电子设备中的,且该第二预定时间间隔可以是根据经验预先设置于智能电子设备中的,也可以是有目的性的针对智能电子设备的实际情况而动态设置于智能电子设备中的。The second predetermined time interval is preset in the smart electronic device, and the second predetermined time interval may be pre-set in the smart electronic device according to experience, or may be a purposeful situation for the smart electronic device. And dynamically set in the smart electronic device.
针对智能电子设备的实际情况动态设置第二预定时间间隔的一个具体例子为:在本实施例的装置针对该外接设备进行初始化设置操作的过程中,在第一初始化模块设置了第一预定时间间隔之后,第二初始化模块触发智能电子设备播放预先设置的音频信号(如智能电子设备中内置的第一音乐),并开始计时,在等待一段时间(如等待200毫秒)后,第二初始化模块获取通过录音获得的声音的音量值(如获取操作系统返回的音量值),并判断该音量值是否大于预定值(如100)以及当前计时值是否达到另一预定时长(如1秒),如果第二初始化模块获取的音量值不大于预定值且当前计时值没有达到另一预定时长,则第二初始化模块返回上述获取通过录音获得的声音的音量值以及针对音量值和当前计时值进行判断的步骤;如果音量值大于预定值或者当前计时值达到另一预定时长,则第二初始化模块将上述计时的当前计时值设置为第二预定时间间隔。A specific example of dynamically setting the second predetermined time interval for the actual situation of the intelligent electronic device is: in the process of performing the initial setting operation for the external device by the device of the embodiment, the first predetermined time interval is set in the first initialization module. Afterwards, the second initialization module triggers the intelligent electronic device to play a preset audio signal (such as the first music built in the smart electronic device), and starts timing. After waiting for a period of time (such as waiting 200 milliseconds), the second initialization module acquires The volume value of the sound obtained by recording (such as obtaining the volume value returned by the operating system), and determining whether the volume value is greater than a predetermined value (such as 100) and whether the current timing value reaches another predetermined duration (such as 1 second), if The second initialization module returns the volume value of the sound obtained by the recording and the step of determining the volume value and the current timing value. If the volume value is greater than the predetermined value or the current timing value reaches another predetermined Length, the second initialization module current timing value of the timer is set to a second predetermined time interval.
由上述具体的例子可知,本实施例的第二预定时间间隔的具体取值会被第二初始化模块设置为上述等待的时长与另一预定时长之间的一个数值,如第二预定时间间隔的最小取值为200毫秒,且其最大取值为1秒。It can be seen from the above specific example that the specific value of the second predetermined time interval in this embodiment is set by the second initialization module to a value between the waiting duration and another predetermined duration, such as the second predetermined time interval. The minimum value is 200 milliseconds and its maximum value is 1 second.
识别模块740主要适于根据针对第一预定值获取的音量值与针对第二预定值获取的音量值之间的比较确定外接设备是否为设置有实施例一中所记载的识别电路的外接设备。The identification module 740 is mainly adapted to determine whether the external device is an external device provided with the identification circuit described in the first embodiment, based on a comparison between the volume value acquired for the first predetermined value and the volume value acquired for the second predetermined value.
具体的,识别模块740可以判断第二获取模块730针对第二预定值计算出的音量值的平均值(即上述第二平均值)是否达到第一获取模块710针对第一预定值计算出的音量值的平均值(即上述第一平均值)的另一预定倍数(如7倍);如果第二平均值达到第一平均值的7倍,则识别模块740确定出该外接设备为设置有上述实施例一记载的识别电路的外接设备;如果第二平均值没有达到第一平均值的7倍,则识别模块740确定出该外接设备不为设置有上述实施例一记载的识别电路的外接设备。Specifically, the identification module 740 can determine whether the average value of the volume value calculated by the second obtaining module 730 for the second predetermined value (ie, the second average value) reaches the volume calculated by the first acquiring module 710 for the first predetermined value. Another predetermined multiple of the value (ie, the first average value described above) (eg, 7 times); if the second average value reaches 7 times the first average value, the identification module 740 determines that the external device is configured with the above The external device of the identification circuit of the first embodiment; if the second average value does not reach 7 times of the first average value, the identification module 740 determines that the external device is not the external device provided with the identification circuit described in the first embodiment. .
本装置对外接设备的识别过程的整个过程的用时通常不超过2秒。在智能电子设备处于静音的情况下,智能电子设备录制到的音源输入是比较低且比较
平稳的声音,而在将智能电子设备设置为非静音的情况下,在有音乐播放时,智能电子设备录制到的音源输入的音量会突然变大;经过多次试验验证,两个阶段获取的音量平均值的比值超过7倍;现有的耳机在智能电子设备处于静音的情况下,智能电子设备接收到的音源输入的音量通常都比较平稳,经过多次试验验证,两个阶段获取的音量平均值的比值不超过6倍;因此,本装置通过判断不同情况下的音量平均值的比值即可以准确判断出智能电子设备的外接设备是设置有上述识别电路的外接设备,还是其他设备如普通的耳机等外接设备。The entire process of the identification process of the external device of the device usually takes less than 2 seconds. When the smart electronic device is muted, the input of the audio source recorded by the intelligent electronic device is relatively low and compared.
Smooth sound, while the smart electronic device is set to be non-silent, when the music is played, the volume of the audio input recorded by the intelligent electronic device suddenly becomes large; after several trials and verifications, the two stages are obtained. The ratio of the average value of the volume exceeds 7 times; the existing earphones in the case where the smart electronic device is muted, the volume of the input of the sound source received by the intelligent electronic device is generally relatively stable, and after several trials and verifications, the volume obtained in two stages is obtained. The ratio of the average value does not exceed 6 times; therefore, the device can accurately determine whether the external device of the intelligent electronic device is an external device provided with the above identification circuit by judging the ratio of the average value of the volume under different conditions, or other devices such as ordinary External devices such as headphones.
另外,需要说明的是,识别模块740在识别出外接设备是设置有上述实施例一所记载的识别电路的外接设备的情况下,应将插入的外接设备是无效耳机的信息传输给智能电子设备中的相关部分,如识别模块740通知操作系统或者通知与语音操作相关的应用等;这样,在操作系统或者相关应用在执行与语音相关的操作(如接听电话等)时,可以获知当前通过耳机插座与智能电子设备连接的外接设备不是耳机,从而会进行切换至智能电子设备的内置话筒的操作,而不再使用耳机话筒。由于在上述实施例一中的开关E1处于断开状态时,智能电子设备输出的音频信号通过内置话筒播放,而不会在通过耳机插座、耳机插头传输至录音回路,并通过录音回路、耳机插头以及耳机插座回传至麦克风,因此,设置有上述实施例一所记载的识别电路的外接设备不会对智能电子设备的正常通话等操作产生影响。In addition, it should be noted that, when the identification module 740 recognizes that the external device is an external device provided with the identification circuit described in the first embodiment, the information that the inserted external device is an invalid earphone should be transmitted to the intelligent electronic device. The relevant part in the process, such as the identification module 740 notifying the operating system or notifying the application related to the voice operation, etc.; thus, when the operating system or related application performs the voice-related operation (such as answering a call, etc.), the current through the earphone can be known. The external device that connects the socket to the smart electronic device is not a headset, so it switches to the built-in microphone of the smart electronic device instead of the headset microphone. Since the switch E1 in the first embodiment is in the off state, the audio signal output by the smart electronic device is played through the built-in microphone, and is not transmitted to the recording circuit through the earphone socket or the earphone plug, and passes through the recording circuit and the earphone plug. And the earphone socket is returned to the microphone. Therefore, the external device provided with the identification circuit described in the first embodiment does not affect the operation such as the normal call of the smart electronic device.
图9中,基于耳机插座的外接设备识别系统主要包括:外接设备800以及智能电子设备810;其中,外接设备800中设置有上述实施例一所记载的基于耳机插座的外接设备识别电路,智能电子设备810中设置有上述实施例三所记载的基于耳机插座的外接设备识别装置,且外接设备800通过耳机插头与智能电子设备连接。In FIG. 9, the external device identification system based on the earphone socket mainly includes: an external device 800 and an intelligent electronic device 810; wherein the external device 800 is provided with the external device identification circuit based on the earphone socket described in the first embodiment, and the intelligent electronic device The device 810 is provided with the external device identification device based on the earphone socket described in the third embodiment, and the external device 800 is connected to the intelligent electronic device through the earphone plug.
外接设备800中的识别电路的具体结构如上述实施例一中的记载,智能电子设备810中的识别装置的结构如上述实施例二中的记载,识别装置所执行的操作可以参见上述实施例二和实施例三中的记载,在此不再重复说明。The specific structure of the identification circuit in the external device 800 is as described in the first embodiment. The structure of the identification device in the smart electronic device 810 is as described in the second embodiment. For the operation performed by the identification device, refer to the second embodiment. The description in the third embodiment will not be repeated here.
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general purpose systems can also be used with the teaching based on the teachings herein. The structure required to construct such a system is apparent from the above description. Moreover, the invention is not directed to any particular programming language. It is to be understood that the invention may be embodied in a variety of programming language, and the description of the specific language has been described above in order to disclose the preferred embodiments of the invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实
施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art will appreciate that the modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment. Can be practical
Modules or units or components in the embodiments are combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components. In addition to such features and/or at least some of the processes or units being mutually exclusive, any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined. Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。如在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features that are included in other embodiments and not in other features, combinations of features of different embodiments are intended to be within the scope of the present invention. Different embodiments are formed and formed. Any of the claimed embodiments can be used in any combination, as in the following claims.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的基于耳机插座的外接设备识别装置以及基于耳机插座的外接设备识别系统中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(如计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement the earphone socket-based external device identification device and the earphone socket-based external device identification system according to an embodiment of the present invention. Some or all of the features of some or all of the components. The invention can also be implemented as a device or device program (such as a computer program and a computer program product) for performing some or all of the methods described herein. Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
例如,图10示出了可以实现本发明的基于耳机插座的外接设备识别方法的电子设备。该电子设备传统上包括处理器1210和以存储器1220形式的计算机程序产品或者计算机可读介质。存储器1220可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器1220具有用于执行上述方法中的任何方法步骤的程序代码1231的存储空间1230。例如,用于程序代码的存储空间1230可以包括分别用于实现上面的方法中的各种步骤的各个程序代码1231。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图11所述的便携式或者固定存储单元。该存储单元可以具有与图10的电子设备中的存储器1220类似布置的存储段或者存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括用于执行根据本发明的方法步骤的程序1231’,即可以由例如诸如1210之类的处理器读取的代码,这些代码当由电子设备运行时,导致该电子设备执行上面所描述的方
法中的各个步骤。For example, FIG. 10 shows an electronic device in which the earphone socket-based external device identification method of the present invention can be implemented. The electronic device conventionally includes a processor 1210 and a computer program product or computer readable medium in the form of a memory 1220. The memory 1220 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM. Memory 1220 has a memory space 1230 for program code 1231 for performing any of the method steps described above. For example, storage space 1230 for program code may include various program codes 1231 for implementing various steps in the above methods, respectively. The program code can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG. The storage unit may have a storage section or a storage space or the like arranged similarly to the storage 1220 in the electronic device of FIG. The program code can be compressed, for example, in an appropriate form. In general, the storage unit comprises a program 1231' for performing the steps of the method according to the invention, ie a code readable by a processor such as 1210, which when executed by the electronic device causes the electronic device to perform the above The party described
The various steps in the law.
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。"an embodiment," or "an embodiment," or "an embodiment," In addition, it is noted that the phrase "in one embodiment" is not necessarily referring to the same embodiment.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下被实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that the embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of the description.
应该注意的是,上述实施例对本发明进行的详细说明并不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”或“包括”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-described embodiments are not intended to limit the invention, and that alternative embodiments may be devised without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as a limitation. The word "comprising" or "comprising" does not exclude the presence of the elements or the steps in the claims. The word "a" or "an" The invention can be implemented by means of hardware comprising several distinct elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by the same hardware item. The use of the words first, second, and third does not indicate any order. These words can be interpreted as names.
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。
In addition, it should be noted that the language used in the specification has been selected for the purpose of readability and teaching, and is not intended to be construed or limited. Therefore, many modifications and changes will be apparent to those skilled in the art without departing from the scope of the invention. The disclosure of the present invention is intended to be illustrative, and not restrictive, and the scope of the invention is defined by the appended claims.
Claims (32)
- 一种基于耳机插座的外接设备识别电路,其包括:耳机插头以及录音回路;An external device identification circuit based on a headphone socket, comprising: a headphone plug and a recording circuit;所述耳机插头具有声道连接端、麦克风连接端以及接地端;The earphone plug has a channel connection end, a microphone connection end and a ground end;所述录音回路具有第一连接端、第二连接端和第三连接端;The recording circuit has a first connecting end, a second connecting end and a third connecting end;其中,所述第一连接端与所述声道连接端连接,所述第二连接端与所述麦克风连接端连接,所述第三连接端与所述接地端连接;The first connection end is connected to the channel connection end, the second connection end is connected to the microphone connection end, and the third connection end is connected to the ground connection end;所述录音回路通过所述耳机插头以及智能电子设备中的耳机插座与智能电子设备中的麦克风连接,且所述录音回路与耳机插头、耳机插座以及所述麦克风一起形成话筒电路。The recording circuit is connected to a microphone in the smart electronic device through the earphone plug and a headphone jack in the smart electronic device, and the recording circuit forms a microphone circuit together with the earphone plug, the earphone socket and the microphone.
- 如权利要求1所述的电路,其中,所述话筒电路包括:电容话筒电路。The circuit of claim 1 wherein said microphone circuit comprises: a condenser microphone circuit.
- 如权利要求2所述的电路,其中,所述录音回路包括:第一电容、第一电阻和第二电阻;The circuit of claim 2 wherein said recording circuit comprises: a first capacitor, a first resistor, and a second resistor;所述第一电容的一端为所述第一连接端,另一端与所述第一电阻和第二电阻分别连接,且所述第一电容与第一电阻和第二电阻分别串联;One end of the first capacitor is the first connection end, the other end is respectively connected to the first resistor and the second resistor, and the first capacitor is connected in series with the first resistor and the second resistor respectively;所述第一电阻的一端为所述第二连接端,另一端与所述第一电容连接;One end of the first resistor is the second connection end, and the other end is connected to the first capacitor;所述第二电阻的一端为所述第三连接端,另一端与所述第一电容连接;One end of the second resistor is the third connection end, and the other end is connected to the first capacitor;所述第一电阻和第二电阻并联。The first resistor and the second resistor are connected in parallel.
- 如权利要求2所述的电路,其中,所述录音回路包括:第三电阻、第三电容和第四电容;The circuit of claim 2, wherein the recording circuit comprises: a third resistor, a third capacitor, and a fourth capacitor;所述第三电阻的一端为所述第一连接端,另一端与所述第三电容和第四电容分别连接,且所述第一电阻与第三电容和第四电容分别串联;One end of the third resistor is the first connection end, the other end is respectively connected to the third capacitor and the fourth capacitor, and the first resistor is connected in series with the third capacitor and the fourth capacitor respectively;所述第三电容的一端为所述第二连接端,另一端与所述第三电阻连接;One end of the third capacitor is the second connection end, and the other end is connected to the third resistor;所述第四电容的一端为所述第三连接端,另一端与所述第三电阻连接;One end of the fourth capacitor is the third connection end, and the other end is connected to the third resistor;所述第三电容和第四电容并联。The third capacitor and the fourth capacitor are connected in parallel.
- 如权利要求2所述的电路,其中,所述录音回路包括:第四电阻、第五电阻和第六电阻;The circuit of claim 2, wherein the recording circuit comprises: a fourth resistor, a fifth resistor, and a sixth resistor;所述第四电容的一端为所述第一连接端,另一端与所述第五电阻和第六电阻分别连接,且所述第四电阻与第五电阻和第六电阻分别串联;One end of the fourth capacitor is the first connection end, the other end is respectively connected to the fifth resistor and the sixth resistor, and the fourth resistor is connected in series with the fifth resistor and the sixth resistor respectively;所述第五电阻的一端为所述第二连接端,另一端与所述第六电阻连接;One end of the fifth resistor is the second connection end, and the other end is connected to the sixth resistor;所述第六电阻的一端为所述第三连接端,另一端与所述第五电阻连接;One end of the sixth resistor is the third connection end, and the other end is connected to the fifth resistor;所述第五电阻和第六电阻并联。The fifth resistor and the sixth resistor are connected in parallel.
- 如权利要求1至5中任一所述的电路,其中,所述录音回路还包括:开关,且所述开关串接在第二连接端和第三连接端之间。 The circuit of any one of claims 1 to 5, wherein the recording circuit further comprises: a switch, and the switch is connected in series between the second connection end and the third connection end.
- 如权利要求1至5中任一权利要求所述的电路,其中,所述声道连接端包括:左声道连接端和右声道连接端,且所述第一连接端与所述左声道连接端和/或右声道连接端连接。The circuit according to any one of claims 1 to 5, wherein said channel connection end comprises: a left channel connection end and a right channel connection end, and said first connection end and said left sound end The channel connection and/or the right channel connection are connected.
- 一种基于耳机插座的外接设备识别方法,其包括:A method for identifying an external device based on a headphone jack, comprising:在监测到智能电子设备的耳机插座插入外接设备后,触发智能电子设备录音,并将所述智能电子设备的当前音频播放音量设置为第一预定值;After detecting that the earphone socket of the smart electronic device is inserted into the external device, triggering the recording of the smart electronic device, and setting the current audio playback volume of the smart electronic device to a first predetermined value;在所述第一预定值情况下,获取通过录音获得的声音的音量值;Obtaining a volume value of the sound obtained by the recording in the case of the first predetermined value;将所述智能电子设备的当前音频播放音量设置为第二预定值;Setting a current audio playback volume of the smart electronic device to a second predetermined value;播放预定音频信号,并在所述第二预定值情况下,获取通过录音获得的声音的音量值;Playing a predetermined audio signal, and in the case of the second predetermined value, acquiring a volume value of the sound obtained by the recording;根据针对第一预定值获取的音量值与针对第二预定值获取的音量值之间的比较确定所述外接设备是否为设置有录音回路和耳机插头的外接设备,且所述录音回路与所述耳机插头以及所述智能电子设备的耳机插座和麦克风一起形成话筒电路。Determining whether the external device is an external device provided with a recording loop and a headphone plug according to a comparison between a volume value acquired for the first predetermined value and a volume value acquired for the second predetermined value, and the recording loop and the The earphone plug and the headphone jack of the smart electronic device together with the microphone form a microphone circuit.
- 如权利要求8所述的方法,其中,所述将所述智能电子设备的当前音频播放音量设置为第一预定值包括:The method of claim 8, wherein the setting the current audio playback volume of the intelligent electronic device to a first predetermined value comprises:获取智能电子设备的当前音频播放音量并存储,然后,将所述智能电子设备的当前音频播放音量设置为第一预定值;Obtaining a current audio playback volume of the smart electronic device and storing, and then setting a current audio playback volume of the smart electronic device to a first predetermined value;且所述方法还包括:And the method further includes:在识别外接设备后,将所述智能电子设备的当前音频播放音量设置为所述存储的当前音频播放音量。After identifying the external device, the current audio playback volume of the smart electronic device is set to the stored current audio playback volume.
- 如权利要求8所述的方法,其中,所述在所述第一预定值情况下,获取通过录音获得的声音的音量值包括:The method of claim 8, wherein in the case of the first predetermined value, obtaining a volume value of the sound obtained by the recording comprises:在将所述智能电子设备的当前音频播放音量设置为第一预定值,且等待第一预定时间间隔后,获取通过录音获得的声音的音量值。After the current audio playback volume of the smart electronic device is set to a first predetermined value, and after waiting for the first predetermined time interval, the volume value of the sound obtained by the recording is acquired.
- 如权利要求10所述的方法,其中,该第一预定时间间隔通过下述方式设置:The method of claim 10 wherein the first predetermined time interval is set by:将所述智能电子设备的当前音频播放音量设置为除静音之外的最小级音量值;Setting a current audio playback volume of the smart electronic device to a minimum volume value other than mute;播放音频信号,触发智能电子设备录音,并开始计时;Play an audio signal, trigger the recording of the intelligent electronic device, and start timing;监测通过录音获得的声音的音量值,在所述监测到的音量值大于预定音量值的情况下,将当前计时值作为所述第一预定时间间隔。The volume value of the sound obtained by the recording is monitored, and in the case where the monitored volume value is greater than the predetermined volume value, the current timing value is taken as the first predetermined time interval.
- 如B权利要求8所述的方法,其中,所述在所述第二预定值情况下,获取通过录音获得的声音的音量值包括: The method of claim 8, wherein, in the case of the second predetermined value, obtaining a volume value of the sound obtained by the recording comprises:在播放预定音频信号,且等待第二预定时间间隔后,获取通过录音获得的声音的音量值。After the predetermined audio signal is played and waits for the second predetermined time interval, the volume value of the sound obtained by the recording is acquired.
- 如权利要求12所述的方法,其中,该第二预定时间间隔通过下述方式设置:The method of claim 12 wherein the second predetermined time interval is set by:将所述智能电子设备的当前音频播放音量设置为除静音之外的最小级音量值;Setting a current audio playback volume of the smart electronic device to a minimum volume value other than mute;播放所述预定音频信号,触发智能电子设备录音,并开始计时;Playing the predetermined audio signal, triggering recording of the intelligent electronic device, and starting timing;监测通过录音获得的声音的音量值,在所述监测到的音量值大于预定音量值的情况下,将当前计时值作为所述第二预定时间间隔。The volume value of the sound obtained by the recording is monitored, and in the case where the monitored volume value is greater than the predetermined volume value, the current timing value is taken as the second predetermined time interval.
- 如权利要求8至13中任一所述的方法,其中,所述获取通过录音获得的声音的音量值包括:The method according to any one of claims 8 to 13, wherein the obtaining the volume value of the sound obtained by the recording comprises:定时获取智能电子设备的操作系统返回的音量值,并针对获取到的预定数量的音量值计算平均值。The volume value returned by the operating system of the intelligent electronic device is periodically acquired, and an average value is calculated for the obtained predetermined number of volume values.
- 如权利要求14所述的方法,其中,所述根据针对第一预定值获取的音量值与针对第二预定值获取的音量值之间的比较确定所述外接设备是否为设置有录音回路和耳机插头的外接设备包括:The method of claim 14, wherein the determining whether the external device is provided with a recording loop and an earphone according to a comparison between a volume value acquired for the first predetermined value and a volume value acquired for the second predetermined value The external devices of the plug include:判断针对第二预定值计算出的音量值的平均值是否达到针对第一预定值计算出的音量值的平均值的七倍;Determining whether an average value of the volume values calculated for the second predetermined value reaches seven times an average value of the volume values calculated for the first predetermined value;如果达到七倍,则确定所述外接设备为设置有所述识别电路的外接设备;If it is seven times, it is determined that the external device is an external device provided with the identification circuit;如果没有达到七倍,则确定所述外接设备不为设置有所述识别电路的外接设备。If it is not seven times, it is determined that the external device is not an external device provided with the identification circuit.
- 如权利要求15所述的方法,其中,所述第一预定值为0,且所述第二预定值通过下述方式设置:The method of claim 15 wherein said first predetermined value is zero and said second predetermined value is set by:将所述智能电子设备的当前音频播放音量设置为第一预定值,获取通过录音获得的声音的音量值,并针对获取到的预定数量的音量值计算平均值;Setting a current audio playback volume of the smart electronic device to a first predetermined value, acquiring a volume value of the sound obtained by the recording, and calculating an average value for the acquired predetermined number of volume values;播放预定音频信号;Playing a predetermined audio signal;将当前音频播放音量调整为下一级音量值,获取通过录音获得的声音的音量值,并针对获取到的预定数量的音量值计算平均值;Adjusting the current audio playback volume to the next-level volume value, obtaining the volume value of the sound obtained by the recording, and calculating an average value for the obtained predetermined number of volume values;判断针对调整后的当前音频播放音量计算出的音量值的平均值是否达到针对第一预定值计算出的音量值的平均值的预定倍数,其中,所述预定倍数大于七倍;Determining whether an average value of the volume values calculated for the adjusted current audio playback volume reaches a predetermined multiple of an average value of the volume values calculated for the first predetermined value, wherein the predetermined multiple is greater than seven times;如果达到预定倍数,则将所述调整后的当前音频播放音量作为所述第二预定值;If the predetermined multiple is reached, the adjusted current audio playback volume is taken as the second predetermined value;如果没有达到预定倍数,则返回到所述将当前音频播放音量调整为下一级 音量值的步骤。If the predetermined multiple is not reached, return to the current audio playback volume to adjust to the next level The step of the volume value.
- 如权利要求15所述的方法,其中,所述方法还包括:The method of claim 15 wherein the method further comprises:在确定出针对第一预定值计算出的音量值的平均值超过预定阈值的情况下,确定所述外接设备不为设置有所述识别电路的外接设备。In a case where it is determined that the average value of the volume values calculated for the first predetermined value exceeds a predetermined threshold, it is determined that the external device is not an external device provided with the identification circuit.
- 如权利要求8所述的方法,其中,所述外接设备为设置有A1-A7中任一所述的识别电路的外接设备。The method according to claim 8, wherein said external device is an external device provided with the identification circuit of any one of A1 to A7.
- 一种基于耳机插座的外接设备识别装置,其包括:An external device identification device based on a headphone jack, comprising:第一设置模块,适于在监测到智能电子设备的耳机插座插入外接设备后,触发智能电子设备录音,并将所述智能电子设备的当前音频播放音量设置为第一预定值;The first setting module is configured to trigger the recording of the smart electronic device after the earphone socket of the smart electronic device is inserted into the external device, and set the current audio playback volume of the smart electronic device to a first predetermined value;第一获取模块,适于在所述第一预定值情况下,获取通过录音获得的声音的音量值;a first acquiring module, configured to acquire a volume value of the sound obtained by the recording in the case of the first predetermined value;第二设置模块,适于将所述智能电子设备的当前音频播放音量设置为第二预定值;a second setting module, configured to set a current audio playback volume of the smart electronic device to a second predetermined value;第二获取模块,适于播放预定音频信号,并在所述第二预定值情况下,获取通过录音获得的声音的音量值;a second acquiring module, configured to play a predetermined audio signal, and obtain, in the case of the second predetermined value, a volume value of the sound obtained by the recording;识别模块,适于根据针对第一预定值获取的音量值与针对第二预定值获取的音量值之间的比较确定所述外接设备是否为设置有录音回路和耳机插头的外接设备,且所述录音回路与所述耳机插头以及所述智能电子设备的耳机插座和麦克风一起形成话筒电路。An identification module, configured to determine, according to a comparison between a volume value acquired for the first predetermined value and a volume value acquired for the second predetermined value, whether the external device is an external device provided with a recording loop and a headphone plug, and A recording circuit forms a microphone circuit with the earphone plug and the earphone jack and microphone of the smart electronic device.
- 如权利要求19所述的装置,其中,所述将所述智能电子设备的当前音频播放音量设置为第一预定值包括:The apparatus of claim 19, wherein the setting the current audio playback volume of the intelligent electronic device to a first predetermined value comprises:获取智能电子设备的当前音频播放音量并存储,然后,将所述智能电子设备的当前音频播放音量设置为第一预定值;Obtaining a current audio playback volume of the smart electronic device and storing, and then setting a current audio playback volume of the smart electronic device to a first predetermined value;且所述识别模块还适于:And the identification module is further adapted to:在识别外接设备后,将所述智能电子设备的当前音频播放音量设置为所述存储的当前音频播放音量。After identifying the external device, the current audio playback volume of the smart electronic device is set to the stored current audio playback volume.
- 如权利要求19所述的装置,其中,所述在所述第一预定值情况下,获取通过录音获得的声音的音量值包括:The apparatus according to claim 19, wherein said obtaining a volume value of the sound obtained by the recording in the case of said first predetermined value comprises:在将所述智能电子设备的当前音频播放音量设置为第一预定值,且等待第一预定时间间隔后,获取通过录音获得的声音的音量值。After the current audio playback volume of the smart electronic device is set to a first predetermined value, and after waiting for the first predetermined time interval, the volume value of the sound obtained by the recording is acquired.
- 如权利要求21所述的装置,其中,所述装置还包括:The device of claim 21, wherein the device further comprises:第一初始化模块,适于将所述智能电子设备的当前音频播放音量设置为除静音之外的最小级音量值;播放音频信号,触发智能电子设备录音,并开始计 时;监测通过录音获得的声音的音量值,在所述监测到的音量值大于预定音量值的情况下,将当前计时值作为所述第一预定时间间隔。a first initialization module, configured to set a current audio playback volume of the smart electronic device to a minimum volume value other than mute; play an audio signal, trigger an intelligent electronic device to record, and start counting And monitoring a volume value of the sound obtained by the recording, in a case where the monitored volume value is greater than a predetermined volume value, using the current timing value as the first predetermined time interval.
- 如权利要求19所述的装置,其中,所述在所述第二预定值情况下,获取通过录音获得的声音的音量值包括:The apparatus according to claim 19, wherein said obtaining a volume value of the sound obtained by the recording in the case of said second predetermined value comprises:在播放预定音频信号,且等待第二预定时间间隔后,获取通过录音获得的声音的音量值。After the predetermined audio signal is played and waits for the second predetermined time interval, the volume value of the sound obtained by the recording is acquired.
- 如权利要求23所述的装置,其中,所述装置还包括:The device of claim 23, wherein the device further comprises:第二初始化模块,适于将所述智能电子设备的当前音频播放音量设置为除静音之外的最小级音量值;播放所述预定音频信号,触发智能电子设备录音,并开始计时;监测通过录音获得的声音的音量值,在所述监测到的音量值大于预定音量值的情况下,将当前计时值作为所述第二预定时间间隔。a second initialization module, configured to set a current audio playback volume of the smart electronic device to a minimum volume value other than mute; play the predetermined audio signal, trigger an intelligent electronic device to record, and start timing; monitoring by recording The volume value of the obtained sound, in the case where the monitored volume value is greater than the predetermined volume value, the current timing value is taken as the second predetermined time interval.
- 如权利要求19至24中任一所述的装置,其中,所述获取通过录音获得的声音的音量值包括:The apparatus according to any one of claims 19 to 24, wherein said obtaining a volume value of the sound obtained by the recording comprises:定时获取智能电子设备的操作系统返回的音量值,并针对获取到的预定数量的音量值计算平均值。The volume value returned by the operating system of the intelligent electronic device is periodically acquired, and an average value is calculated for the obtained predetermined number of volume values.
- 如权利要求25所述的装置,其中,所述根据针对第一预定值获取的音量值与针对第二预定值获取的音量值之间的比较确定所述外接设备是否为设置有录音回路和耳机插头的外接设备包括:The apparatus according to claim 25, wherein said determining whether said external device is provided with a recording circuit and an earphone according to a comparison between a volume value acquired for the first predetermined value and a volume value acquired for the second predetermined value The external devices of the plug include:判断针对第二预定值计算出的音量值的平均值是否达到针对第一预定值计算出的音量值的平均值的七倍;Determining whether an average value of the volume values calculated for the second predetermined value reaches seven times an average value of the volume values calculated for the first predetermined value;如果达到七倍,则确定所述外接设备为设置有所述识别电路的外接设备;If it is seven times, it is determined that the external device is an external device provided with the identification circuit;如果没有达到七倍,则确定所述外接设备不为设置有所述识别电路的外接设备。If it is not seven times, it is determined that the external device is not an external device provided with the identification circuit.
- 如权利要求26所述的装置,其中,所述第一预定值为0,且该装置还包括:The apparatus of claim 26, wherein the first predetermined value is 0, and the apparatus further comprises:第三初始化模块,适于将所述智能电子设备的当前音频播放音量设置为第一预定值,获取通过录音获得的声音的音量值,并针对获取到的预定数量的音量值计算平均值;播放预定音频信号;将当前音频播放音量调整为下一级音量值,获取通过录音获得的声音的音量值,并针对获取到的预定数量的音量值计算平均值;a third initialization module, configured to set a current audio playback volume of the smart electronic device to a first predetermined value, acquire a volume value of the sound obtained by the recording, and calculate an average value for the obtained predetermined number of volume values; Predetermining the audio signal; adjusting the current audio playback volume to the next-level volume value, obtaining the volume value of the sound obtained by the recording, and calculating an average value for the obtained predetermined number of volume values;判断针对调整后的当前音频播放音量计算出的音量值的平均值是否达到针对第一预定值计算出的音量值的平均值的预定倍数,其中,所述预定倍数大于七倍;Determining whether an average value of the volume values calculated for the adjusted current audio playback volume reaches a predetermined multiple of an average value of the volume values calculated for the first predetermined value, wherein the predetermined multiple is greater than seven times;如果达到预定倍数,则将所述调整后的当前音频播放音量作为所述第二预 定值;If the predetermined multiple is reached, the adjusted current audio playback volume is used as the second pre- Value;如果没有达到预定倍数,则返回到所述将当前音频播放音量调整为下一级音量值的步骤。If the predetermined multiple is not reached, return to the step of adjusting the current audio playback volume to the next volume value.
- 如权利要求26所述的装置,其中,所述识别模块还适于:The apparatus of claim 26 wherein said identification module is further adapted to:在确定出针对第一预定值计算出的音量值的平均值超过预定阈值的情况下,确定所述外接设备不为设置有所述识别电路的外接设备。In a case where it is determined that the average value of the volume values calculated for the first predetermined value exceeds a predetermined threshold, it is determined that the external device is not an external device provided with the identification circuit.
- 如权利要求19所述的装置,其中,所述外接设备为设置有A1-A7中任一所述的识别电路的外接设备。The apparatus according to claim 19, wherein said external device is an external device provided with the identification circuit of any one of A1 to A7.
- 一种基于耳机插座的外接设备识别系统,其包括:外接设备以及智能电子设备;An external device identification system based on a headphone jack, comprising: an external device and an intelligent electronic device;所述外接设备中设置有权利要求1-7中任一权利要求所述的识别电路;The external device is provided with the identification circuit according to any one of claims 1-7;所述智能电子设备中设置有权利要求19-29中任一权利要求所述的基于耳机插座的外接设备识别装置。The earphone socket-based external device identification device according to any one of claims 19-29 is provided in the smart electronic device.
- 一种计算机程序,包括计算机可读代码,当电子设备运行所述计算机可读代码运行时,导致权利要求8-18中的任一项权利要求所述的外接设备识别方法被执行。A computer program comprising computer readable code for causing an external device identification method according to any one of claims 8-18 to be performed when the electronic device runs the computer readable code.
- 一种计算机可读介质,其中存储了如权利要求31所述的计算机程序。 A computer readable medium storing the computer program of claim 31.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410112245.3 | 2014-03-24 | ||
CN201410112245.3A CN103873988B (en) | 2014-01-09 | 2014-03-24 | Based on external equipment identify circuit, the methods, devices and systems of earphone socket |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2015143896A1 true WO2015143896A1 (en) | 2015-10-01 |
Family
ID=54198787
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2014/093598 WO2015143896A1 (en) | 2014-03-24 | 2014-12-11 | Recognition circuit, method, apparatus and system for external device based on earphone socket |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN103873988B (en) |
WO (1) | WO2015143896A1 (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103873988B (en) * | 2014-01-09 | 2016-06-01 | 北京奇虎科技有限公司 | Based on external equipment identify circuit, the methods, devices and systems of earphone socket |
CN104581529B (en) * | 2014-12-10 | 2018-04-27 | 北京利云技术开发公司 | One kind recording block device |
CN104794074B (en) * | 2015-03-27 | 2018-04-06 | 小米科技有限责任公司 | External equipment recognition methods and device |
CN105741863B (en) * | 2016-01-29 | 2018-06-29 | 广东欧珀移动通信有限公司 | The method and apparatus and mobile terminal that a kind of audio frequency of mobile terminal plays |
CN105611449B (en) * | 2016-01-29 | 2018-04-06 | 广东欧珀移动通信有限公司 | A kind of method, apparatus and mobile terminal for identifying self-shooting bar |
CN105741862B (en) * | 2016-01-29 | 2018-05-08 | 广东欧珀移动通信有限公司 | A kind of method and apparatus and mobile terminal of audio frequency of mobile terminal typing |
CN109495814B (en) * | 2018-11-21 | 2021-11-26 | 广州市百果园信息技术有限公司 | Audio connector, audio signal processing method and audio signal processing system |
CN113571032B (en) * | 2020-04-28 | 2024-07-26 | 深圳市万普拉斯科技有限公司 | Audio data transmission method, device, computer equipment and storage medium |
CN112345981B (en) * | 2020-09-25 | 2023-06-27 | 深圳宝新创科技股份有限公司 | Detection jig and method for detecting audio socket |
CN116047613A (en) * | 2021-07-22 | 2023-05-02 | 荣耀终端有限公司 | Earphone in-place detection method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1866757A (en) * | 2005-05-16 | 2006-11-22 | Lg电子株式会社 | Method for automatically recognizing external device in mobile communication terminal and mobile communication terminal designed for implementing the same |
CN102547506A (en) * | 2010-12-30 | 2012-07-04 | 深圳富泰宏精密工业有限公司 | Headphone interface circuit and electronic device with same |
CN103873988A (en) * | 2014-01-09 | 2014-06-18 | 北京奇虎科技有限公司 | External device recognition circuit, method, device and system based on headphone jack |
CN203801066U (en) * | 2014-01-09 | 2014-08-27 | 北京奇虎科技有限公司 | Earphone socket-based external equipment identification circuit and external equipment |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103051989B (en) * | 2011-10-12 | 2016-05-18 | 宏达国际电子股份有限公司 | Audio electronics device and audio jack identification and method of operating |
CN103220614B (en) * | 2012-01-20 | 2015-09-16 | 天地融科技股份有限公司 | A kind of audio interface type detection device |
CN103391495A (en) * | 2013-07-01 | 2013-11-13 | 上海摩软通讯技术有限公司 | Automatic earphone adaptation circuit and adaptation method thereof |
CN103414981A (en) * | 2013-07-17 | 2013-11-27 | 天地融科技股份有限公司 | Device, method and terminal for recognizing audio interface pins |
-
2014
- 2014-03-24 CN CN201410112245.3A patent/CN103873988B/en not_active Expired - Fee Related
- 2014-12-11 WO PCT/CN2014/093598 patent/WO2015143896A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1866757A (en) * | 2005-05-16 | 2006-11-22 | Lg电子株式会社 | Method for automatically recognizing external device in mobile communication terminal and mobile communication terminal designed for implementing the same |
CN102547506A (en) * | 2010-12-30 | 2012-07-04 | 深圳富泰宏精密工业有限公司 | Headphone interface circuit and electronic device with same |
CN103873988A (en) * | 2014-01-09 | 2014-06-18 | 北京奇虎科技有限公司 | External device recognition circuit, method, device and system based on headphone jack |
CN203801066U (en) * | 2014-01-09 | 2014-08-27 | 北京奇虎科技有限公司 | Earphone socket-based external equipment identification circuit and external equipment |
Also Published As
Publication number | Publication date |
---|---|
CN103873988B (en) | 2016-06-01 |
CN103873988A (en) | 2014-06-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2015143896A1 (en) | Recognition circuit, method, apparatus and system for external device based on earphone socket | |
CN111277929B (en) | Wireless earphone volume control method, wireless earphone and mobile terminal | |
US9565497B2 (en) | Enhancing audio using a mobile device | |
US8909537B2 (en) | Device capable of playing music and method for controlling music playing in electronic device | |
CN106302997B (en) | Output control method, electronic equipment and system | |
US20170126192A1 (en) | Method, device, and computer-readable medium for adjusting volume | |
WO2017032030A1 (en) | Volume adjusting method and user terminal | |
WO2017166603A1 (en) | Sound quality adjustment method, terminal, electronic device, and non-volatile computer storage medium | |
WO2019033986A1 (en) | Sound playback device detection method, apparatus, storage medium, and terminal | |
CN105204761B (en) | A kind of volume adjusting method and user terminal | |
TWI522902B (en) | Electronic device and method for sensing headset | |
TWI558154B (en) | Method and apparatus for audio testing | |
CN107613113A (en) | A kind of headset mode control method, device and computer-readable recording medium | |
CN105262887A (en) | Mobile terminal and audio setting method thereof | |
CN113010139A (en) | Screen projection method and device and electronic equipment | |
TWI522904B (en) | Electronic device and headset for calibrating electronic device | |
WO2018102614A1 (en) | Automated detection of an active audio output | |
US10129382B2 (en) | Electronic device and method for controlling electronic device using headset | |
US9880804B1 (en) | Method of automatically adjusting sound output and electronic device | |
CN101276622A (en) | Multimedia system and time-counting method thereof | |
CN113517000A (en) | Echo cancellation test method, terminal and storage device | |
CN116132869A (en) | Earphone volume adjusting method, earphone and storage medium | |
KR101442027B1 (en) | Sound processing system to recognize earphones for portable devices using sound patterns, mathod for recognizing earphone for portable devices using sound patterns, and mathod for sound processing using thereof | |
CN105959845B (en) | External equipment identification circuit, methods, devices and systems based on earphone socket | |
US10623845B1 (en) | Acoustic gesture detection for control of a hearable device |
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: 14887427 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: 14887427 Country of ref document: EP Kind code of ref document: A1 |