Microphone fault detection method, electronic equipment and storage medium

By playing audio and sound signals in electronic devices and calculating their similarity to detect microphone failures, the problem of degraded audio acquisition quality is solved and the user experience is improved.

CN120455914APending Publication Date: 2025-08-08HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410174153.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-07
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the prior art, electronic devices cannot effectively detect microphone failures during the audio acquisition process, resulting in a degradation of audio quality and poor user experience.

Method used

The audio to be played and the first sound signal are played through the speaker, the microphone receives the second sound signal, calculates the similarity of the first and second sound signals. If the similarity is below the threshold, prompt information is displayed to indicate the type of microphone failure such as blockage, failure, noise or friction.

Benefits of technology

It realizes the active detection of microphone failures during audio playback, and prompts users to take corresponding measures to improve the audio acquisition quality and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455914A_ABST
    Figure CN120455914A_ABST
Patent Text Reader

Abstract

The invention provides a microphone fault detection method, electronic equipment and a storage medium. The first electronic equipment plays the audio to be played and the first sound signal through a loudspeaker; the first electronic equipment receives a second sound signal through the microphone; the first electronic equipment determines the similarity between the first sound signal and the second sound signal; under the condition that the similarity is smaller than a first threshold value, the first electronic equipment displays first prompt information, the first prompt information is used for prompting a user of the fault type of the microphone, and the fault type comprises any one or more of microphone blockage, microphone failure, microphone noise and microphone friction. Through the method, the electronic equipment can actively detect whether the microphone has the fault, the influence of the microphone fault on the quality of the audio collected by the microphone on the first electronic equipment is avoided, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a microphone fault detection method, electronic device, and storage medium. Background Art

[0002] With the development of terminal technology, electronic devices can support the functions of audio output and audio collection. For example, electronic devices can play audio through speakers (speakers) and can also collect audio through microphones (mics).

[0003] Currently, in various audio pickup scenarios, microphone failure is a key factor directly affecting the quality of audio captured by electronic devices. Further research is needed to determine how to detect microphone failures and improve audio quality. Summary of the Invention

[0004] The present application provides a microphone fault detection method, electronic device, and storage medium. The electronic device can detect microphone faults and prompt the user to take relevant measures to resolve the microphone fault, thereby improving the user experience.

[0005] In a first aspect, the present application provides a microphone fault detection method, the method comprising: a first electronic device plays audio to be played and a first sound signal through a speaker; the first electronic device receives a second sound signal through a microphone; the first electronic device determines the similarity between the first sound signal and the second sound signal; when the similarity is less than a first threshold, the first electronic device displays a first prompt message, the first prompt message being used to prompt the user of the type of microphone fault, the fault type including any one or more of the following: microphone blockage, microphone failure, microphone noise, and microphone friction.

[0006] Optionally, the first sound signal may be obtained by the first electronic device after obtaining the audio to be played. In some embodiments, the first sound signal may be generated in real time by the first electronic device. The first sound signal may also be pre-set in the first electronic device.

[0007] Optionally, the audio to be played can be music, video, alarm, reminder sound, or other audio that does not require a microphone.

[0008] Optionally, the audio to be played may also be an incoming call ringtone, an outgoing call ringtone, or other audio that requires the use of a microphone.

[0009] Microphone failure may refer to a fault in the microphone device, resulting in poor quality of audio collected by the microphone.

[0010] Microphone blockage can refer to a fault type in which there is no problem with the microphone component, but foreign objects (such as fingers or clothing) block the microphone, resulting in poor audio quality collected by the microphone.

[0011] Microphone friction can refer to a fault type in which there is no problem with the microphone device, but foreign objects (such as fingers, clothing, etc.) rub back and forth near the microphone, resulting in poor audio quality collected by the microphone.

[0012] Microphone noise can also refer to a faulty microphone component, resulting in poor audio quality. However, the specific causes of microphone noise and microphone failure can differ. Alternatively, when the microphone failure is characterized by microphone noise, the audio quality collected by the microphone is better than when the failure is characterized by microphone failure.

[0013] Optionally, when the similarity is greater than the first threshold, the first electronic device may confirm that there is no microphone failure at present.

[0014] Optionally, the first electronic device may detect microphone failure according to this method periodically / irregularly / at certain intervals.

[0015] Optionally, the first electronic device determines the similarity between the first sound signal and the second sound signal, which may also be referred to as a decoding success rate of the second sound signal. If the decoding success rate of the second sound signal is greater than a first threshold, it can be determined that the microphone on the first electronic device is not faulty. If the decoding success rate of the second sound signal is less than the first threshold, it can be determined that the microphone on the first electronic device is faulty.

[0016] This method allows an electronic device to detect microphone failures through a first sound signal while playing pending audio, and prompt the user to take appropriate measures to resolve the microphone failure. On the one hand, the first electronic device plays the first sound signal while playing pending audio, and the user is almost unaware of the first sound signal. On the other hand, the first electronic device can proactively detect whether the microphone is faulty, preventing any impact on the quality of the audio captured by the microphone on the first electronic device, thereby improving the user experience.

[0017] In combination with the first aspect, in a possible implementation, before the first electronic device plays the audio to be played and the first sound signal through a speaker, the method also includes: the first electronic device encodes the first sound signal according to the encoding rule to obtain the encoded first sound signal; the first electronic device plays the audio to be played and the first sound signal through the speaker, specifically including: the first electronic device plays the audio to be played and the encoded first sound signal through the speaker; after the first electronic device receives the second sound signal through the microphone, the method also includes: the first electronic device decodes the second sound signal according to the decoding rule to obtain an unencoded second sound signal; the first electronic device determines the similarity between the first sound signal and the second sound signal, specifically including: the first electronic device determines the similarity between the first sound signal and the unencoded second sound signal.

[0018] Optionally, encoding and decoding are inverse to each other, and encoding rules and decoding rules are also inverse to each other. In some embodiments, the encoding rules and decoding rules may be preset in the first electronic device.

[0019] In this way, the confidence and anti-interference ability of the encoded signal are stronger than those of the unencoded signal. The first electronic device can encode the first sound signal for detecting whether the microphone is faulty and then play it out, which can improve the anti-interference ability of the first sound signal.

[0020] In conjunction with the first aspect, in one possible implementation, the bandwidth of the first sound signal is greater than the first bandwidth. Thus, to improve the anti-interference performance of the first sound signal, the bandwidth of the first sound signal may be greater than the first bandwidth. The bandwidth of the first sound signal may refer to the difference between the lowest frequency and the highest frequency of the first sound signal. The wider the bandwidth of the first sound signal, the stronger the anti-interference capability of the first sound signal, thereby reducing noise interference.

[0021] In conjunction with the first aspect, in one possible implementation, the energy value of the first sound signal is less than the first energy value. Thus, when the first electronic device plays the first sound signal through a speaker, the energy value of the first sound signal is relatively low, making it almost imperceptible to a user's ear and not affecting normal use of the first electronic device.

[0022] In conjunction with the first aspect, in one possible implementation, before the first electronic device displays the first prompt information, the method further includes: the first electronic device determining a type of microphone fault. In this way, the first electronic device can not only detect whether the microphone is faulty, but also detect the type of microphone fault, and prompt the user to take appropriate measures to resolve the microphone fault.

[0023] In combination with the first aspect, in a possible implementation method, when the fault type is microphone failure, the first electronic device determines the fault type of the microphone, specifically including: when the energy value of the second sound signal is less than the second energy value, and the similarity between the first sound signal and the second sound signal is less than the second threshold, the first electronic device determines that the fault type of the microphone is microphone failure, wherein the second threshold is less than the first threshold.

[0024] In combination with the first aspect, in a possible implementation method, when the fault type is microphone blockage, the first electronic device determines the fault type of the microphone, specifically including: when the energy value of the second sound signal is less than the second energy value, and the similarity between the first sound signal and the second sound signal is greater than the second threshold, the first electronic device determines that the fault type of the microphone is microphone blockage, wherein the second threshold is less than the first threshold.

[0025] In combination with the first aspect, in a possible implementation method, when the fault type is microphone friction or microphone noise, the first electronic device determines the fault type of the microphone, specifically including: when the difference in energy values of two adjacent frames of sound signals in the second sound signal is greater than a preset difference, the first electronic device inputs the second sound signal into the target model, and determines the fault type as microphone friction or microphone noise through the target model.

[0026] In combination with the first aspect, in a possible implementation, before the first electronic device plays the audio to be played and the first sound signal through a speaker, the method also includes: the first electronic device receives a first call connection request sent by the second electronic device; in response to the first call connection request, the first electronic device obtains the audio to be played; or, the first electronic device receives and responds to the first user operation, and sends a second call connection request to the second electronic device; in response to the second call connection request, the first electronic device obtains the audio to be played.

[0027] Optionally, the audio to be played may be an incoming call ringtone or an outgoing call ringtone of a real-time call. The real-time call may be a carrier call or an instant messaging application call.

[0028] In this way, when the first electronic device is about to use the microphone, detecting whether the microphone of the first electronic device is faulty can not only actively detect whether the microphone of the first electronic device is faulty, but also reduce the frequency of the first electronic device detecting whether the microphone is faulty.

[0029] In combination with the first aspect, in a possible implementation, the first electronic device plays the audio to be played and the first sound signal through a speaker, specifically including: in response to obtaining the audio to be played, the first electronic device generates a first sound signal; the first electronic device plays the audio to be played and the first sound signal through the speaker.

[0030] In this way, after the first electronic device obtains the audio to be played, ie, determines that the microphone is about to be used, the first electronic device can obtain the first sound signal and play the audio to be played and the first sound signal.

[0031] In combination with the first aspect, in a possible implementation, when the fault type is microphone failure or microphone noise, after the first electronic device determines the fault type of the microphone, the method also includes: the first electronic device displays a second prompt message, the second prompt message includes the location information of one or more microphone repair outlets, and the second prompt message is used to prompt the user to promptly repair or replace the microphone device on the first electronic device.

[0032] In a second aspect, the present application provides an electronic device, which is a first electronic device, and the first electronic device includes a microphone, a memory, and a processor; wherein the microphone, the memory, and the processor are coupled, and the memory is used to store a computer program. When the processor executes and calls the computer program, the first electronic device executes a microphone fault detection method provided in any possible implementation method in the first aspect.

[0033] In a third aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on a first electronic device, causes the first electronic device to execute a microphone fault detection method provided in any possible implementation of the first aspect.

[0034] In a fourth aspect, the present application provides a computer program product comprising instructions, which, when run on a first electronic device, enables the first electronic device to execute a microphone fault detection method provided in any possible implementation of the first aspect.

[0035] In a fifth aspect, the present application provides a chip system, which includes one or more processors, and the processor is used to call computer instructions to enable a first electronic device to execute a microphone fault detection method provided in any possible implementation of any of the above aspects.

[0036] For the description of the beneficial effects of the second to fifth aspects, reference may be made to the description of the beneficial effects in the first aspect, and this application will not repeat them here. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1A-1G A UI diagram showing whether the microphone of the electronic device 100 is faulty when the electronic device 100 is playing music;

[0038] Figures 2A-2KA UI diagram showing whether the microphone of the electronic device 100 is faulty when the electronic device 100 is playing an incoming call ringtone or an outgoing call ringtone;

[0039] Figure 3 A schematic diagram of the functional modules of an audio acquisition method provided in this application;

[0040] Figure 4 A flowchart of a microphone fault detection method provided in this application;

[0041] Figure 5 A flowchart of another microphone fault detection method provided by this application;

[0042] Figure 6 shows a schematic diagram of the hardware structure of the electronic device 100;

[0043] Figure 7 A schematic diagram of the software structure of the electronic device 100 is shown. DETAILED DESCRIPTION

[0044] The following is a clear and detailed description of the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship between related objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0045] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.

[0046] The term "user interface (UI)" in the following embodiments of this application refers to the media interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The commonly used form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operations displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of a wearable device.

[0047] The electronic device 100 can pick up audio through a microphone and save the picked up audio locally, or send the picked up audio in real time to other devices that establish a communication connection therewith, such as the electronic device 200 (not shown in the figure). However, during the process of the microphone collecting audio, the user cannot perceive the audio quality. The audio quality can only be known by the user after the audio collection is completed and the audio is played on the local device, or after the audio is sent to the electronic device 200, the audio quality is fed back by the user of the electronic device 200, and the interaction efficiency is low. In addition, the user cannot perceive whether the poor quality of the collected audio is due to a malfunction of the microphone of the electronic device 100.

[0048] In order to detect microphone failure and avoid the occurrence of poor audio quality collected by the electronic device 100 due to microphone failure, the present application provides a microphone failure detection method. When a microphone failure is detected, the electronic device 100 can notify the user of the microphone failure and prompt the user to take appropriate measures to resolve the microphone failure to avoid affecting the quality of the audio collected by the microphone on the electronic device 100.

[0049] For example, the electronic device 100 may generate a first sound signal, play the first sound signal through a speaker, and then collect a second sound signal through a microphone. The electronic device 100 may determine the similarity between the first sound signal and the second sound signal. When the similarity is greater than a first threshold, the electronic device 100 may confirm that there is no microphone fault. When the similarity is less than the first threshold, the electronic device 100 may confirm that there is a microphone fault. In this way, the electronic device 100 can actively detect whether there is a microphone fault.

[0050] When the similarity is less than the first threshold, the electronic device 100 may further confirm the type of microphone failure and display relevant prompt information to remind the user of the type of microphone failure of the electronic device 100.

[0051] Microphone failure types may include but are not limited to any one or more of the following: microphone failure, microphone blockage, microphone friction, and microphone noise.

[0052] Microphone failure may refer to a fault in a microphone device, resulting in poor quality of audio collected by the microphone.

[0053] Microphone blockage can refer to a fault type in which there is no problem with the microphone component, but foreign objects (such as fingers or clothing) block the microphone, resulting in poor audio quality collected by the microphone.

[0054] Microphone friction can refer to a fault type in which there is no problem with the microphone device, but foreign objects (such as fingers, clothing, etc.) rub back and forth near the microphone, resulting in poor audio quality collected by the microphone.

[0055] Microphone noise can also refer to a faulty microphone component, resulting in poor audio quality. However, the specific causes of microphone noise and microphone failure can differ. Alternatively, when the microphone failure is characterized by microphone noise, the audio quality collected by the microphone is better than when the failure is characterized by microphone failure.

[0056] For how the electronic device 100 determines the type of microphone failure, please refer to Figure 4 The description in the embodiments is not repeated here.

[0057] In some embodiments, the electronic device 100 may detect microphone failure according to this method periodically / irregularly / at certain intervals.

[0058] Optionally, to improve the anti-interference performance of the first sound signal, the bandwidth of the first sound signal may be greater than the first bandwidth, where the bandwidth of the first sound signal may refer to the difference between the lowest frequency and the highest frequency of the first sound signal. The wider the bandwidth of the first sound signal, the stronger the anti-interference capability of the first sound signal, which can reduce noise interference.

[0059] Optionally, the confidence and anti-interference ability of the encoded signal are stronger than those of the unencoded signal. In order to improve the anti-interference performance of the first sound signal, the first sound signal can be encoded according to the encoding rules, and then the encoded first sound signal can be played through the speaker, and the encoded first sound signal played by the speaker can be collected through the microphone, and the encoded first sound signal played by the speaker can be decoded according to the decoding rules to obtain the second sound signal.

[0060] Optionally, the energy value of the first sound signal may be smaller than the first energy value. In this way, when the electronic device 100 plays the first sound signal through the speaker, the energy value of the first sound signal is small, making it almost imperceptible to the user's ears and not affecting the normal use of the electronic device 100.

[0061] Optionally, because the bandwidth of the first sound signal is relatively wide, if the frequency of the first sound signal includes the frequency range audible to the human ear, the user may hear the first sound signal when the electronic device 100 plays it, affecting the user experience. Based on this, the electronic device 100 can play the first sound signal while playing other audio to reduce the user's perception of the first sound signal played by the electronic device 100. The other audio may include, but is not limited to, music, video, alarm, incoming call ringtone, outgoing call ringtone, etc.

[0062] In this way, the electronic device 100 can not only detect microphone failure, but also determine the type of microphone failure, and prompt the user to take relevant measures to solve the microphone failure, thereby improving user experience.

[0063] Next, the specific implementation of detecting microphone failure by the electronic device 100 provided in this application is described with reference to the UI diagram.

[0064] In some embodiments, the electronic device 100 can generate a first sound signal while playing other audio, mix the other audio and the first sound signal to obtain a mixed signal, and then the electronic device 100 plays the mixed signal. The microphone of the electronic device 100 can collect sound signals and detect whether the microphone of the electronic device 100 is faulty based on the sound signals collected by the microphone of the electronic device 100. In this way, while playing other audio, the electronic device 100 plays the first sound signal for detecting whether the microphone is faulty, so that the user is unaware of the first sound signal played by the electronic device 100, and does not affect the user's usage experience. In this way, the electronic device 100 can actively detect whether the microphone of the electronic device 100 is faulty.

[0065] For example, other audio may include but is not limited to music, video, alarm, reminder sound, etc.

[0066] Figure 1A-1G The diagram shows a UI for detecting whether the microphone of the electronic device 100 is faulty when the electronic device 100 is playing music.

[0067] Figure 1A The desktop of electronic device 100 is shown. The desktop of electronic device 100 displays application icons for multiple applications, such as a weather application icon, a stock application icon, a calculator application icon, a settings application icon, an email application icon, a music application icon, a video application icon, a browser application icon, a map application icon, a gallery application icon, a memo application icon, a voice assistant application icon, and a photo application icon. A page indicator is also displayed below the multiple application icons to indicate the total number of pages on the desktop and the position of the currently displayed page in relation to other pages. For example, the desktop may include three pages, and a white dot in the page indicator may indicate that the currently displayed page is the rightmost of the three pages. Optionally, multiple tray icons (such as a dialer application icon, a messaging application icon, a contacts application icon, and a camera application icon) are located below the page indicator. The tray icons remain displayed when switching between pages. Optionally, a status bar is displayed in a portion of the upper area of the desktop. The status bar may include: one or more signal strength indicators for a mobile communication signal (also known as a cellular signal), a battery status indicator, a time indicator, and the like.

[0068] For example, Figure 1A As shown, the electronic device 100 can receive a user input operation (such as a single click) for the music application icon on the desktop, and in response to the user's input operation, the electronic device 100 can display Figure 1B User interface 1100 is shown. User interface 1100 is the main interface of the music application provided in the embodiment of the present application. User interface 1100 may include the song title "AAA", the total duration of the song, the duration of the song played, a playback progress bar, a start / pause music playback option, a play previous song option, a play next song option, etc.

[0069] When the electronic device 100 plays the music "AAA", the electronic device 100 may generate a first sound signal, mix the music and the first sound signal to obtain a mixed signal, and then the electronic device 100 plays the mixed signal.

[0070] Afterwards, the electronic device 100 can collect an audio signal through the microphone. The electronic device 100 can determine whether there is a microphone failure and the type of microphone failure based on the collected audio signal and the first audio signal played by the electronic device 100. After determining the type of microphone failure, the electronic device 100 can display a prompt message to indicate the type of microphone failure on the current electronic device 100.

[0071] In some embodiments, the electronic device 100 may determine that the microphone failure is a blocked state. In response to determining that the microphone failure is a blocked state, the electronic device 100 may display Figure 1C Prompt message 1200 shown includes the audio quality collected by electronic device 100 and a prompt message. If the audio quality is "Fair," the prompt message may include "Microphone is blocked, please do not block the microphone." This prompt message 1200 is used to inform the user that the microphone of electronic device 100 is currently blocked, resulting in poor audio quality.

[0072] After the electronic device 100 displays the prompt message 1200, the user can remove the obstruction near the microphone of the electronic device 100, such as removing the fingers or clothes near the microphone, so that there is no obstruction near the microphone of the electronic device 100. After that, the electronic device 100 can continue to detect the fault of the microphone of the electronic device 100 in the above manner. After the electronic device 100 determines that the microphone is not faulty, the electronic device 100 can display Figure 1DThe prompt information 1300 shown includes the audio quality collected by the electronic device 100 and prompt information. The audio quality is "good" and the prompt information may include "microphone is in good condition." The prompt information 1300 is used to remind the user that the microphone of the current electronic device 100 is not faulty.

[0073] In some embodiments, the electronic device 100 may determine that the microphone failure is a friction state. In response to determining that the microphone failure is a friction state, the electronic device 100 may display Figure 1E Prompt message 1400 is shown. Prompt message 1400 includes the audio quality collected by electronic device 100 and a prompt message. The audio quality is "Fair," and the prompt message may include "Microphone friction detected. Please do not rub the microphone." This prompt message 1400 is used to inform the user that an object is rubbing against the microphone of electronic device 100, resulting in poor audio quality.

[0074] After the electronic device 100 displays the prompt message 1400, the user can remove the obstruction near the microphone of the electronic device 100, for example, take the electronic device 100 out of a pocket or a bag so that there is no object rubbing against the microphone of the electronic device 100. After that, the electronic device 100 can continue to detect the fault of the microphone of the electronic device 100 in the above manner. After the electronic device 100 determines that the microphone is not faulty, the electronic device 100 can display a similar Figure 1D The prompt information 1300 shown is used to remind the user that the microphone of the current electronic device 100 is not faulty.

[0075] In some embodiments, the electronic device 100 may determine that the microphone failure is a failure state. In response to determining that the microphone failure is a failure state, the electronic device 100 may display Figure 1F Prompt message 1500 is shown. Prompt message 1500 includes the audio quality collected by electronic device 100 and a prompt message. The audio quality is "Fair," and the prompt message may include "Microphone failure detected. Please visit an accessory outlet to replace the microphone component." This prompt message 1500 is used to inform the user that the microphone component of electronic device 100 has a hardware problem, resulting in poor audio quality and requiring prompt replacement.

[0076] Optionally, after determining that the microphone fault is in a failure state, the electronic device 100 can also search for maintenance outlets near the electronic device 100 and recommend them to the user for viewing, so that the user can go to the nearby maintenance outlets to check and replace the microphone device of the electronic device 100 in time.

[0077] In some embodiments, the electronic device 100 may determine that the microphone failure is a noise state. In response to determining that the microphone failure is a noise state, the electronic device 100 may display Figure 1G Prompt message 1600 is shown. Prompt message 1600 includes the audio quality collected by electronic device 100 and a prompt message. The audio quality is "Fair," and the prompt message may include "Microphone noise detected. Please visit a nearby location to check if the microphone is faulty." This prompt message 1600 informs the user that the microphone of electronic device 100 has a hardware problem, resulting in poor audio quality and requiring prompt inspection, repair, or replacement.

[0078] Optionally, after determining that the microphone failure is in a noise state, the electronic device 100 can also search for maintenance outlets near the electronic device 100 and recommend them to the user for viewing, so that the user can go to the nearby maintenance outlets in time to check, repair or replace the microphone device of the electronic device 100.

[0079] In some embodiments, the electronic device 100 may generate a first sound signal while playing other audio and may collect audio signals through a microphone, mix the other audio and the first sound signal to obtain a mixed signal, and then play the mixed signal. The microphone of the electronic device 100 can collect sound signals and detect whether the microphone of the electronic device 100 is faulty based on the sound signals collected by the microphone of the electronic device 100. In this way, when the electronic device 100 is about to use the microphone, it is detected whether the microphone of the electronic device 100 is faulty. This not only can actively detect whether the microphone of the electronic device 100 is faulty, but also can reduce the frequency of the electronic device 100 detecting whether the microphone is faulty.

[0080] For example, the other audio may be an incoming call ringtone or an outgoing call ringtone of a real-time call, etc. The real-time call may be a carrier call or an instant messaging application call.

[0081] Figures 2A-2K The diagram shows a UI for detecting whether the microphone of the electronic device 100 is faulty when the electronic device 100 plays an incoming call ringtone or an outgoing call ringtone.

[0082] In some embodiments, the electronic device 100 can proactively call another device and play an outgoing call ringtone before the call is answered.

[0083] For example, Figure 2A As shown, the electronic device 100 can receive an input (such as a single click) from a user on a phone application icon. In response to the input operation, the electronic device 100 can display an image as shown in FIG. Figure 2B The user interface shown. Figure 2BIt is a user interface 210 of a call service provided by an electronic device 100 according to an embodiment of the present application, and can also be called a call record interface.

[0084] like Figure 2B As shown, multiple call records are displayed in the user interface 210. The time of one of the call records is 20:15, the user name is "User 2", and the phone number of "User 2" is "xxxxxxx". The time of one of the call records is 19:38, the user name is "Mom", and the phone number of "Mom" has been hidden. The time of one of the call records is 19:20, the user name is "Dad", and the phone number of "Dad" has been hidden. The time of one of the call records is yesterday, the user name is "Xiao Zhao", and the phone number of "Xiao Zhao" has been hidden. The time of one of the call records is yesterday, the user name is "Xiao Zhang", and the phone number of "Xiao Zhang" has been hidden. The time of one of the call records is yesterday, the user name is "Xiao Li", and the phone number of "Xiao Li" has been hidden.

[0085] The electronic device 100 can receive a user operation to call other users in the call record interface.

[0086] like Figure 2B As shown, the electronic device 100 can receive a user input operation (such as a single click) for a contact option in the user interface, and in response to the user's input operation, the electronic device 100 can display Figure 2C User interface 220 is shown. User interface 220 displays the names of multiple contacts, such as "1-Lao Wang," "Andy," "Anna," "Mom," and "Birtney." Electronic device 100 can accept a user input operation (e.g., a single click) for a contact option and, in response to the user's input operation, display detailed information about the contact.

[0087] For example, Figure 2C As shown, the electronic device 100 can receive the user's input operation (such as a single click) for the "Mom" option in the user interface 220. In response to the user's input operation, the electronic device 100 can display Figure 2D The user interface 230 shown is the detailed information interface of the contact "Mom".

[0088] like Figure 2D As shown, the user interface shows the mobile phone number "188********" of the contact "Mom", the landline number "07558280****" of the contact "Mom", and the call record with the contact "Mom" "Yesterday 11:30, incoming call 34 seconds", etc.

[0089] like Figure 2D As shown, the electronic device 100 can receive a user input operation (such as a single click) for the mobile phone number option in the user interface 230. In response to the user's input operation, the electronic device 100 can make a call to the electronic device used by the contact "Mom" and display Figure 2E User interface 240 is shown.

[0090] User interface 240 may also be referred to as a call waiting interface. User interface 240 includes multiple call options, such as an end call option, a dial pad option, a speaker on / off option, a recording option, an add call option, a video call option, a mute option, a contact option, and the like. User interface 240 also includes a prompt message, which informs the user that a call is currently being made, but the call has not yet been successfully established.

[0091] The End Call option is used to end the current call. After the electronic device 100 ends the current call, the electronic device 100 may display Figure 2D User interface 230 is shown.

[0092] The dial pad option can be used to receive user operation to display the dial pad.

[0093] The speaker on / off option is used to turn on or off the speaker of the electronic device 100. When the speaker of the electronic device 100 is turned on, the electronic device 100 can play the audio of the call through the speaker to increase the volume of the audio played by the electronic device 100. When the speaker of the electronic device 100 is turned off, the electronic device 100 can stop playing the audio of the call through the speaker and play the audio of the call through the speaker of the electronic device 100. The volume of the audio of the call played by the electronic device 100 through the speaker is lower than the volume of the audio of the call played by the electronic device 100 through the speaker.

[0094] The recording option can be used to receive user operations to save the audio of the call locally.

[0095] The Add Call option can be used to receive user operations to add another call connection to achieve multi-way calls.

[0096] The video call option can be used to receive user operations to turn on the camera of the electronic device 100, allowing the electronic device 100 to conduct a video call with other devices. That is, while playing the call audio, it can also display the image captured by the camera of the other device. In some embodiments, the electronic device 100 can also display the image captured by the camera of the local device.

[0097] The mute option may be used to receive a user operation to turn off the speaker of the electronic device 100 , so that the electronic device 100 plays audio silently.

[0098] The Contacts option can be used to receive user actions to display the Contacts interface, such as Figure 2C User interface 220 is shown.

[0099] In some embodiments, the electronic device 100 may also receive a user input operation for the "Mom" option in the user interface 210, call the contact "Mom", and display Figure 2E User interface 240 is shown.

[0100] The electronic device 100 displays Figure 2E In the user interface 240 shown, before the call with the contact "Mom" is connected, the electronic device 100 can play an outgoing ringtone to remind the user that the electronic device 100 is calling the contact "Mom".

[0101] In some embodiments, when the electronic device 100 plays an outgoing ringtone, the electronic device 100 can generate and play a first sound signal, and detect whether the microphone of the electronic device 100 is faulty through the first sound signal, so as to avoid poor call quality due to microphone failure when the electronic device 100 is talking to the contact "Mom".

[0102] In some embodiments, the electronic device 100 may also receive call requests initiated by other contacts and establish call connections with other contacts.

[0103] For example, Figure 2F As shown, after the electronic device 100 receives the call establishment request sent by the device of another contact, the electronic device 100 may display Figure 2F The user interface 250 shown is a call request interface sent by the electronic device used by the contact "Mom". The user interface 250 includes an end call control and a receive call control.

[0104] like Figure 2F As shown, the electronic device 100 may receive a user input operation (e.g., a single click) for the accept call control in the user interface 250. In response to the user input operation, the electronic device 100 agrees to establish a call connection with the electronic device used by the contact "Mom". The electronic device 100 may also receive a user input operation (e.g., a single click) for the end call control in the user interface 250. In response to the user input operation, the electronic device 100 refuses to establish a call connection with the electronic device used by the contact "Mom".

[0105] The electronic device 100 displays Figure 2EIn the user interface 250 shown, before the call with the contact "Mom" is connected, the electronic device 100 can play an incoming call ringtone to prompt the user that the electronic device 100 has received an incoming call request sent by another device.

[0106] In some embodiments, when the electronic device 100 plays an incoming call ringtone, the electronic device 100 can generate and play a first sound signal, and detect whether the microphone of the electronic device 100 is faulty through the first sound signal, thereby avoiding the situation where the electronic device 100 has poor call quality due to microphone failure when talking to the contact "Mom".

[0107] The following embodiments of the present application illustrate how the electronic device 100 detects whether the microphone of the electronic device 100 is faulty after receiving a call establishment request sent by a device of another contact.

[0108] When the electronic device 100 plays the incoming call ring tone, the electronic device 100 may generate a first sound signal, mix the incoming call ring tone and the first sound signal to obtain a mixed signal, and then the electronic device 100 plays the mixed signal.

[0109] Afterwards, the electronic device 100 can collect an audio signal through the microphone. The electronic device 100 can determine whether there is a microphone failure and the type of microphone failure based on the collected audio signal and the first audio signal played by the electronic device 100. After determining the type of microphone failure, the electronic device 100 can display a prompt message to indicate the type of microphone failure on the current electronic device 100.

[0110] In some embodiments, the electronic device 100 may determine that the microphone failure is a blocked state. In response to determining that the microphone failure is a blocked state, the electronic device 100 may display Figure 2G Prompt message 2100 shown includes the audio quality collected by electronic device 100 and a prompt message. The audio quality is "Fair," and the prompt message may include "Microphone is detected to be blocked. Please do not block the microphone." This prompt message 2100 is used to inform the user that the microphone of electronic device 100 is currently blocked, resulting in poor audio quality.

[0111] After the electronic device 100 displays the prompt message 2100, the user can remove the obstruction near the microphone of the electronic device 100, such as removing a finger or other object, so that there is no obstruction near the microphone of the electronic device 100. After that, the electronic device 100 can continue to detect the fault of the microphone of the electronic device 100 in the above manner. After the electronic device 100 determines that the microphone is not faulty, the electronic device 100 can display Figure 2HThe prompt information 2200 shown includes the audio quality collected by the electronic device 100 and prompt information. The audio quality is "good" and the prompt information may include "microphone status is good." The prompt information 2200 is used to remind the user that the microphone of the current electronic device 100 is not faulty.

[0112] In some embodiments, the electronic device 100 may determine that the microphone failure is a friction state. In response to determining that the microphone failure is a friction state, the electronic device 100 may display Figure 2I Prompt message 2300 is shown. Prompt message 2300 includes the audio quality collected by electronic device 100 and a prompt message. The audio quality is "Fair," and the prompt message may include "Microphone is detected to be in a friction state. Please do not rub the microphone." Prompt message 2300 is used to inform the user that an object is currently rubbing against the microphone of electronic device 100, resulting in poor audio quality.

[0113] After the electronic device 100 displays the prompt message 2300, the user can remove the obstruction near the microphone of the electronic device 100, for example, take the electronic device 100 out of a pocket or a bag so that there is no object rubbing against the microphone of the electronic device 100. After that, the electronic device 100 can continue to detect the fault of the microphone of the electronic device 100 in the above manner. After the electronic device 100 determines that the microphone is not faulty, the electronic device 100 can display a similar Figure 2H The prompt information 2200 shown is used to remind the user that the microphone of the current electronic device 100 is not faulty.

[0114] In some embodiments, the electronic device 100 may determine that the microphone failure is a failure state. In response to determining that the microphone failure is a failure state, the electronic device 100 may display Figure 2J Prompt message 2400 is shown. Prompt message 2400 includes the audio quality collected by electronic device 100 and a prompt message. The audio quality is "Fair," and the prompt message may include "Microphone failure detected. Please visit an accessory outlet to replace the microphone component." This prompt message 2400 is used to inform the user that the microphone component of electronic device 100 has a hardware problem, resulting in poor audio quality and requiring prompt replacement.

[0115] Optionally, after determining that the microphone fault is in a failure state, the electronic device 100 can also search for maintenance outlets near the electronic device 100 and recommend them to the user for viewing, so that the user can go to the nearby maintenance outlets to check and replace the microphone device of the electronic device 100 in time.

[0116] In some embodiments, the electronic device 100 may determine that the microphone failure is a noise state. In response to determining that the microphone failure is a noise state, the electronic device 100 may display Figure 2K Prompt message 2500 is shown. Prompt message 2500 includes the audio quality collected by electronic device 100 and a prompt message. The audio quality is "Fair," and the prompt message may include "Microphone noise detected. Please visit a nearby location to check if the microphone is faulty." This prompt message 2500 informs the user that the microphone of electronic device 100 has a hardware problem, resulting in poor audio quality and requiring prompt inspection, repair, or replacement.

[0117] Optionally, after determining that the microphone failure is in a noise state, the electronic device 100 can also search for maintenance outlets near the electronic device 100 and recommend them to the user for viewing, so that the user can go to the nearby maintenance outlets in time to check, repair or replace the microphone device of the electronic device 100.

[0118] In some embodiments, the electronic device 100 may also detect whether the microphone of the electronic device 100 is faulty during a call with an electronic device used by a contact, and prompt the user.

[0119] Figure 3 A schematic diagram of the functional modules of an audio acquisition method provided in this application.

[0120] like Figure 3 As shown, the functional modules on the electronic device 100 may include but are not limited to: a signal generating module, a sound mixing module, a microphone fault detection module, a prompt module, etc.

[0121] The signal generating module is used to generate a first sound signal, and the first sound signal is used to detect whether the microphone of the electronic device 100 has a fault.

[0122] Optionally, the signal generating module may generate a first sound signal for detecting whether the microphone of the electronic device 100 is faulty when it detects that the electronic device 100 is playing other audio. In this way, if the frequency of the first sound signal is within the frequency range audible to the human ear, the user may hear the first sound signal when the electronic device 100 plays it, affecting the user experience. To avoid affecting the user experience, the electronic device 100 may generate and play the first sound signal while playing audio, so as not to affect the user's normal use of the electronic device 100.

[0123] Optionally, to improve the anti-interference performance of the first sound signal, the bandwidth of the first sound signal may be greater than the first bandwidth. Since the bandwidth of the noise signal is relatively narrow, a wider bandwidth of the first sound signal improves the anti-interference capability of the first sound signal, thereby avoiding noise interference. The bandwidth of the first sound signal may refer to the difference between the lowest frequency and the highest frequency of the first sound signal.

[0124] Optionally, the energy value of the first sound signal may be smaller than the first energy value. In this way, when the electronic device 100 plays the first sound signal or encodes the first sound signal through the speaker, the energy value of the first sound signal is small, making it almost imperceptible to the user's ears and not affecting the user's normal use of the electronic device 100.

[0125] In some embodiments, the signal generating module is further configured to send the first sound signal to the signal encoding module.

[0126] The signal encoding module is configured to encode the first sound signal according to the encoding rules to obtain an encoded first sound signal. The encoded signal has a higher confidence level and stronger anti-interference capability than the unencoded signal. The electronic device 100 may encode the first sound signal according to the encoding rules to obtain the encoded first sound signal, and then play the encoded first sound signal to improve the anti-interference capability of the first sound signal.

[0127] The signal encoding module is further configured to send the encoded first sound signal to the mixing module.

[0128] The audio mixing module is used to obtain other audio and mix the other audio with the encoded first sound signal to obtain a mixed sound signal.

[0129] Optionally, the electronic device 100 may not encode the first sound signal, but directly mix the first sound signal with other audio to obtain a mixed sound signal.

[0130] The sound mixing module is further configured to send the mixed sound signal to the microphone fault detection module.

[0131] A microphone failure detection module is used to play the mixed sound signal through the speaker.

[0132] The microphone fault detection module is further configured to collect a second sound signal through the microphone.

[0133] The microphone fault detection module is further configured to determine the similarity between the first sound signal and the second sound signal, and determine that the microphone is faulty when the similarity is less than a first threshold, or determine that the microphone is not faulty when the similarity is greater than the first threshold.

[0134] Optionally, after the microphone captures the second sound signal, if the second sound signal is an encoded signal, the microphone fault detection module may further decode the second sound signal according to a decoding rule to obtain an unencoded second sound signal. The microphone fault detection module may then compare the similarity between the first sound signal and the unencoded second sound signal.

[0135] Optionally, encoding and decoding may be inverse processes, and the encoding rules and decoding rules may also be inverse rules.

[0136] The microphone fault detection module is further used to determine the type of microphone fault after determining that the microphone has a fault. The microphone fault type includes but is not limited to any one or more of the following: microphone failure, microphone blockage, microphone friction and microphone noise.

[0137] Microphone failure may refer to a fault in a microphone device, resulting in poor quality of audio collected by the microphone.

[0138] Microphone blockage can refer to a fault type in which there is no problem with the microphone component, but foreign objects (such as fingers or clothing) block the microphone, resulting in poor audio quality collected by the microphone.

[0139] Microphone friction can refer to a type of fault in which there is no problem with the microphone device, but foreign objects rub back and forth near the microphone, resulting in poor audio quality collected by the microphone.

[0140] Microphone noise can also refer to a faulty microphone component, resulting in poor audio quality. However, the specific causes of microphone noise and microphone failure can differ. Alternatively, when the microphone failure is characterized by microphone noise, the audio quality collected by the microphone is better than when the microphone failure is characterized by microphone failure.

[0141] For information on how the microphone fault detection module determines the type of microphone fault, please refer to Figure 4 The description in the embodiments is not repeated here.

[0142] The microphone fault detection module is further configured to send the microphone fault type to the prompt module after determining the microphone fault type.

[0143] The prompt module is used to display prompt information after receiving the microphone fault type, and the prompt information is used to indicate the microphone fault type.

[0144] Figure 4 A flowchart of a microphone fault detection method provided in this application.

[0145] S401: The electronic device 100 generates a first sound signal.

[0146] When it is necessary to detect whether the microphone on the electronic device 100 is faulty, the electronic device 100 may generate a first sound signal.

[0147] In some embodiments, the electronic device 100 may generate a first sound signal for detecting whether the microphone of the electronic device 100 is faulty when it detects that the electronic device 100 is playing other audio. In this way, if the frequency of the first sound signal includes the frequency range audible to the human ear, when the electronic device 100 plays the first sound signal, the user may hear it, affecting the user experience. In order not to affect the user experience, the electronic device 100 may generate and play the first sound signal when playing other audio, so as not to affect the user's normal use of the electronic device 100. Exemplarily, other audio can be music, video, alarm, reminder tone, and other audio that does not require the use of a microphone.

[0148] In some embodiments, the electronic device 100 may generate a first sound signal for detecting whether the microphone of the electronic device 100 is faulty when it detects that the electronic device 100 is playing other audio and is about to use the microphone to collect audio. In this way, on the one hand, the electronic device 100 can generate and play the first sound signal when playing other audio, without affecting the user's normal use of the electronic device 100. On the other hand, before the electronic device 100 is about to use the microphone to collect audio, the electronic device 100 can actively detect whether the microphone is faulty, so that when using the microphone to collect audio, the user can know whether the microphone is faulty. For example, other audio can be audio that requires the use of a microphone, such as an incoming call ringtone or an outgoing call ringtone.

[0149] Optionally, to improve the anti-interference performance of the first sound signal, the bandwidth of the first sound signal may be greater than the first bandwidth. In this way, the bandwidth of the noise signal is relatively narrow. A wider bandwidth of the first sound signal increases the anti-interference capability of the first sound signal, thereby preventing noise interference. The bandwidth of the first sound signal may refer to the difference between the lowest and highest frequencies of the first sound signal.

[0150] Optionally, the energy value of the first sound signal may be smaller than the first energy value. In this way, when the electronic device 100 plays the first sound signal through the speaker, the energy value of the first sound signal is small, making it almost imperceptible to the user's ears and not affecting the user's normal use of the electronic device 100.

[0151] Optionally, the electronic device 100 may encode the first sound signal to obtain an encoded first sound signal. The encoded signal has a higher confidence level and stronger anti-interference capability than the unencoded signal. The electronic device 100 may encode the first sound signal according to the encoding rule to obtain the encoded first sound signal, and then play the encoded first sound signal to improve the anti-interference capability of the first sound signal.

[0152] S402: The electronic device 100 plays other audio and the first sound signal.

[0153] After generating the first sound signal, the electronic device 100 can play other audio and the first sound signal simultaneously through the speaker. In this way, the user does not perceive that the electronic device 100 plays the first sound signal, and the user's experience of using the electronic device 100 is not affected.

[0154] Optionally, the electronic device 100 may mix other audio and the first sound signal to obtain a mixed sound signal, and then play the mixed sound signal.

[0155] S403: The electronic device 100 collects a second sound signal through a microphone.

[0156] After the electronic device 100 plays other audio and the first sound signal, the electronic device 100 may collect sound signals through the microphone, for example, collect and obtain a second sound signal.

[0157] Optionally, the second sound signal may be a sound signal collected by a microphone on the electronic device 100 and corresponding to the first sound signal played by the electronic device 100 through a speaker.

[0158] S404: The electronic device 100 needs to determine whether the similarity between the first sound signal and the second sound signal is greater than a first threshold.

[0159] After the electronic device 100 plays the first sound signal through the speaker and collects the second sound signal through the microphone, the electronic device 100 needs to determine the similarity between the first sound signal and the second sound signal to determine whether the microphone on the electronic device 100 is faulty.

[0160] Optionally, before playing the first sound signal, if the electronic device 100 encodes the first sound signal according to the encoding rules and then plays it out, the second sound signal collected by the electronic device 100 is also an encoded sound signal. The electronic device 100 further needs to decode the second sound signal according to the decoding rules to obtain an unencoded second sound signal, and then compare the similarity between the first sound signal and the unencoded second sound signal.

[0161] Optionally, encoding and decoding may be inverse processes, and the encoding rules and decoding rules may also be inverse rules.

[0162] When the similarity between the first sound signal and the second sound signal is greater than the first threshold, it can be determined that there is no fault in the microphone of the electronic device 100 .

[0163] When the similarity between the first sound signal and the second sound signal is less than the first threshold, it can be determined that the microphone on the electronic device 100 is faulty.

[0164] In some embodiments, the electronic device 100 decodes the second sound signal according to the decoding rule and then determines the similarity between the first sound signal and the second sound signal, which can also be referred to as the decoding success rate of the second sound signal. If the decoding success rate of the second sound signal is greater than a first threshold, it can be determined that the microphone on the electronic device 100 is not faulty. If the decoding success rate of the second sound signal is less than the first threshold, it can be determined that the microphone on the electronic device 100 is faulty.

[0165] When it is determined that the similarity between the first sound signal and the second sound signal is less than the first threshold, it is determined that the microphone is faulty, and S405 to S408 are executed.

[0166] If it is determined that the similarity between the first sound signal and the second sound signal is greater than the first threshold, it is determined that there is no fault in the microphone, and the process ends.

[0167] S405: When the similarity between the first sound signal and the second sound signal is less than a second threshold, the electronic device 100 determines that the microphone fault type is microphone failure.

[0168] S406: When the similarity between the first sound signal and the second sound signal is greater than the second threshold and less than the first threshold, the electronic device 100 determines that the microphone fault type is microphone blockage.

[0169] After determining that the similarity between the first sound signal and the second sound signal is less than the first threshold, the electronic device 100 can calculate the energy value of the second sound signal. If the energy value of the second sound signal is less than the second energy value, it indicates that the microphone failure type can be either microphone failure or microphone blockage.

[0170] The electronic device 100 needs to further determine whether the microphone fault type is microphone failure or microphone blockage.

[0171] Optionally, the electronic device 100 may determine that the microphone fault type is microphone failure or microphone blockage based on the similarity between the first sound signal and the second sound signal.

[0172] In the case of a microphone failure, the microphone is almost unable to collect audio. In the case of a microphone blockage, the microphone can still collect a small amount of audio. The type of microphone failure can be determined based on the similarity between the first sound signal and the second sound signal: microphone failure or microphone blockage.

[0173] For example, when the first sound signal and the second sound signal are less than a second threshold, the electronic device 100 may determine that the microphone has barely captured any audio signal and may determine that the microphone fault type is microphone failure.

[0174] When the first sound signal and the second sound signal are greater than the second threshold and less than the first threshold, the electronic device 100 may determine that the microphone fault type is microphone failure.

[0175] Not limited to the above method, the electronic device 100 can also determine the microphone fault type as microphone failure or microphone blockage based on other methods, and this application does not limit this.

[0176] S407. When the difference in energy values between two adjacent frames of the second sound signal is greater than a preset value, the electronic device 100 inputs the second sound signal into the target model and outputs the microphone fault type through the target model. The microphone fault type is microphone friction or microphone noise.

[0177] After determining that the similarity between the first sound signal and the second sound signal is less than a first threshold, the electronic device 100 may calculate a difference in energy values between two adjacent frames of the second sound signal. If the difference in energy values between the two adjacent frames of the sound signal is greater than a preset value, the microphone fault type may be either microphone friction or microphone noise.

[0178] In order to further distinguish whether the microphone fault type is microphone friction or microphone noise, the electronic device 100 can determine the microphone fault type through a pre-trained target model.

[0179] Optionally, multiple sets of training data can be obtained, such as training data corresponding to the sound signal collected by the microphone when the microphone fault is microphone friction, and training data corresponding to the sound signal collected by the microphone when the microphone fault is microphone noise. The target model is trained using different training data respectively. For example, the training data corresponding to the sound signal collected by the microphone when the microphone fault is microphone friction is input into the target model, and the target model can output the type of microphone fault until the accuracy of the target model outputting the type of microphone fault as microphone friction reaches a preset value. Then, the training data corresponding to the sound signal collected by the microphone when the microphone fault is microphone noise is input into the target model, and the target model can output the type of microphone fault until the accuracy of the target model outputting the type of microphone fault as microphone noise reaches a preset value. After the target model training is completed, the target model can output the type of microphone fault as microphone friction or microphone noise based on the input sound signal.

[0180] It should be noted that the above only shows an example of a training target model and should not be construed as limiting the present application. Other methods can also be used to train the target model.

[0181] Optionally, the target model may be obtained by training the electronic device 100 , or may be trained by other devices and pre-installed on the electronic device 100 .

[0182] Optionally, the electronic device 100 may train the target model periodically / irregularly / at intervals of a certain length based on the collected data to improve the accuracy of the target model output results.

[0183] When it is determined that the difference in energy values between two adjacent frames of sound signals in the second sound signal is greater than a preset difference, the electronic device 100 can input the second sound signal into the target model, and the target model can output the microphone failure type, which is either microphone friction or microphone noise.

[0184] Not limited to the above method, the electronic device 100 can also determine that the microphone fault type is microphone friction or microphone noise based on other methods, and this application does not limit this.

[0185] S408: The electronic device 100 displays first prompt information, where the first prompt information is used to indicate the type of microphone failure.

[0186] After the electronic device 100 determines the type of microphone failure, the electronic device 100 may display prompt information to indicate the type of microphone failure and prompt the user to take corresponding measures to resolve the microphone failure.

[0187] Optionally, after determining that the microphone fault type is microphone blockage, the first prompt information can be Figure 1C The prompt message 1200 or Figure 2G Prompt message 2100 is shown.

[0188] Optionally, after determining that the microphone fault type is microphone friction, the first prompt information can be Figure 1E The prompt message 1400 or Figure 2I Prompt message 2300 is shown.

[0189] Optionally, after determining that the microphone fault type is microphone failure, the first prompt information can be Figure 1F The prompt message 1500 or Figure 2J Prompt message 2400 is shown.

[0190] Optionally, after determining that the microphone fault type is microphone noise, the first prompt information can be Figure 1G The prompt message 1600 or Figure 2K Prompt message 2500 is shown.

[0191] Optionally, after determining that the microphone fault type is microphone failure or microphone noise, the electronic device 100 can also search for maintenance outlets near the electronic device 100 and recommend them to the user for viewing, so that the user can go to a nearby maintenance outlet to check, repair or replace the microphone device of the electronic device 100 in time.

[0192] Figure 5 A flowchart of another microphone fault detection method provided in this application.

[0193] S501: A first electronic device plays an audio to be played and a first sound signal through a speaker.

[0194] In some embodiments, the first electronic device may also be referred to as electronic device 100 .

[0195] Optionally, the first sound signal may be obtained by the first electronic device after obtaining the audio to be played. In some embodiments, the first sound signal may be generated in real time by the first electronic device. The first sound signal may also be pre-set in the first electronic device.

[0196] Optionally, the audio to be played can be music, video, alarm, reminder sound, or other audio that does not require a microphone.

[0197] Optionally, the audio to be played may also be an incoming call ringtone, an outgoing call ringtone, or other audio that requires the use of a microphone.

[0198] S502: The first electronic device receives a second sound signal through a microphone.

[0199] S503: The first electronic device determines the similarity between the first sound signal and the second sound signal.

[0200] S504: When the similarity is less than the first threshold, the first electronic device displays a first prompt message, where the first prompt message is used to prompt the user of the fault type of the microphone, which fault type includes any one or more of the following: microphone blockage, microphone failure, microphone noise, and microphone friction.

[0201] Microphone failure may refer to a fault in the microphone device, resulting in poor quality of audio collected by the microphone.

[0202] Microphone blockage can refer to a fault type in which there is no problem with the microphone component, but foreign objects (such as fingers or clothing) block the microphone, resulting in poor audio quality collected by the microphone.

[0203] Microphone friction can refer to a fault type in which there is no problem with the microphone device, but foreign objects (such as fingers, clothing, etc.) rub back and forth near the microphone, resulting in poor audio quality collected by the microphone.

[0204] Microphone noise can also refer to a faulty microphone component, resulting in poor audio quality. However, the specific causes of microphone noise and microphone failure can differ. Alternatively, when the microphone failure is characterized by microphone noise, the audio quality collected by the microphone is better than when the failure is characterized by microphone failure.

[0205] Optionally, when the similarity is greater than the first threshold, the first electronic device may confirm that there is no microphone failure at present.

[0206] Optionally, the first electronic device may detect microphone failure according to this method periodically / irregularly / at certain intervals.

[0207] Optionally, the first electronic device determines the similarity between the first sound signal and the second sound signal, which may also be referred to as a decoding success rate of the second sound signal. If the decoding success rate of the second sound signal is greater than a first threshold, it can be determined that the microphone on the first electronic device is not faulty. If the decoding success rate of the second sound signal is less than the first threshold, it can be determined that the microphone on the first electronic device is faulty.

[0208] This method allows an electronic device to detect microphone failures through a first sound signal while playing pending audio, and prompt the user to take appropriate measures to resolve the microphone failure. On the one hand, the first electronic device plays the first sound signal while playing pending audio, and the user is almost unaware of the first sound signal. On the other hand, the first electronic device can proactively detect whether the microphone is faulty, preventing any impact on the quality of the audio captured by the microphone on the first electronic device, thereby improving the user experience.

[0209] In one possible implementation, before the first electronic device plays the audio to be played and the first sound signal through a speaker, the method also includes: the first electronic device encodes the first sound signal according to a coding rule to obtain an encoded first sound signal; the first electronic device plays the audio to be played and the first sound signal through the speaker, specifically including: the first electronic device plays the audio to be played and the encoded first sound signal through the speaker; after the first electronic device receives the second sound signal through a microphone, the method also includes: the first electronic device decodes the second sound signal according to a decoding rule to obtain an unencoded second sound signal; the first electronic device determines the similarity between the first sound signal and the second sound signal, specifically including: the first electronic device determines the similarity between the first sound signal and the unencoded second sound signal.

[0210] Optionally, encoding and decoding are inverse to each other, and encoding rules and decoding rules are also inverse to each other. In some embodiments, the encoding rules and decoding rules may be preset in the first electronic device.

[0211] In this way, the confidence and anti-interference ability of the encoded signal are stronger than those of the unencoded signal. The first electronic device can encode the first sound signal for detecting whether the microphone is faulty and then play it out, which can improve the anti-interference ability of the first sound signal.

[0212] In one possible implementation, the bandwidth of the first sound signal is greater than the first bandwidth. Thus, to improve the anti-interference performance of the first sound signal, the bandwidth of the first sound signal may be greater than the first bandwidth. The bandwidth of the first sound signal may refer to the difference between the lowest frequency and the highest frequency of the first sound signal. The wider the bandwidth of the first sound signal, the stronger the anti-interference capability of the first sound signal, thereby reducing noise interference.

[0213] In one possible implementation, the energy value of the first sound signal is less than the first energy value. Thus, when the first electronic device plays the first sound signal through a speaker, the energy value of the first sound signal is small, making it almost imperceptible to the user's ears and not affecting normal use of the first electronic device.

[0214] In one possible implementation, before the first electronic device displays the first prompt information, the method further includes: the first electronic device determining a type of microphone fault. In this way, the first electronic device can not only detect whether the microphone is faulty, but also detect the type of microphone fault, and prompt the user to take appropriate measures to resolve the microphone fault.

[0215] In one possible implementation, when the fault type is microphone failure, the first electronic device determines the fault type of the microphone, specifically including: when the energy value of the second sound signal is less than the second energy value, and the similarity between the first sound signal and the second sound signal is less than a second threshold, the first electronic device determines that the fault type of the microphone is microphone failure, wherein the second threshold is less than the first threshold.

[0216] In one possible implementation, when the fault type is microphone blockage, the first electronic device determines the fault type of the microphone, specifically including: when the energy value of the second sound signal is less than the second energy value, and the similarity between the first sound signal and the second sound signal is greater than a second threshold, the first electronic device determines that the fault type of the microphone is microphone blockage, wherein the second threshold is less than the first threshold.

[0217] In one possible implementation, when the fault type is microphone friction or microphone noise, the first electronic device determines the fault type of the microphone, specifically including: when the difference in energy values of two adjacent frames of sound signals in the second sound signal is greater than a preset difference, the first electronic device inputs the second sound signal into the target model, and determines the fault type as microphone friction or microphone noise through the target model.

[0218] In one possible implementation, before the first electronic device plays the audio to be played and the first sound signal through a speaker, the method also includes: the first electronic device receives a first call connection request sent by the second electronic device; in response to the first call connection request, the first electronic device obtains the audio to be played; or, the first electronic device receives and responds to the first user operation, and sends a second call connection request to the second electronic device; in response to the second call connection request, the first electronic device obtains the audio to be played.

[0219] Optionally, the audio to be played may be an incoming call ringtone or an outgoing call ringtone of a real-time call. The real-time call may be a carrier call or an instant messaging application call.

[0220] In this way, when the first electronic device is about to use the microphone, detecting whether the microphone of the first electronic device is faulty can not only actively detect whether the microphone of the first electronic device is faulty, but also reduce the frequency of the first electronic device detecting whether the microphone is faulty.

[0221] In a possible implementation, the first electronic device plays the audio to be played and the first sound signal through a speaker, specifically including: in response to obtaining the audio to be played, the first electronic device generates a first sound signal; the first electronic device plays the audio to be played and the first sound signal through the speaker.

[0222] In this way, after the first electronic device obtains the audio to be played, ie, determines that the microphone is about to be used, the first electronic device can obtain the first sound signal and play the audio to be played and the first sound signal.

[0223] In one possible implementation, when the fault type is microphone failure or microphone noise, after the first electronic device determines the fault type of the microphone, the method also includes: the first electronic device displays a second prompt message, the second prompt message includes location information of one or more microphone repair outlets, and the second prompt message is used to prompt the user to promptly repair or replace the microphone device on the first electronic device.

[0224] The present application provides an electronic device, which is a first electronic device, comprising a microphone, a memory, and a processor; wherein the microphone, the memory, and the processor are coupled, and the memory is used to store a computer program. When the processor executes and calls the computer program, the first electronic device executes Figure 5 A microphone fault detection method is shown.

[0225] The present application provides a computer-readable storage medium including instructions, which, when executed on a first electronic device, causes the first electronic device to execute Figure 5 A microphone fault detection method is shown.

[0226] The present application provides a computer program product comprising instructions, which, when executed on a first electronic device, causes the first electronic device to execute Figure 5 A microphone fault detection method is shown.

[0227] The present application provides a chip system including one or more processors, which are used to call computer instructions to enable a first electronic device to execute Figure 5 A microphone fault detection method is shown.

[0228] The following describes the hardware structure of an electronic device 100 provided in an embodiment of the present application.

[0229] Figure 6 A schematic diagram of the hardware structure of the electronic device 100 is shown.

[0230] The embodiment will be described in detail below using the electronic device 100 as an example. It should be understood that Figure 6The electronic device 100 shown is only one example, and the electronic device 100 may have more Figure 6 More or fewer components may be shown, two or more components may be combined, or the components may be arranged differently. Figure 6 The various components shown in the drawings may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0231] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0232] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0233] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0234] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0235] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0236] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0237] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby enabling the touch function of the electronic device 100.

[0238] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.

[0239] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0240] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.

[0241] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0242] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0243] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.

[0244] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0245] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.

[0246] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0247] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0248] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0249] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0250] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0251] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0252] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0253] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0254] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display screen panel can also be made of an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniLED, a microLED, a micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0255] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0256] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise and brightness. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0257] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0258] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0259] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0260] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0261] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0262] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0263] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0264] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0265] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0266] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.

[0267] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.

[0268] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0269] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force acts on pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.

[0270] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0271] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.

[0272] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Based on the detected opening and closing status of the case or flip cover, features such as automatic unlocking of the flip cover can be configured.

[0273] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). It can also detect the magnitude and direction of gravity when electronic device 100 is stationary. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.

[0274] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0275] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0276] Ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touches.

[0277] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0278] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the electronic device 100 from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.

[0279] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.

[0280] The bone conduction sensor 180M can obtain vibration signals. In some embodiments, the bone conduction sensor 180M can obtain vibration signals from the vibrating bones of the human body. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure pulse signals. In some embodiments, the bone conduction sensor 180M can also be set in headphones to form bone conduction headphones. The audio module 170 can parse out voice signals based on the vibration signals of the vibrating bones of the human body obtained by the bone conduction sensor 180M to implement voice functions. The application processor can parse heart rate information based on the blood pressure pulse signals obtained by the bone conduction sensor 180M to implement heart rate detection functions.

[0281] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0282] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0283] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0284] The SIM card interface 195 is used to connect a SIM card.

[0285] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.

[0286] Figure 7 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.

[0287] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0288] The application layer can include a series of application packages.

[0289] like Figure 7 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0290] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0291] like Figure 7 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0292] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0293] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0294] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0295] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).

[0296] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0297] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

[0298] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

[0299] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0300] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0301] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0302] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0303] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0304] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0305] A 2D graphics engine is a drawing engine for 2D drawings.

[0306] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0307] The above are only some of the embodiments and implementations of this application. The scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

[0308] It is understood that the various user interfaces described in the embodiments of this application are merely exemplary interfaces and do not limit the scope of this application. In other embodiments, the user interface may adopt a different interface layout, include more or fewer controls, and add or remove other functional options. As long as they are based on the same inventive concept provided by this application, they are all within the scope of protection of this application.

[0309] It should be noted that, without causing any contradiction or conflict, any feature in any embodiment of the present application, or any part of any feature, can be combined, and the combined technical solution is also within the scope of the embodiments of the present application.

[0310] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A microphone fault detection method, characterized in that: The first electronic device includes a microphone and a speaker, and the method includes: The first electronic device plays the audio to be played and the first sound signal through the speaker; The first electronic device receives a second sound signal through the microphone; determining, by the first electronic device, a similarity between the first sound signal and the second sound signal; When the similarity is less than a first threshold, the first electronic device displays a first prompt message, where the first prompt message is used to prompt the user of the fault type of the microphone, and the fault type includes any one or more of the following: microphone blockage, microphone failure, microphone noise, and microphone friction.

2. The method according to claim 1, characterized in that Before the first electronic device plays the audio to be played and the first sound signal through the speaker, the method further includes: The first electronic device encodes the first sound signal according to an encoding rule to obtain an encoded first sound signal; The first electronic device plays the audio to be played and the first sound signal through the speaker, specifically including: The first electronic device plays the audio to be played and the encoded first sound signal through the speaker; After the first electronic device receives the second sound signal through the microphone, the method further includes: The first electronic device decodes the second sound signal according to a decoding rule to obtain an unencoded second sound signal; The first electronic device determines the similarity between the first sound signal and the second sound signal, specifically including: The first electronic device determines a similarity between the first sound signal and the unencoded second sound signal.

3. The method according to claim 1 or 2, characterized in that The bandwidth of the first sound signal is greater than the first bandwidth.

4. The method according to any one of claims 1 to 3, characterized in that The energy value of the first sound signal is less than the first energy value.

5. The method according to any one of claims 1 to 4, characterized in that Before the first electronic device displays the first prompt information, the method further includes: The first electronic device determines the fault type of the microphone.

6. The method according to claim 5, characterized in that When the fault type is failure of the microphone, the first electronic device determines the fault type of the microphone, specifically including: When the energy value of the second sound signal is less than a second energy value and the similarity between the first sound signal and the second sound signal is less than a second threshold, the first electronic device determines that the fault type of the microphone is microphone failure, wherein the second threshold is less than the first threshold.

7. The method according to claim 5 or 6, characterized in that When the fault type is that the microphone is blocked, the first electronic device determines the fault type of the microphone, specifically including: When the energy value of the second sound signal is less than a second energy value and the similarity between the first sound signal and the second sound signal is greater than a second threshold, the first electronic device determines that the fault type of the microphone is microphone blockage, wherein the second threshold is less than the first threshold.

8. The method according to claim 5, characterized in that When the fault type is microphone friction or microphone noise, the first electronic device determines the fault type of the microphone, specifically including: When the difference in energy values between two adjacent frames of sound signals in the second sound signal is greater than a preset difference, the first electronic device inputs the second sound signal into a target model and determines through the target model that the fault type is the microphone friction or the microphone noise.

9. The method according to any one of claims 1 to 8, characterized in that Before the first electronic device plays the audio to be played and the first sound signal through the speaker, the method further includes: The first electronic device receives a first call connection request sent by the second electronic device; In response to the first call connection request, the first electronic device obtains the audio to be played; or, The first electronic device receives and responds to the first user operation, and sends a second call connection request to the second electronic device; In response to the second call connection request, the first electronic device obtains the audio to be played.

10. The method according to claim 9, characterized in that The first electronic device plays the audio to be played and the first sound signal through the speaker, specifically including: In response to acquiring the audio to be played, the first electronic device generates a first sound signal; The first electronic device plays the audio to be played and the first sound signal through the speaker.

11. The method according to any one of claims 1 to 10, characterized in that When the fault type is microphone failure or microphone noise, after the first electronic device determines the fault type of the microphone, the method further includes: The first electronic device displays second prompt information, where the second prompt information includes location information of one or more microphone repair outlets, and the second prompt information is used to prompt the user to repair or replace the microphone device on the first electronic device in a timely manner.

12. An electronic device, being a first electronic device, characterized in that: The first electronic device includes a microphone, a memory, and a processor; wherein the microphone, the memory, and the processor are coupled, and the memory is used to store a computer program. When the processor executes and calls the computer program, the first electronic device executes the method described in any one of claims 1-11.

13. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on the first electronic device, the first electronic device executes the method according to any one of claims 1 to 11.