AUDIO CIRCUIT, AND DEVICE AND CONTROL METHOD RELATED THERETO
20220004352 · 2022-01-06
Inventors
Cpc classification
G06F3/162
PHYSICS
H04R2420/09
ELECTRICITY
H04R5/04
ELECTRICITY
H04R1/1041
ELECTRICITY
H04R2420/01
ELECTRICITY
International classification
Abstract
An audio circuit includes: a first Type-C port, a first microphone input module, and a second microphone input module; the first Type-C port includes a first pin and a second pin, the first microphone input module is connected to the first pin, and the second microphone input module is connected to the second pin; in a case that the first Type-C port and a second Type-C port of the earpiece are in a first plugging state, the first pin is connected to a third pin of the second Type-C port, and the second pin is connected to a fourth pin of the second Type-C port; and in a case that the first Type-C port and the second Type-C port are in a second plugging state, the second pin is connected to the third pin, and the first pin is connected to the fourth pin.
Claims
1. An audio circuit, applied to a terminal, wherein the terminal and an earpiece are able to be connected by plugging, and the audio circuit comprises a first Type-C port, a first microphone input module, and a second microphone input module; the first Type-C port comprises a first pin and a second pin, the first microphone input module is connected to the first pin, and the second microphone input module is connected to the second pin; and the first microphone input module is different from the second microphone input module; in a case that the first Type-C port and a second Type-C port of the earpiece are in a first plugging state, the first pin is connected to a third pin of the second Type-C port, and the second pin is connected to a fourth pin of the second Type-C port; and in a case that the first Type-C port and the second Type-C port are in a second plugging state, the second pin is connected to the third pin, and the first pin is connected to the fourth pin; wherein the third pin is configured to connect to a first audio signal terminal of a microphone of the earpiece, and the fourth pin is configured to connect to a first ground terminal of the microphone and is grounded.
2. The audio circuit according to claim 1, wherein the first Type-C port further comprises a fifth pin and a sixth pin, the audio circuit further comprises a channel power amplifier module, the channel power amplifier module comprises a second audio signal terminal and a reference signal terminal, the second audio signal terminal is connected to the fifth pin, and the reference signal terminal is connected to the sixth pin; and in a case that the first Type-C port and the second Type-C port are connected by plugging, the fifth pin is connected to a seventh pin of the second Type-C port, and the six pin is connected to an eighth pin of the second Type-C port and is grounded; wherein the seventh pin is configured to connect to a third audio signal terminal of the earpiece, and the eighth pin is configured to connect to a second ground terminal of the earpiece.
3. The audio circuit according to claim 2, wherein the channel power amplifier module comprises at least one of a right channel power amplifier module and a left channel power amplifier module.
4. An audio circuit, applied to an earpiece, wherein the earpiece and a terminal are able to be connected by plugging, the audio circuit comprises a second Type-C port and a microphone, the second Type-C port comprises a third pin and a fourth pin, the microphone is provided with a first audio signal terminal and a first ground terminal, the first audio signal terminal is connected to the third pin, and the first ground terminal is connected to the fourth pin and is grounded; in a case that the second Type-C port and a first Type-C port of the terminal is in a first plugging state, the third pin is connected to a first pin of the first Type-C port, and the fourth pin is connected to a second pin of the first Type-C port; and in a case that the second Type-C port and the first Type-C port are in a second plugging state, the third pin is connected to the second pin, and the fourth pin is connected to the first pin; wherein the first pin is configured to connect to a first microphone input module of the terminal, the second pin is configured to connect to a second microphone input module of the terminal, and the first microphone input module is different from the second microphone input module.
5. The audio circuit according to claim 4, wherein the second Type-C port further comprises a seventh pin and an eighth pin, the audio circuit further comprises a third audio signal terminal and a second ground terminal, the seventh pin is connected to the third audio signal terminal, and the eighth pin is connected to the second ground terminal; and in a case that the second Type-C port is connected to the first Type-C port by plugging, the seventh pin is connected to a fifth pin of the first Type-C port, and the eighth pin is connected to a sixth pin of the first Type-C port and is grounded; wherein the fifth pin is configured to connect to a second audio signal terminal of a channel power amplifier module of the terminal, and the sixth pin is configured to connect to a reference signal terminal of the channel power amplifier module.
6. A terminal, comprising an audio circuit, wherein the terminal and an earpiece are able to be connected by plugging, and the audio circuit comprises a first Type-C port, a first microphone input module, and a second microphone input module; the first Type-C port comprises a first pin and a second pin, the first microphone input module is connected to the first pin, and the second microphone input module is connected to the second pin; and the first microphone input module is different from the second microphone input module; in a case that the first Type-C port and a second Type-C port of the earpiece are in a first plugging state, the first pin is connected to a third pin of the second Type-C port, and the second pin is connected to a fourth pin of the second Type-C port; and in a case that the first Type-C port and the second Type-C port are in a second plugging state, the second pin is connected to the third pin, and the first pin is connected to the fourth pin; wherein the third pin is configured to connect to a first audio signal terminal of a microphone of the earpiece, and the fourth pin is configured to connect to a first ground terminal of the microphone and is grounded.
7. The terminal according to claim 6, wherein the first Type-C port further comprises a fifth pin and a sixth pin, the audio circuit further comprises a channel power amplifier module, the channel power amplifier module comprises a second audio signal terminal and a reference signal terminal, the second audio signal terminal is connected to the fifth pin, and the reference signal terminal is connected to the sixth pin; and in a case that the first Type-C port and the second Type-C port are connected by plugging, the fifth pin is connected to a seventh pin of the second Type-C port, and the six pin is connected to an eighth pin of the second Type-C port and is grounded; wherein the seventh pin is configured to connect to a third audio signal terminal of the earpiece, and the eighth pin is configured to connect to a second ground terminal of the earpiece.
8. The terminal according to claim 7, wherein the channel power amplifier module comprises at least one of a right channel power amplifier module and a left channel power amplifier module.
9. An earpiece, comprising the audio circuit according to claim 4.
10. An audio circuit control method, applied to the terminal according to claim 6, wherein the terminal is configured to perform audio transmission with an earpiece, and the audio circuit control method comprises: monitoring a plugging status of a first Type-C port of the terminal and a second Type-C port of the earpiece in a case that the first Type-C port and the second Type-C port are connected by plugging; and in a case that the first Type-C port and the second Type-C port are detected to be in a first plugging state, controlling a second microphone input module to be off, so as to input an analog signal output by a microphone of the earpiece to a first microphone input module of the terminal; or in a case that the first Type-C port and the second Type-C port are detected to be in a second plugging state, controlling the first microphone input module to be off, so as to input the analog signal output by the microphone to the second microphone input module.
11. The method according to claim 10, wherein before the monitoring a plugging status of a first Type-C port of the terminal and a second Type-C port of the earpiece in a case that the first Type-C port and the second Type-C port are connected by plugging, the method further comprises: monitoring a first resistance-to-ground value of the first microphone input module and a second resistance-to-ground value of the second microphone input module; and the monitoring a plugging status of a first Type-C port of the terminal and a second Type-C port of the earpiece in a case that the first Type-C port and the second Type-C port are connected by plugging comprises: in a case that the first resistance-to-ground value and the second resistance-to-ground value are greater than or equal to a first threshold and less than or equal to a second threshold, determining that the first Type-C port and the second Type-C port are connected by plugging, and comparing the first resistance-to-ground value and the second resistance-to-ground value; and in a case that the first resistance-to-ground value is greater than the second resistance-to-ground value, determining that the first Type-C port and the second Type-C port are in the first plugging state; or in a case that the first resistance-to-ground value is less than the second resi stance-to-ground value, determining that the first Type-C port and the second Type-C port are in the second plugging state.
12. The method according to claim 11, wherein after the monitoring a first resistance-to-ground value of the first microphone input module and a second resistance-to-ground value of the second microphone input module, the method further comprises: in a case that the first resistance-to-ground value and the second resistance-to-ground value are less than the first threshold, determining that the first Type-C port and a Type-C port of a three-segment earpiece are connected by plugging; or in a case that the first resistance-to-ground value and the second resistance-to-ground value are greater than the second threshold, determining that the microphone of the earpiece that is connected to the first Type-C port by plugging is off.
13. The method according to claim 10, wherein an audio circuit of the earpiece comprises a second Type-C port and a microphone, the second Type-C port comprises a third pin and a fourth pin, the microphone is provided with a first audio signal terminal and a first ground terminal, the first audio signal terminal is connected to the third pin, and the first ground terminal is connected to the fourth pin and is grounded; in a case that the second Type-C port and a first Type-C port of the terminal is in a first plugging state, the third pin is connected to a first pin of the first Type-C port, and the fourth pin is connected to a second pin of the first Type-C port; and in a case that the second Type-C port and the first Type-C port are in a second plugging state, the third pin is connected to the second pin, and the fourth pin is connected to the first pin; wherein the first pin is configured to connect to a first microphone input module of the terminal, the second pin is configured to connect to a second microphone input module of the terminal, and the first microphone input module is different from the second microphone input module.
14. The method according to claim 13, wherein the second Type-C port further comprises a seventh pin and an eighth pin, the audio circuit further comprises a third audio signal terminal and a second ground terminal, the seventh pin is connected to the third audio signal terminal, and the eighth pin is connected to the second ground terminal; and in a case that the second Type-C port is connected to the first Type-C port by plugging, the seventh pin is connected to a fifth pin of the first Type-C port, and the eighth pin is connected to a sixth pin of the first Type-C port and is grounded; wherein the fifth pin is configured to connect to a second audio signal terminal of a channel power amplifier module of the terminal, and the sixth pin is configured to connect to a reference signal terminal of the channel power amplifier module.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0016] To describe the technical solutions in the embodiments of this disclosure more clearly, the following briefly describes the accompanying drawings required for describing the embodiments of this disclosure. Apparently, the accompanying drawings in the following description show merely some embodiments of this disclosure, and a person of ordinary skill in the art may still derive other drawings from these accompanying drawings.
[0017]
[0018]
[0019]
[0020]
DESCRIPTION OF EMBODIMENTS
[0021] The following clearly describes the technical solutions in the embodiments of this disclosure with reference to the accompanying drawings in the embodiments of this disclosure. Apparently, the described embodiments are merely a part rather than all of the embodiments of this disclosure. All other embodiments that a person of ordinary skill in the art obtains based on the embodiments of this disclosure shall fall within the protection scope of this disclosure.
[0022] Referring to
[0023] In a case that the first Type-C port 11 and the second Type-C port 21 are in a first plugging state, the first pin p1 is connected to a third pin p3 of the second Type-C port 21, and the second pin p2 is connected to a fourth pin p4 of the second Type-C port 21 (the connection relationship is denoted by the solid lines in
[0024] In a case that the first Type-C port 11 and the second Type-C port 12 are in a second plugging state, the second pin p2 is connected to the third pin p3, and the first pin p1 is connected to the fourth pin p4 (the connection relationship is denoted by the dashed lines in
[0025] The third pin p3 is configured to connect to a first audio signal terminal of a microphone MIC; and the fourth pin p4 is configured to connect to a first ground terminal of the microphone and is grounded.
[0026] Herein, two microphone input modules are provided in the terminal. When the Type-C port of the terminal and the Type-C port of the earpiece are in the first plugging state or in the second plugging state, the microphone of the earpiece may be connected to different microphone input modules. In this way, the first audio circuit can receive, by using different microphone input modules in different plugging states, audio signals input by the microphone, with no need to add a switch, thereby reducing the possibility of recording distortion, and improving the recording quality.
[0027] It should be noted that, in this embodiment of this disclosure, for ease of description, the audio circuit in the terminal is described as the first audio circuit and the audio circuit applied to the earpiece is described as the second audio circuit; and when the earpiece and the terminal are connected by plugging, the first audio circuit is electrically connected to the second audio circuit for audio data transmission.
[0028] As shown in
[0029] In addition, in the second audio circuit, the fourth pin p4 is connected to the first ground terminal of the microphone and is grounded. It can be understood that the fourth pin p4 and the first ground terminal are connected to a same ground terminal, for example, a ground terminal disposed on the second Type-C port 21 or a ground terminal outside the second Type-C port 21. Alternatively, the fourth pin p4 and the first ground terminal may be connected to different ground terminals, for example, the fourth pin p4 is connected to the ground terminal on the second Type-C port 21, and the first ground terminal is connected to the ground terminal outside the second Type-C port 21.
[0030] It should be noted that the first Type-C port 11 may be a Type-C socket, and the second Type-C port 21 may be a Type-C connector. To be specific, in the case that the first Type-C port 11 and the second Type-C port 21 are connected by plugging, the second Type-C port 21 plugs into the first Type-C port 11. In this way, in the first plugging state, the second Type-C port 21 plugs into the first Type-C port 11 in a proper direction; and in the second plugging state, the second Type-C port 21 plugs into the first Type-C port 11 in a reverse direction.
[0031] Alternatively, the first Type-C port 11 may be a Type-C connector, and the second Type-C port 21 may be a Type-C socket. To be specific, in the case that the first Type-C port 11 and the second Type-C port 21 are connected by plugging, the first Type-C port 11 plugs into the second Type-C port 21. In this way, in the first plugging state, the first Type-C port 21 plugs into the second Type-C port 11 in a proper direction; and in the second plugging state, the first Type-C port 21 plugs into the second Type-C port 11 in a reverse direction.
[0032] In addition, the first pin p1 and the second pin p2 may be an SBU1 pin and an SBU2 pin of the first Type-C port 11. The third pin p3 and the fourth pin p4 may be an SBU1 pin and an SBU2 pin of the second Type-C port 21, thereby retaining other multiplexing functions of the SBU1 and SBU2.
[0033] In a specific embodiment of this disclosure, the first audio circuit may further include other components, for example, the first audio circuit may further include a CC monitoring module 14 and a channel power amplifier module. The channel power amplifier module may include a left channel power amplifier module 15 and a right channel power amplifier module 16. The CC monitoring module 14 is configured to monitor a type of an external device that is connected to the first audio circuit by plugging. For example, the external device is a charging device, a data transmission device, an earpiece including a second audio circuit, or the like. The channel power amplifier module is configured to output a second audio signal to the second audio circuit 21 when the first audio circuit is connected to the second audio circuit, so that the second audio circuit outputs audio based on the second audio signal.
[0034] In a case that the first audio circuit 11 includes the left channel power amplifier module 15 and the right channel power amplifier module 16, the second audio circuit may further include a left earpiece body 22 and a right earpiece body 23. The left earpiece body 22 is configured to receive an audio signal output by the left channel, so as to output sound to the left ear, and the right earpiece body 23 is configured to receive an audio signal output by the right channel, so as to output sound to the right ear. Certainly, the earpiece body may alternatively be a monaural earpiece. To be specific, the second audio circuit includes only one earpiece body, and the first audio circuit includes only one channel power amplifier module connected to the monaural earpiece body. This is not limited herein.
[0035] In the case that the first audio circuit includes the left channel power amplifier module 15 and the right channel power amplifier module 16, each of the left channel power amplifier module 15 and the right channel power amplifier module 16 may be provided with a second audio signal terminal and a reference signal terminal. The second audio signal terminal is configured to output the second audio signal, and the reference signal terminal is configured to output a reference signal, so that the left channel power amplifier adjusts the second audio signal based on the reference signal to reduce noise for the second audio signal. In addition, each of the left earpiece body 22 and the right earpiece body 23 may be provided with a third audio signal terminal and a second ground terminal. When the first audio circuit is connected to the second audio circuit, the second audio signal terminal is connected to the third audio signal terminal, and the reference signal terminal is connected to the second ground terminal and is grounded.
[0036] More specifically, in the case that the first Type-C port 11 and the second Type-C port 21 are connected by plugging, a switch may be disposed at the second audio signal terminal and the reference signal terminal of the channel power amplifier module. With the switch, in the first plugging state and the second plugging state, the second audio signal terminal is connected to the third audio signal terminal, and the reference signal terminal is connected to the second ground terminal and is grounded.
[0037] For example, as shown in
[0038] Optionally, the first Type-C port 11 further includes a fifth pin and a sixth pin, the audio circuit (which is the first audio circuit) further includes a channel power amplifier module, and the channel power amplifier module includes a second audio signal terminal and a reference signal terminal. The second audio signal terminal is connected to the fifth pin, and the reference signal terminal is connected to the sixth pin. In a case that the first Type-C port 11 and the second Type-C port 21 are connected by plugging, the fifth pin is connected to a seventh pin of the second Type-C port 21, and the sixth pin is connected to an eighth pin of the second Type-C port 21 and is grounded. The seventh pin is configured to connect to the third audio signal terminal of the earpiece, and the eighth pin is configured to connect to the second ground terminal of the earpiece.
[0039] Herein, no switch is required, to implement that in the first plugging state and the second plugging state, the second audio signal terminal can be connected to the third audio signal terminal, and the reference signal terminal is connected to the second ground terminal and is grounded, thereby reducing the possibility of audio distortion, and improving the quality of audio output by the second audio circuit.
[0040] Optionally, the channel power amplifier module includes at least one of the left channel power amplifier module 15 and the right channel power amplifier module 16. Therefore, disposition of the circuit structure of the first audio circuit is more flexible.
[0041] It should be noted that the earpiece may include the right earpiece body 23 in a case that the channel power amplifier module includes the right channel power amplifier module 16, and that the earpiece may include the left headphone body 22 in a case that the channel power amplifier module includes the left channel power amplifier module 15.
[0042] In addition, the reference signal terminal being connected to the second ground terminal and being grounded may be that, when the second Type-C port and the first Type-C port are connected by plugging, the eighth pin is connected to the sixth pin, the eighth pin is connected to the ground terminal of the second Type-C port, and the sixth pin is connected to the ground terminal of the first Type-C port. In this way, the reference signal terminal and the second ground terminal are both connected to a ground terminal nearby, thereby simplifying wiring of the first audio circuit and the second audio circuit. In addition, a ground wire on a PCB is generally wider, thereby reducing the crosstalk output from the left and right of the earpiece.
[0043] For example, as shown in
[0044] The pin p5 and pin p7 may be connected to two sets of D+ and D− pins of the first Type-C port 11, so as not to affect the use of the DP function of the Type-C port. For example, the pin p5 is connected to two D+ pins of the first Type-C port 11, and the pin p7 is connected to two D− pins of the first Type-C port 11. The pins p6 and p8 are respectively connected to two sets of GND pins of the first Type-C port 11. For example, the pin p6 is connected to the GND pins of A1 and B1, and the pin p8 is connected to the GND pins of Al2 and B12. In this way, regardless of whether the first Type-C port 11 and the second Type-C port 21 are in the first plugging state or the second plugging state, it is ensured that the right channel power amplifier module 16 outputs audio signals to the right earpiece body 23, and the left channel power amplifier module 15 outputs audio signals to the left earpiece body 22.
[0045] It should be noted that the channel power amplifier module including a left channel power amplifier module and a right channel power amplifier module is used for description in the foregoing example. Certainly, the channel power amplifier module may alternatively include a left channel power amplifier module or a right channel power amplifier module. For example, in a case that the channel power amplifier module includes only the left channel power amplifier module, the REFL may be directly connected to the ground terminal of the first Type-C port 11 nearby, and the REFR may be connected to the first microphone input module 12 and the second microphone output module 13 by switching the switch K3, which is shown in
[0046] Details are not described herein.
[0047] In this embodiment of this disclosure, the first audio circuit includes the first Type-C port 11, the first microphone input module 12, and the second microphone input module 13. The first Type-C port 11 includes the first pin p1 and the second pin p2, the first microphone input module 12 is connected to the first pin p1, and the second microphone input module 13 is connected to the second pin p2. The first microphone input module 12 is different from the second microphone input module 13. In the case that the first Type-C port 11 and the second Type-C port 21 are in the first plugging state, the first pin p1 is connected to the third pin p3 of the second Type-C port 21, and the second pin p2 is connected to the fourth pin p4 of the second Type-C port 21. In the case that the first Type-C port 11 and the second Type-C port 21 are in the second plugging state, the second pin p2 is connected to the third pin p3, and the first pin p1 is connected to the fourth pin p4. The third pin p3 is configured to connect to the first audio signal terminal of the microphone, and the fourth pin p4 is configured to connect to the first ground terminal of the microphone and is grounded. In this way, the first audio circuit can receive, by using different microphone input modules in different plugging states, audio signals input by the microphone, with no need to add a switch, thereby reducing the possibility of recording distortion, and improving the recording quality.
[0048] An embodiment of this disclosure further provides an audio circuit. The audio circuit is the second audio circuit in the foregoing embodiment. As shown in
[0049] In a case that the second Type-C port 21 and a first Type-C port 11 are in a first plugging state, the third pin p3 is connected to a first pin p1 of the first Type-C port 11, and the fourth pin p4 is connected to a second pin p2 of the first Type-C port 11.
[0050] In a case that the second Type-C port 21 and the first Type-C port 11 are in a second plugging state, the third pin p3 is connected to the second pin p2, and the fourth pin p4 is connected to the first pin p1.
[0051] The first pin p1 is configured to connect to the first microphone input module 12, the second pin p2 is configured to connect to the second microphone input module 13, and the first microphone input module 12 is different from the second microphone input module 13.
[0052] Optionally, the second Type-C port 21 further includes a seventh pin and an eighth pin, and the audio circuit further includes a third audio signal terminal and a second ground terminal. The seventh pin is connected to the third audio signal terminal, and the eighth pin is connected to the second ground terminal.
[0053] In a case that the second Type-C port 21 and the first Type-C port 11 are connected by plugging, the seventh pin is connected to a fifth pin of the first Type-C port 11, and the eighth pin is connected to a sixth pin of the first Type-C port 11 and is grounded.
[0054] The fifth pin is configured to connect to a second audio signal terminal of a channel power amplifier module, and the sixth pin is configured to connect to a reference signal terminal of the channel power amplifier module.
[0055] Optionally, the earpiece includes at least one of a right earpiece body and a left earpiece body.
[0056] It should be noted that this embodiment serves as an implementation of the second audio circuit corresponding to the embodiments shown in
[0057] Based on the foregoing first audio circuit, an embodiment of this disclosure further provides a terminal, including the foregoing first audio circuit.
[0058] Because a body structure of the terminal is well known to those skilled in the art, and the first audio circuit has been described in the foregoing embodiments, the specific structure of the terminal is not described herein again.
[0059] In this embodiment of this disclosure, the terminal may be a mobile terminal, such as a mobile phone, a tablet computer (Tablet Personal Computer), a laptop computer, a personal digital assistant (PDA), a mobile Internet device (MID), or a wearable device; or may be other electronic devices, such as a digital camera, an e-book, or a navigator.
[0060] Based on the foregoing second audio circuit, an embodiment of this disclosure further provides an earpiece, including the foregoing second audio circuit.
[0061] Because a body structure of the earpiece is well known to those skilled in the art, and the second audio circuit has been described in the foregoing embodiments, the specific structure of the earpiece is not described herein.
[0062] Referring to
[0063] Step 401: Monitor a plugging status of a first Type-C port of the terminal and a second Type-C port of the earpiece in a case that the first Type-C port and the second Type-C port are connected by plugging.
[0064] Step 402: In a case that the first Type-C port and the second Type-C port are detected to be in a first plugging state, control a second microphone input module to be off, so as to input an analog signal output by a microphone of the earpiece to a first microphone input module of the terminal.
[0065] Step 403: In a case that the first Type-C port and the second Type-C port are detected to be in a second plugging state, control the first microphone input module to be off, so as to input an analog signal output by the microphone to the second microphone input module.
[0066] In this embodiment of this disclosure, in the foregoing step 401, that the terminal monitors whether a plugging status of the first Type-C port and the second Type-C port is in the first plugging state may be implemented by monitoring properties such as voltage, current, or resistance of each pin of the first Type-C port.
[0067] Optionally, before the monitoring a plugging status of a first Type-C port of the terminal and a second Type-C port of the earpiece in a case that the first Type-C port and the second Type-C port are connected by plugging, the following step is further included:
[0068] monitoring a first resistance-to-ground value of the first microphone input module and a second resistance-to-ground value of the second microphone input module.
[0069] The monitoring a plugging status of a first Type-C port of the terminal and a second Type-C port of the earpiece in a case that the first Type-C port and the second Type-C port are connected by plugging includes:
[0070] in a case that the first resistance-to-ground value and the second resistance-to-ground value are greater than or equal to a first threshold and less than or equal to a second threshold, determining that the first Type-C port and the second Type-C port are connected by plugging, and comparing the first resistance-to-ground value and the second resistance-to-ground value; and in a case that the first resistance-to-ground value is greater than the second resistance-to-ground value, determining that the first Type-C port and the second Type-C port are in the first plugging state; or in a case that the first resistance-to-ground value is less than the second resistance-to-ground value, determining that the first Type-C port and the second Type-C port are in the second plugging state.
[0071] Herein, in the case that the first resistance-to-ground value and the second resistance-to-ground value are greater than or equal to the first threshold and less than or equal to the second threshold, the terminal may determine, based on the first resistance-to-ground value and the second resistance-to-ground value, whether the plugging status of the first Type-C port and the second Type-C port is in the first plugging state, thereby implementing more accurate detection.
[0072] The monitoring the first resistance-to-ground value of the first microphone input module and the second resistance-to-ground value of the second microphone input module may be that ADC modules built in the first microphone input module and the second microphone input module monitor voltages of the first pin and the second pin respectively, and obtain the first resistance-to-ground value and the second resistance-to-ground value through calculation based on the voltages of the first pin and the second pin respectively. The calculation method is well known in the art, and details are not described herein.
[0073] Optionally, after the monitoring the first resistance-to-ground value of the first microphone input module and the second resistance-to-ground value of the second microphone input module, the method further includes: in a case that the first resistance-to-ground value and the second resistance-to-ground value are less than the first threshold, determining that the first Type-C port and a Type-C port of a three-segment earpiece are connected by plugging; or in a case that the first resistance-to-ground value and the second resistance-to-ground value are greater than the second threshold, determining that the microphone of the earpiece connected to the first Type-C port by plugging is off. In this way, the terminal can determine, based on the first resistance-to-ground value and the second resistance-to-ground value, a working status of the microphone or a type of an earpiece that is connected by plugging.
[0074] In addition, before the foregoing step 401, the method may further include: identifying an external device that is connected to the first Type-C port of the terminal by plugging. For example, the terminal may monitor the external device by using CC pins of the first Type-C port. If the pins CC1 and CC2 are grounded (which is less than Ra, generally 1.2K), it is determined that the external device connected to the first Type-C port by plugging is an analog earpiece device; otherwise, the external device is other devices.
[0075] In this embodiment of this disclosure, when the first Type-C port of the terminal and the second Type-C port of the earpiece are connected by plugging, the plugging status of the first Type-C port and the second Type-C port is monitored. In the case that the first Type-C port and the second Type-C port are in the first plugging state, the second microphone input module is controlled to be off, so that the analog signal output by the microphone of the earpiece is input to the first microphone input module of the terminal; and in the case that the first Type-C port and the second Type-C port are in the second plugging state, the first microphone input module is controlled to be off, so that the analog signal output by the microphone is input to the second microphone input module. In this way, the audio circuit can receive, by using different microphone input modules in different plugging states, audio signals input by the microphone, with no need to add a switch, thereby reducing the possibility of recording distortion, and improving the recording quality.
[0076] The foregoing descriptions are merely specific implementations of this disclosure, but are not intended to limit the protection scope of this disclosure. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in this disclosure shall fall within the protection scope of this disclosure. Therefore, the protection scope of this disclosure shall be subject to the protection scope of the claims.