Audio module detection method, electronic device and computer storage medium

文档序号:1925436 发布日期:2021-12-03 浏览:18次 中文

阅读说明:本技术 音频模块检测方法、电子设备及计算机存储介质 (Audio module detection method, electronic device and computer storage medium ) 是由 冯英群 张立新 于 2021-07-23 设计创作,主要内容包括:本申请提供一种音频模块检测方法、电子设备及计算机存储介质。该音频模块检测方法应用的电子设备包括音频输出模块、第一音频采集模块和第二音频采集模块。该方法包括:当音频输出模块输出第一音频时,通过第一音频采集模块获取第一能量数据,通过第二音频采集模块获取第二能量数据。第一能量数据用于指示第一音频采集模块采集到的第一音频的音量;第二能量数据用于指示第二音频采集模块采集到的第一音频的音量。根据第一能量数据和第二能量数据,确定音频模块是否堵孔。音频模块为音频输出模块、第一音频采集模块、或第二音频采集模块。该方法相比于利用一个音频采集模块采集的能量数据进行检测的方案而言,可以降低误判率。(The application provides an audio module detection method, electronic equipment and a computer storage medium. The electronic equipment applied to the audio module detection method comprises an audio output module, a first audio acquisition module and a second audio acquisition module. The method comprises the following steps: when the audio output module outputs the first audio, the first energy data is acquired through the first audio acquisition module, and the second energy data is acquired through the second audio acquisition module. The first energy data is used for indicating the volume of the first audio collected by the first audio collecting module; the second energy data is used for indicating the volume of the first audio collected by the second audio collecting module. And determining whether the audio module blocks the hole according to the first energy data and the second energy data. The audio module is an audio output module, a first audio acquisition module or a second audio acquisition module. Compared with a scheme of detecting energy data acquired by one audio acquisition module, the method can reduce the misjudgment rate.)

1. The audio module detection method is applied to electronic equipment, and the electronic equipment comprises an audio output module, a first audio acquisition module and a second audio acquisition module; the method comprises the following steps:

when the audio output module outputs a first audio, first energy data is acquired through the first audio acquisition module, and second energy data is acquired through the second audio acquisition module; the first energy data is used for indicating the volume of the first audio collected by the first audio collecting module; the second energy data is used for indicating the volume of the first audio collected by the second audio collecting module;

and determining whether an audio module is blocked according to the first energy data and the second energy data, wherein the audio module is the audio output module, the first audio acquisition module or the second audio acquisition module.

2. The method for detecting an audio module according to claim 1, wherein the determining whether an audio module is plugged according to the first energy data and the second energy data includes:

determining first state information from the first energy data, the first state information indicating whether the first energy data is affected by a plugged hole;

determining second state information from the second energy data, the second state information indicating whether the second energy data is affected by a plugged hole;

determining whether the audio module is jammed based on the first status information and the second status information.

3. The audio module detecting method according to claim 2, wherein the determining whether the audio module is jammed based on the first status information and the second status information specifically includes:

when the audio module is the audio output module, if the first state information indicates that the first energy data is influenced by a blocked hole and the second state information indicates that the second energy data is influenced by a blocked hole, determining that the audio output module is blocked;

when the audio module is the first audio acquisition module, if the first state information indicates that the first energy data is influenced by hole blockage and the second state information indicates that the second energy data is not influenced by hole blockage, determining that the first audio acquisition module is hole blockage;

when the audio module is the second audio acquisition module, if the first state information indicates that the first energy data is not affected by a blocked hole and the second state information indicates that the second energy data is affected by a blocked hole, it is determined that the audio output module is blocked.

4. The audio module detecting method according to claim 2, wherein the determining whether the audio module is jammed based on the first status information and the second status information specifically includes:

when the audio module is the audio output module, if the first state information indicates that the first energy data is influenced by hole blockage, and the second state information indicates that the second energy data is influenced by hole blockage, increasing the first hole blockage times; if the first hole plugging times are larger than first preset hole plugging times, determining that the audio output module is plugged;

when the audio module is the first audio acquisition module, if the first state information indicates that the first energy data is influenced by hole blockage and the second state information indicates that the second energy data is not influenced by hole blockage, increasing second hole blockage times; if the second hole plugging times are larger than second preset hole plugging times, determining that the first audio acquisition module plugs the holes;

when the audio module is the second audio acquisition module, if the first state information indicates that the first energy data is not affected by hole blockage and the second state information indicates that the second energy data is affected by hole blockage, increasing a third hole blockage frequency; and if the third hole plugging times are greater than third preset hole plugging times, determining that the second audio acquisition module plugs the holes.

5. The audio module detecting method according to any one of claims 2 to 4,

the first energy data is: when the audio output module outputs the first audio at a first volume level, the first audio acquisition module acquires the volume at a first level gain or a plurality of second level gains; the first volume level is any one of at least two preset volume levels; the first grade gain is any one grade gain of at least two first preset grade gains; the plurality of second grade gains are any plurality of grade gains in the at least two first preset grade gains;

the second energy data is: when the audio output module outputs the first audio at a second volume level, the first audio acquisition module acquires the volume at a third level gain or a plurality of fourth level gains; the second volume level is any one of the at least two preset volume levels; the third level gain is any one volume level of at least two second preset level gains; the plurality of fourth level gains are any plurality of volume levels in the at least two second preset level gains.

6. The audio module detecting method according to claim 5, wherein the audio module is the audio output module;

the determining first state information from the first energy data includes:

determining the first state information according to first calibration data and the first energy data; wherein the first status information is used to indicate that the first energy data is affected by a plugged hole if the difference between the first calibration data and the first energy data is greater than a first threshold; the first calibration data is the volume acquired by the first audio acquisition module without blocking the hole when the audio output module outputs a second audio under the condition of not blocking the hole;

the determining second state information from the second energy data includes:

determining the second state information according to second calibration data and the second energy data; wherein the second status information is used to indicate that the second energy data is affected by a plugged hole if the difference between the second calibration data and the second energy data is greater than a second threshold; the second calibration data is the volume collected by the second audio collection module without blocking the hole when the audio output module outputs the second audio without blocking the hole.

7. The audio module detecting method of claim 6,

the first energy data is: when the audio output module outputs the first audio at the first volume level, the first audio acquisition module acquires energy data at the first level gain;

the first calibration data is: and when the audio output module outputs the second audio at the first volume level, the first audio acquisition module acquires energy data at the first level gain.

8. The audio module detecting method of claim 6,

the second energy data is: when the audio output module outputs the first audio at the second volume level, the second audio acquisition module acquires energy data at the third level gain;

the second calibration data is: and when the audio output module outputs the second audio at the second volume level, the second audio acquisition module acquires energy data at the third level gain.

9. The audio module detecting method of claim 6,

the first energy data is determined based on a plurality of first detected energy data acquired by the first audio acquisition module; the plurality of first detected energy data is: when the audio output module outputs the first audio at the first volume level, the first audio acquisition module acquires the volume corresponding to each second level gain one by one at the plurality of second level gains;

the first calibration data is determined based on a plurality of first calibration energy data acquired by the first audio acquisition module; the plurality of first calibration energy data are: when the audio output module outputs the second audio at the first volume level, the first audio acquisition module acquires the volume corresponding to each second level gain one by one at the plurality of second level gains.

10. The audio module detecting method of claim 6,

the second energy data is determined based on a plurality of second detected energy data acquired by the second audio acquisition module; the plurality of second detected energy data is: when the audio output module outputs the first audio at the second volume level, the second audio acquisition module acquires the volume corresponding to each fourth level gain one by one at the plurality of fourth level gains;

the second calibration data is determined based on a plurality of second calibration energy data acquired by the second audio acquisition module; the plurality of second calibration energy data are: and when the audio output module outputs the second audio at the second volume level, the second audio acquisition module acquires the volume corresponding to each fourth level gain one by one under the plurality of fourth level gains.

11. The audio module detecting method according to claim 5, wherein the audio module is the first audio capturing module;

the determining first state information from the first energy data includes:

determining the first state information according to whether the first energy data is smaller than a fourth threshold; if yes, the first state information is used for indicating that the first energy data is influenced by a blocked hole;

the determining second state information from the second energy data includes:

determining the second state information according to whether the difference value of the first energy data and the second energy data is smaller than a third threshold value; if so, the second state information is used for indicating that the second energy data is not affected by the blocked hole.

12. The audio module detecting method of claim 11,

the first energy data is: when the audio output module outputs the first audio at the first volume level, the volume acquired by the first audio acquisition module at the first level gain;

the second energy data is: and when the audio output module outputs the first audio at the second volume level, the second audio acquisition module acquires the volume at the third level gain.

13. The audio module detecting method of claim 11,

the first energy data is determined based on a plurality of first detected energy data acquired by the first audio acquisition module; the plurality of first detected energy data is: when the audio output module outputs the second audio at the first volume level, the first audio acquisition module acquires the volume corresponding to each second level gain one by one at the plurality of second level gains;

the second energy data is determined based on a plurality of second detected energy data acquired by the second audio acquisition module; the plurality of second detected energy data is: and when the audio output module outputs the second audio at the second volume level, the second audio acquisition module acquires the volume corresponding to each fourth level gain one by one under the plurality of fourth level gains.

14. The audio module detecting method according to claim 5, wherein the audio module is the second audio capturing module;

the determining first state information from the first energy data includes:

determining the first state information according to whether the difference value of the second energy data and the first energy data is smaller than a fifth threshold value; if yes, the first state information is used for indicating that the first energy data is not influenced by the blocked hole;

the determining second state information from the second energy data includes:

determining the second state information according to whether the second energy data is smaller than a sixth threshold; if so, the second state information is used for indicating that the second energy data is influenced by the blocked hole.

15. The audio module detecting method of claim 14,

the first energy data is: when the audio output module outputs the first audio at the first volume level, the volume acquired by the first audio acquisition module at the first level gain;

the second energy data is: and when the audio output module outputs the first audio at the second volume level, the second audio acquisition module acquires the volume at the third level gain.

16. The audio module detecting method of claim 14,

the first energy data is determined based on a plurality of first detected energy data acquired by the first audio acquisition module; the plurality of first detected energy data is: when the audio output module outputs the first audio at the first volume level, the first audio acquisition module acquires the volume corresponding to each second level gain one by one at the plurality of second level gains;

the second energy data is determined based on a plurality of second detected energy data acquired by the second audio acquisition module; the plurality of second detected energy data is: and when the audio output module outputs the first audio at the second volume level, the second audio acquisition module acquires the volume corresponding to each fourth level gain one by one at the fourth level gains.

17. The audio module detection method of any one of claims 1 to 16, further comprising:

and when the audio module is determined to be blocked, outputting hole blocking prompt information and/or improving the gain value of the audio module.

18. The audio module detecting method according to any one of claims 1 to 17, wherein the electronic device has an opening control for starting an operation of detecting whether the audio module is plugged;

the electronic equipment responds to the opening operation of a user on the opening control, or detects whether the audio module is blocked or not based on a preset period; the preset period is a time interval required for detecting whether the audio module is blocked or not continuously twice.

19. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor executing the computer program to enable the electronic device to implement the audio module detection method of any of claims 1-18.

20. A computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, is operable to implement the audio module detection method of any of claims 1 to 18.

Technical Field

The present application relates to the field of terminal technologies, and in particular, to an audio module detection method, an electronic device, and a computer storage medium.

Background

After the electronic equipment is used for a period of time, the audio acquisition module or the audio output module can be blocked due to the adsorption of impurities, so that the audio effect of a user in the audio using process is influenced, and the user experience is very poor.

Taking a mobile phone as an example, when an audio acquisition module (such as a microphone) of the mobile phone is plugged, an opposite communication terminal can have an unclear listening situation in a call scene; under the recording scene, the problem of undersize sound of the recorded audio file can occur. When an audio output module (such as a receiver and a loudspeaker) of the mobile phone is blocked by impurities, the communication home terminal cannot hear the other party clearly under a conversation scene; under the recording scene, the problem of too small sound can occur when the recorded audio file is played.

At present, aiming at the problem that the audio acquisition module or the audio output module is blocked, an audio acquisition module is generally used for acquiring audio output by the audio output module, and whether the audio acquisition module or the audio output module is blocked is judged according to acquired data, so that misjudgment is easily caused by the scheme.

Disclosure of Invention

The application provides an audio module detection method, electronic equipment and a computer storage medium, which can utilize two energy data collected by two audio collection modules to perform hole plugging detection on an audio module of the electronic equipment and can reduce the misjudgment rate.

In order to achieve the purpose, the technical scheme is as follows:

in a first aspect, the present application provides an audio module detection method. The audio module detection method is applied to electronic equipment. The electronic device includes an audio output module (e.g., speaker a1 or earpiece a2), a first audio capture module (e.g., microphone B1), and a second audio capture module (e.g., microphone B2). The audio module detection method comprises the following steps: when the audio output module outputs the first audio, the first energy data is acquired through the first audio acquisition module, and the second energy data is acquired through the second audio acquisition module. The first energy data is used for indicating the volume of the first audio collected by the first audio collecting module; the second energy data is used for indicating the volume of the first audio collected by the second audio collecting module. It is determined whether the audio module (i.e., the detected audio module) is plugged based on the first energy data and the second energy data. The audio module is an audio output module, a first audio acquisition module or a second audio acquisition module.

It should be understood that, in other embodiments, the first audio capturing module may also be the microphone B2, and the second audio capturing module may also be the microphone B1, which is not specifically limited in this embodiment of the present application.

According to the audio module detection method, the first audio output by the audio output module is collected through the first audio collection module and the second audio collection module, and the hole blocking condition of the audio module is judged according to the collected first energy data and the collected second energy data. Particularly, if the first audio acquisition module is used for acquiring first energy data of a first audio output module, the audio output module outputs the first audio, and the hole blocking condition of the audio module is judged, because the first audio acquisition module and the audio output module can cause the hole blocking problem, the first energy data can be greatly reduced, and therefore, the first audio acquisition module or the audio output module cannot be judged to be in problem only by relying on the first energy data, and misjudgment is easy to occur. In the method, different audio modules are blocked, and the conditions that the first energy data and the second energy quantity are affected are different. Based on the method, the audio module of the blocked hole can be accurately judged according to the difference of the first energy data and the second energy data, so that misjudgment is avoided. On the other hand, no matter the audio module is the audio output module, the first audio acquisition module or the second audio acquisition module, only the two data of the first energy data and the second energy data need to be acquired for detection. In other words, the hole blockage detection of the three modules can be completed only by acquiring one group of data, and the data acquisition process is simple and convenient.

Optionally, determining whether the audio module blocks the hole according to the first energy data and the second energy data specifically includes: first status information is determined from the first energy data, the first status information indicating whether the first energy data is affected by a plugged hole. Second status information is determined from the second energy data, the second status information indicating whether the second energy data is affected by the plugged hole. Based on the first status information and the second status information, it is determined whether the audio module is blocked.

In this example, different audio modules are blocked, the first energy data and the second energy amount are affected differently, and thus the information indicated by the first status information and the second status information is also different. Based on this, according to the difference of first state information and second state information, can carry out accurate judgement to the audio module in stifled hole to avoid the erroneous judgement.

In some embodiments, determining whether the audio module is blocked based on the first status information and the second status information specifically includes: when the audio module is an audio output module, if the first state information indicates that the first energy data is affected by the hole blockage and the second state information indicates that the second energy data is affected by the hole blockage, the hole blockage of the audio output module is determined. When the audio module is a first audio acquisition module, if the first state information indicates that the first energy data is affected by hole blockage and the second state information indicates that the second energy data is not affected by the hole blockage, the first audio acquisition module is determined to be hole blockage. When the audio module is a second audio acquisition module, if the first state information indicates that the first energy data is not affected by the blocked hole and the second state information indicates that the second energy data is affected by the blocked hole, it is determined that the audio output module is blocked.

In this embodiment, since the second energy data and the first energy data are both related to the audio output module, if the audio output module blocks the hole, both the first energy data and the second energy data will be affected. In this case, the first status information indicates that the first energy data is affected by a plugged hole, and the second status information indicates that the second energy data is affected by a plugged hole. If the first audio acquisition module blocks the hole, only the first energy data is affected. In this case, the first status information indicates that the first energy data is affected by a plugged hole, and the second status information indicates that the second energy data is not affected by a plugged hole. If the second audio acquisition module blocks the hole, only the second energy data is affected. In this case, the second status information indicates that the second energy data is affected by a plugged hole, and the first status information indicates that the first energy data is not affected by a plugged hole. Based on different conditions of information indicated by the first state information and the second state information when different audio modules are blocked, which audio module is blocked can be accurately judged.

In other embodiments, determining whether the audio module is blocked based on the first status information and the second status information specifically includes: when the audio module is an audio output module, if the first state information indicates that the first energy data is affected by hole blockage and the second state information indicates that the second energy data is affected by hole blockage, the first hole blockage number (e.g., the hole blockage number in fig. 10 or the hole blockage number in fig. 12) is increased. And if the first hole plugging times are greater than the first preset hole plugging times, determining that the audio output module plugs the holes. When the audio module is the first audio collecting module, if the first state information indicates that the first energy data is affected by hole blockage and the second state information indicates that the second energy data is not affected by hole blockage, the second hole blockage frequency (e.g., the hole blockage frequency in fig. 14) is increased. And if the second hole plugging times are larger than the second preset hole plugging times, determining that the first audio acquisition module plugs the holes. When the audio module is a second audio acquisition module, if the first state information indicates that the first energy data is not affected by the blocked hole and the second state information indicates that the second energy data is affected by the blocked hole, increasing the third hole blocking times; if the third hole plugging frequency is greater than the third preset hole plugging frequency (e.g., the hole plugging frequency in fig. 16), it is determined that the second audio acquisition module plugs the hole.

In this embodiment, compared with the previous embodiment, by adding a condition that the corresponding audio module is blocked when the number of times of blocking is greater than the preset number of times of blocking, the energy data of the first audio at different times can be collected to perform multiple judgments, and compared with the case that only the energy data at one time is collected, because a single data has an accident, the embodiment can reduce the misjudgment rate of the blocked holes.

In some embodiments of the present application, the first energy data is: when the audio output module outputs the first audio at the first volume level, the first audio acquisition module acquires the volume at the first level gain or a plurality of second level gains. The first volume level is any one of at least two preset volume levels; the first grade gain is any one grade gain of at least two first preset grade gains; the plurality of second level gains are any plurality of level gains of at least two first preset level gains. The second energy data is: and when the audio output module outputs the first audio at the second volume level, the first audio acquisition module acquires the volume at the third level gain or a plurality of fourth level gains. The second volume level is any one of at least two preset volume levels; the third level gain is any one volume level of at least two second preset level gains; the plurality of fourth level gains are any plurality of volume levels of the at least two second preset level gains.

In this embodiment, the first volume level and the second volume level may be any volume levels, and the first level gain, the second level gain, the third level gain, and the fourth level gain may also be any level gains, so that the volume level of the audio output module does not need to be adjusted to a specific volume level, and the level gains of the first audio acquisition module and the second audio acquisition module are adjusted to a specific level gain. Therefore, on the first aspect, because the volume level does not need to be adjusted to a specific volume level, the problem that the audio output by the audio output module (such as the speaker a1) is suddenly changed due to the adjustment of the volume level does not exist, and the auditory experience of the user is favorably ensured. Especially for the case that the first audio is the audio output by the audio output module in daily use of the audio output module by the user, the embodiment does not affect the daily use experience of the user on the audio output module. In the second aspect, the weakened volume of the detected audio module due to hole blockage is not constant under different grade gains, and the embodiment performs detection under any grade gain, so that misjudgment caused by data contingency can be avoided. In a third aspect, since the volume level and the level gain set by the user during the daily use of the electronic device are uncertain, and the embodiment supports the execution at any volume level and any level gain, the embodiment can be implemented at any time when the audio output module outputs audio daily.

It should be noted that, in other embodiments, the audio output module of the electronic device may not divide the volume level, or the audio acquisition module may not divide the gain level. In this way, the first energy data and the second energy data can be acquired by the first audio acquisition module and the second audio acquisition module respectively in any condition in the process of outputting the first audio by the audio output module. In this case, the first energy data and the second energy data are still both related to the audio output module, and therefore, when different audio modules are blocked, the affected conditions of the first energy data and the second energy quantity still present different states, so that the audio module with the blocked hole can be accurately judged according to the difference between the affected first energy data and the affected second energy data.

In one possible embodiment, the audio module is an audio output module. The determining the first state information according to the first energy data includes: determining first state information according to the first calibration data and the first energy data; if the difference between the first calibration data and the first energy data is greater than a first threshold, the first status information is used to indicate that the first energy data is affected by a plugged hole. The first calibration data is the volume collected by the first audio collection module without blocking the hole when the audio output module outputs the second audio under the condition of not blocking the hole. The determining second state information according to the second energy data includes: determining second state information according to the second calibration data and the second energy data; and if the difference value between the second calibration data and the second energy data is larger than a second threshold value, the second state information is used for indicating that the second energy data is influenced by hole blockage. The second calibration data is the volume collected by the second audio collection module without blocking the hole when the audio output module outputs the second audio under the condition without blocking the hole.

In other words, if the difference between the first calibration data and the first energy data is greater than the first threshold, and the difference between the second calibration data and the second energy data is greater than the second threshold, it is determined that the audio output module is plugged.

In this design, when audio output module stifled hole, the energy value of the first audio frequency of its output will be cut down to make the first energy data that first audio frequency collection module gathered and the second energy data that second audio frequency collection module gathered all reduce by a wide margin. The difference between the first calibration data and the first energy data, and the difference between the second calibration data and the second energy data are increased. Whether the audio output module is plugged may be determined by determining whether a difference between the first calibration data and the first energy data is greater than a first threshold indicative of plugging of the audio output module (a first condition) and whether a difference between the second calibration data and the second energy data is greater than a second threshold indicative of plugging of the audio output module (a second condition).

It should be noted that, in this design, the energy data collected by the two microphones is used to determine the hole blocking condition of the audio output module, so as to reduce the misjudgment rate for the following reasons: when the audio output module is not plugged, and the first audio acquisition module or the second audio acquisition module is plugged, the microphone in the plugged hole can weaken the energy value of the first audio, so that the first energy data is greatly reduced, the first condition is met, and the situation similar to the plugging of the audio output module occurs. Under the condition, if the hole blocking condition of the audio output module is judged according to the energy data collected by the single microphone, when the first condition is met, the audio output module is determined to be blocked, obviously, the situation is not consistent with the fact that the first audio collection module is blocked and the audio output module is not blocked, and therefore misjudgment is caused. In addition, the probability that a single microphone blocks a hole is high, and the probability that the acquired energy data meets the hole blocking condition is high, so that the probability of misjudgment is high.

In order to judge the audio module with the blocked hole, in the design scheme, a second audio acquisition module is also introduced to acquire the first audio output by the audio output module. When the audio module blocked by the hole is the first audio acquisition module, the second energy data acquired by the second audio acquisition module cannot be influenced, so that the difference value between the second calibration data and the second energy data cannot be increased, the second calibration data is not easily greater than a second threshold value, the second condition of the audio output module for blocking the hole is not met, and the audio output module for blocking the hole cannot be wrongly judged. In other words, unless the audio output module is plugged, it is difficult to make it possible that both the first condition and the second condition are satisfied. In addition, in this design, first audio acquisition module and second audio acquisition module stifled hole simultaneously also can lead to first energy data and second energy data to all reduce by a wide margin to the possibility that first condition and second condition all satisfy appears. However, compared with a scheme of detecting by using a single microphone, the probability that the first audio acquisition module and the second audio acquisition module block the hole at the same time is lower, so that the first audio acquisition module and the second audio acquisition module block the hole at the same time, and the possibility that the first condition and the second condition are both satisfied is met, and therefore, compared with a scheme of detecting by using a single microphone, the embodiment is favorable for reducing the misjudgment rate.

Optionally, if a difference between the first calibration data and the first energy data is greater than a first threshold, and a difference between the second calibration data and the second energy data is greater than a second threshold, the number of times of the first hole plugging is increased. And if the first hole plugging times are greater than the first preset hole plugging times, determining that the audio output module plugs the holes.

In the embodiment, by adding a condition that the audio output module is blocked when the first hole blocking frequency is greater than the first preset hole blocking frequency, the energy data of the first audio at different moments can be collected for multiple times of judgment, and compared with the case that the energy data at one moment is collected, due to the fact that single data has contingency, the design scheme can reduce the misjudgment rate of the blocked holes.

Further, if the difference between the first calibration data and the first energy data is less than or equal to a first threshold, or if the difference between the second calibration data and the second energy data is less than or equal to a second threshold, it is determined whether the first hole plugging frequency is greater than a first preset reference frequency. If the number of the first plugging holes is larger than the preset value, the number of the first plugging holes is reduced.

In this embodiment, when a difference between the first calibration data and the first energy data is greater than a first threshold, or a difference between the second calibration data and the second energy data is greater than a second threshold, it indicates that the current detection result is that the hole is not blocked. Then, in the previous detection process, since the first hole plugging frequency (the part larger than the first preset reference frequency, that is, the part larger than the preset reference frequency in fig. 10 or fig. 12) accumulated as the detection result is the hole plugging may be misjudged, when the current detection result is different from the previous detection result, the accumulated hole plugging frequency is flushed by reducing the first hole plugging frequency, so that it is possible to avoid that the first hole plugging frequency exceeds the first preset hole plugging frequency due to the excessive misjudgment frequency of the single detection, thereby resulting in the final misjudgment result.

Optionally, the first energy data is: when the audio output module outputs a first audio at a first volume level, the first audio acquisition module acquires energy data at a first level gain. The first calibration data is: when the audio output module outputs the second audio at the first volume level, the first audio acquisition module acquires the energy data at the first level gain. In this example, the first energy data and the first calibration data are both obtained at a first volume level and a first level gain, and are comparable and of reference value for determining whether the audio output module is plugged.

Optionally, the second energy data is: and when the audio output module outputs the first audio at the second volume level, the second audio acquisition module acquires the energy data at the third level gain. The second calibration data is: and when the audio output module outputs a second audio at a second volume level, the second audio acquisition module acquires energy data at a third level gain. The effect of this example may refer to the effect of the first energy data and the first calibration data, which is not described herein again.

Optionally, the first energy data is determined based on a plurality of first detected energy data acquired by the first audio acquisition module. Wherein the plurality of first detected energy data is: when the audio output module outputs the first audio at the first volume level, the first audio acquisition module acquires the volume corresponding to each second level gain one by one under the plurality of second level gains. The first calibration data is determined based on a plurality of first calibration energy data acquired by the first audio acquisition module. Wherein the plurality of first calibration energy data are: when the audio output module outputs the second audio at the first volume level, the first audio acquisition module acquires the volume corresponding to each second level gain one by one under the plurality of second level gains.

In this example, the first energy data and the first calibration data are both obtained at a first volume level and a plurality of second level gains, and are comparable and have reference value for determining whether the audio output module is plugged. In addition, the energy value weakened by the blocked hole is not linear after the audio output module is blocked at different grade gains. Therefore, in this example, the first energy data and the first calibration data are determined based on the plurality of first detected energy data and the plurality of first calibration energy data acquired under the plurality of second level gains, respectively, and compared with the detected energy data and the calibration energy data under a single level gain, the hole blocking condition and the hole non-blocking condition of the audio output module can be more accurately characterized, so that a high false judgment rate caused by judgment through the single detected energy data and the calibration energy data with a large deviation is avoided.

Optionally, the second energy data is determined based on a plurality of second detected energy data acquired by the second audio acquisition module. Wherein the plurality of second detected energy data is: when the audio output module outputs the first audio at the second volume level, the second audio acquisition module acquires the volume corresponding to each fourth level gain one by one under the plurality of fourth level gains. The second calibration data is determined based on a plurality of second calibration energy data acquired by the second audio acquisition module. Wherein the plurality of second calibration energy data are: when the audio output module outputs a second audio at a second volume level, the second audio acquisition module acquires the volume corresponding to each fourth level gain one by one under a plurality of fourth level gains. The effect in this example may refer to the effect of the first energy data and the first calibration data, and will not be described herein.

In another possible embodiment, the audio module is a first audio capture module. The determining the first state information according to the first energy data includes: determining first state information according to whether the first energy data is smaller than a fourth threshold value; if so, the first state information is used to indicate that the first energy data is affected by the plugged hole. The determining second state information according to the second energy data includes: determining second state information according to whether the difference value of the first energy data and the second energy data is smaller than a third threshold value; and if so, the second state information is used for indicating that the second energy data is not influenced by the blocked hole.

In other words, if the difference value of the first energy data is smaller than the fourth threshold, and the difference value of the first energy data and the second energy data is smaller than the third threshold, it is determined that the audio output module blocks the hole.

In the design scheme, when the first audio acquisition module blocks the hole, the first audio output module outputs the first audio which is weakened in volume, so that the acquired first energy data is greatly reduced, the second audio acquisition module is not influenced, and the acquired second energy data cannot be influenced, therefore, the difference value between the first energy data and the second energy data is also reduced. Whether the first audio capture module is plugged may be determined by determining whether the first energy data is less than a fourth threshold (a first condition) indicative of plugging of the first audio capture module and whether a difference between the first energy data and the second energy data is less than a third threshold (a second condition) indicative of plugging of the first audio capture module.

It should be noted that, in this design, the energy data acquired by the two microphones is used to determine the hole blocking condition of the first audio acquisition module, so that the misjudgment rate can be reduced for the following reasons: when the audio output module is plugged, and the first audio acquisition module is not plugged, the first energy data can be greatly reduced, the first condition is met, and the situation similar to the plugging of the first audio acquisition module occurs. Under the condition, if the hole blocking condition of the first audio acquisition module is judged according to the energy data acquired by the single microphone, when the first condition is met, the first audio acquisition module is identified, obviously, the hole blocking condition is not consistent with the fact that the audio output module blocks the hole and the first audio acquisition module does not block the hole, and therefore misjudgment is caused. In addition, the probability that a single microphone blocks a hole is high, and the probability that the acquired energy data meets the hole blocking condition is high, so that the probability of misjudgment is high. In order to judge the audio module with the blocked hole, in the design scheme, a second audio acquisition module is also introduced to acquire the first audio output by the audio output module. When the audio module that is blocked up the hole is audio output module, can all produce the influence that reduces by a wide margin to first energy data and second energy data to make the difference value change of first energy data and second energy data can not be too big, be difficult for being less than the third threshold value, unsatisfied the second condition in first audio acquisition module stifled hole, thereby can not judge by mistake and block up the hole for first audio acquisition module. In other words, unless the first audio capture module blocks the hole, it is difficult to have the possibility that both the first condition and the second condition are satisfied.

In another possible embodiment, the audio module is a first audio capture module. The determining whether the audio module blocks the hole according to the first energy data and the second energy data includes: and if the difference value of the first energy data and the second energy data is smaller than a third threshold value and the first energy data is smaller than a fourth threshold value, increasing the second hole plugging times. And if the second hole plugging times are larger than the second preset hole plugging times, determining that the first audio acquisition module plugs the holes. The effect of this embodiment may refer to the specific implementation effect of the related content in the embodiment in which the audio module is an audio output module, and is not described herein again.

Further, the audio module detection method further includes: if the difference between the first energy data and the second energy data is greater than or equal to the third threshold, or if the first energy data is greater than or equal to the fourth threshold, determining whether the second hole plugging frequency is greater than a second preset reference frequency (i.e., the preset reference frequency shown in fig. 14); and if the second plugging frequency is larger than the first plugging frequency, reducing the second plugging frequency. The effect of this embodiment may refer to the specific implementation effect of the related content in the embodiment in which the audio module is an audio output module, and is not described herein again.

Optionally, the first energy data is: when the audio output module outputs a first audio at a first volume level, the first audio acquisition module acquires the volume at a first level gain. The second energy data is: and when the audio output module outputs the first audio at the second volume level, the second audio acquisition module acquires the volume at the third level gain.

In this example, the first energy data and the second energy data are both obtained at a single volume level and a single level gain. Therefore, the first energy data and the second energy data are compared in the same dimension, comparability is achieved, and the comparison result is also referred to judging whether the first audio acquisition module is blocked.

Optionally, the first energy data is determined based on a plurality of third detected energy data acquired by the first audio acquisition module. Wherein the plurality of third detected energy data is: when the audio output module outputs the first audio at the first volume level, the first audio acquisition module acquires the volume corresponding to each second level gain one by one under the plurality of second level gains. The second energy data is determined based on a plurality of fourth detected energy data acquired by the second audio acquisition module. Wherein the fourth detection energy data is: when the audio output module outputs the first audio at the second volume level, the second audio acquisition module acquires the volume corresponding to each fourth level gain one by one under the plurality of fourth level gains.

In this example, the first energy data and the second energy data are each obtained at a single volume level and a plurality of level gains. Therefore, the first energy data and the second energy data are compared in the same dimension, comparability is achieved, and the comparison result is also referred to judging whether the first audio acquisition module is blocked. In addition, in this example, the first energy data is determined based on the plurality of first detected energy data, and the second energy data is determined based on the plurality of second detected energy data, which may refer to the audio module as related content in the audio output module, and details are not repeated here.

In another possible embodiment, the audio module is a second audio capture module. The determining the first state information according to the first energy data includes: determining first state information according to whether the difference value of the second energy data and the first energy data is smaller than a fifth threshold value; if yes, the first state information is used for indicating that the first energy data is not affected by the blocked hole. The determining second state information according to the second energy data includes: determining second state information according to whether the second energy data is smaller than a sixth threshold; and if so, the second state information is used for indicating that the second energy data is influenced by the hole blockage.

Optionally, the audio module is a second audio capture module. The determining whether the audio module blocks the hole according to the first energy data and the second energy data includes: and if the difference value of the first energy data and the second energy data is smaller than a fifth threshold value and the first energy data is smaller than a sixth threshold value, increasing the third hole plugging times. And if the third hole plugging times are larger than the third preset hole plugging times, determining that the second audio acquisition module plugs the holes.

Further, the audio module detection method further includes: if the difference between the second energy data and the first energy data is greater than or equal to the fifth threshold, or if the first energy data is greater than or equal to the sixth threshold, determining whether the third plugging frequency is greater than a third preset reference frequency (i.e., the preset reference frequency shown in fig. 16); and if so, reducing the third plugging times.

Optionally, the first energy data is: when the audio output module outputs a first audio at a first volume level, the first audio acquisition module acquires the volume at a first level gain. The second energy data is: and when the audio output module outputs the first audio at the second volume level, the second audio acquisition module acquires the volume at the third level gain.

Optionally, the first energy data is determined based on a plurality of first detected energy data acquired by the first audio acquisition module. Wherein the plurality of first detected energy data is: when the audio output module outputs the first audio at the first volume level, the first audio acquisition module acquires the volume corresponding to each second level gain one by one under the plurality of second level gains. The second energy data is determined based on a plurality of second detected energy data acquired by the second audio acquisition module. Wherein the plurality of second detected energy data is: when the audio output module outputs the first audio at the second volume level, the second audio acquisition module acquires the volume corresponding to each fourth level gain one by one under the plurality of fourth level gains.

It should be noted that, the implementation effect of the related embodiment in which the audio module is the second audio acquisition module may refer to the implementation effect of the audio module being the first audio acquisition module, and is not described herein again.

Further, the audio module detection method further includes: and when the audio module is determined to be blocked, outputting hole blocking prompt information and/or improving the gain value of the audio module. Therefore, when the user receives the hole plugging prompt message, the audio module can be cleaned in time, so that the audio effect of the audio module is improved; or the gain value of the audio module is increased, and the weakened energy value is compensated, so that the audio effect of the audio module is improved.

In some embodiments of the present application, an electronic device has an open control. The opening control is used for starting the operation of detecting whether the audio module blocks the hole or not. The electronic equipment responds to the opening operation of a user on the opening control, or detects whether the audio module blocks the hole or not based on a preset period; the preset period is a time interval required for detecting whether the audio module is blocked twice continuously. The present embodiment provides two ways to start the process of detecting whether the audio module is plugged. When a user perceives that the audio effect of the audio module is poor in the using process, the user can immediately check whether the audio module is blocked by opening the opening space. The electronic device can also screen the audio module for hole blockage at regular intervals.

Drawings

Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;

fig. 2 is a schematic structural diagram of another electronic device provided in an embodiment of the present application;

fig. 3 is a schematic structural diagram of another electronic device provided in an embodiment of the present application;

fig. 4 is a first scene schematic diagram illustrating an opening audio hole blockage detection function according to an embodiment of the present disclosure;

fig. 5 is a schematic view of a second scenario in which an audio hole blockage detection function is turned on according to an embodiment of the present application;

fig. 6 is a schematic flowchart of an audio module detection method according to an embodiment of the present disclosure;

FIG. 7 is a schematic diagram of an interface for setting level gain and volume level according to an embodiment of the present application;

FIG. 8 is a schematic diagram illustrating a comparison of calibration energy data and detection energy data provided by an embodiment of the present application;

fig. 9 is a schematic view of an interface of a notification bar of hole plugging prompt information according to an embodiment of the present application;

fig. 10 is a schematic flowchart of another audio module detection method according to an embodiment of the present application;

fig. 11 is a schematic flowchart of another audio module detection method according to an embodiment of the present application;

fig. 12 is a schematic flowchart of another audio module detection method according to an embodiment of the present application;

fig. 13 is a schematic flowchart of another audio module detection method according to an embodiment of the present application;

fig. 14 is a schematic flowchart of another audio module detection method according to an embodiment of the present application;

fig. 15 is a schematic flowchart of another audio module detection method according to an embodiment of the present application;

fig. 16 is a flowchart illustrating another audio module detection method according to an embodiment of the present application.

Detailed Description

A typical electronic device includes an audio output module, such as a speaker or earpiece, and an audio acquisition module, such as a microphone. The audio output module is used for converting the electric signal into a sound signal to be output so as to realize audio output; the audio acquisition module is used for converting the sound signal into an electric signal so as to realize audio acquisition. Specifically, the electronic device includes an audio output module and an audio acquisition module, which have different outputs according to different types.

For example, taking a mobile phone as an example, as shown in fig. 1, the electronic device 100 may include two audio output modules, namely, a speaker a1 and a receiver a 2; and two audio acquisition modules, namely a microphone B1 and a microphone B2. As shown in fig. 2, the electronic device 100 may include two audio output modules, speaker a1, earpiece a 2; and three audio acquisition modules, namely a microphone B1, a microphone B2 and a microphone B3. In other embodiments, the electronic device may include other numbers of audio output modules and audio acquisition modules, which are not specifically limited in this application.

It should be understood that the electronic device in the embodiment of the present application may include, in addition to a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a wearable watch, a TV, and other devices that include an audio output module and an audio acquisition module, and the embodiment of the present application does not particularly limit the specific form of the electronic device. It should also be understood that although fig. 1 and 2 exemplify a cellular phone, the case where the audio output module includes a speaker and an earpiece is illustrated. However, the audio output module may be differently arranged for electronic devices of different product forms. For example, the audio output module of the electronic device may also include only a speaker, for example, the TV includes only a speaker, which is not limited in the embodiments of the present application.

However, after the electronic device is used for a period of time, the audio output module and the audio acquisition module are blocked due to the adsorption of impurities, which affects the audio effect of the user in the audio using process, thereby causing poor user experience. In order to check the audio output module or the audio acquisition module of the blocked hole, the embodiment of the application provides an audio module detection method, which can be applied to the electronic device 100 shown in fig. 1 or fig. 2 and can be implemented in the electronic device 100 shown in fig. 3.

Referring to fig. 3, fig. 3 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present disclosure. As shown in fig. 3, the electronic device 100 may include a processor 310, an internal memory 320, a Universal Serial Bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio processing module 370, a speaker 370A, a receiver 370B, a microphone 370C, a sensor module 380, a button 390, a display 391, and the like.

It is to be understood that the illustrated structure of the present embodiment does not constitute a specific limitation to the electronic apparatus 100. In other embodiments, electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

Processor 310 may include one or more processing units, such as: the processor 310 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), etc. The different processing units may be separate devices or may be integrated into one or more processors.

The controller may be a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.

A memory may also be provided in the processor 310 for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 310. If the processor 310 needs to reuse the instruction or data, it can be called directly from memory. Avoiding repeated accesses reduces the latency of the processor 310, thereby increasing the efficiency of the system.

In some embodiments, processor 310 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (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, etc.

It should be understood that the interface connection relationship between the modules illustrated in the present embodiment is only an exemplary illustration, and does not limit the structure of the electronic device 100. In other embodiments, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.

The charging management module 340 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 340 may receive charging input from a wired charger via the USB interface 330. In some wireless charging embodiments, the charging management module 340 may receive a wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 340 may also supply power to the electronic device through the power management module 341 while charging the battery 342.

The power management module 341 is configured to connect the battery 342, the charging management module 340 and the processor 310. The power management module 341 receives input from the battery 342 and/or the charge management module 340, and provides power to the processor 310, the internal memory 320, the external memory, the display 391, and the wireless communication module 360. The power management module 341 may also be configured to monitor parameters such as battery capacity, battery cycle count, and battery state of health (leakage, impedance). In other embodiments, the power management module 341 may also be disposed in the processor 310. In other embodiments, the power management module 341 and the charging management module 340 may be disposed in the same device.

The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 350, the wireless communication module 360, a modem processor, a baseband processor, and the like.

The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.

The mobile communication module 350 may provide a solution including 2G/3G/4G/5G wireless communication applied to the electronic device 100. The mobile communication module 350 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 350 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the filtered electromagnetic wave to the modem processor for demodulation. The mobile communication module 350 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 350 may be disposed in the processor 310. In some embodiments, at least some of the functional modules of the mobile communication module 350 may be disposed in the same device as at least some of the modules of the processor 310.

The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 370A, the receiver 370B, etc.) or displays an image or video through the display screen 391. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be separate from the processor 310, and may be disposed in the same device as the mobile communication module 350 or other functional modules.

The wireless communication module 360 may provide solutions for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 360 may be one or more devices integrating at least one communication processing module. The wireless communication module 360 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 310. The wireless communication module 360 may also receive a signal to be transmitted from the processor 310, frequency-modulate and amplify the signal, and convert the signal into electromagnetic waves via the antenna 2 to radiate the electromagnetic waves.

In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 350 and antenna 2 is coupled to wireless communication module 360 such that electronic device 100 may communicate with networks and other devices via wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, among others. GNSS may include Global Positioning System (GPS), global navigation satellite system (GLONASS), beidou satellite navigation system (BDS), quasi-zenith satellite system (QZSS), and/or Satellite Based Augmentation System (SBAS).

The electronic device 100 implements the display function through the GPU, the display screen 391, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 391 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs that execute program instructions to generate or alter display information.

The display screen 391 is used to display images, videos, and the like. The display screen 391 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like.

Internal memory 320 may be used to store computer-executable program code, which includes instructions. The processor 310 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 320. The internal memory 320 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, phone book, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 320 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.

The electronic device 100 may implement audio functions through the audio processing module 370, the speaker 370A, the receiver 370B, the microphone 370C, and the application processor. Such as music playing, recording, etc.

The audio processing module 370 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio processing module 370 may also be used to encode and decode audio signals. In some embodiments, the audio processing module 370 may be disposed in the processor 310, or some functional modules of the audio processing module 370 may be disposed in the processor 310.

The speaker 370A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The electronic apparatus 100 can listen to music through the speaker 370A or listen to a hands-free call. The electronic device 100 may be provided with at least one speaker 370A. In other embodiments, two, three or more speakers 370A may be provided in the electronic device 100 to improve the sound playing effect.

The receiver 370B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the electronic device 100 receives a call or voice information, it can receive voice by placing the receiver 370B close to the ear of the person.

Microphone 370C, also known as a "microphone," is used to convert sound signals into electrical signals. When a call is placed or a voice message is sent or it is desired to trigger the electronic device 100 to perform some function by the voice assistant, the user may speak via his/her mouth near the microphone 370C and input a voice signal into the microphone 370C. The electronic device 100 may be provided with at least two microphones 370C, such as the microphone 370C1 and the microphone 370C2, which may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four, or more microphones 370C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.

It should be understood that the speaker 370A and the receiver 370B belong to an audio output module of the electronic device 100, and the microphone 370C belongs to an audio acquisition module of the electronic device 100. In conjunction with fig. 1 and 2 above, speaker 370A may be speaker a 1; receiver 370B may be handset a 2; the microphone 370C may be microphone B1, microphone B2, microphone B3.

Keys 390 include a power-on key, a volume key, etc. The keys 390 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.

The following takes the electronic device 100 shown in fig. 1 as an example to describe in detail the audio module detection method provided in the embodiment of the present application.

First, before the audio module detection method provided in the embodiment of the present application is executed, a set of calibration energy data that can indicate that a detected audio module of the electronic device 100 is not plugged needs to be obtained, and the set of calibration energy data is stored in the electronic device 100, so that when the electronic device 100 executes the audio module detection method provided in the embodiment of the present application, the electronic device determines a situation that the detected audio module is plugged by calling the calibration energy data, so as to assist in completing the audio plugging detection function. It should be understood that the detected audio modules may be the speaker a1, the earpiece a2, the microphone B1, and the microphone B2 in fig. 1, and therefore four sets of calibration energy data are required to be obtained, respectively: nominal energy data indicating that speaker a1 is not plugged, nominal energy data indicating that earpiece a2 is not plugged, nominal energy data indicating that microphone B1 is not plugged, and nominal energy data indicating that microphone B2 is not plugged. The following describes the detection method and the detection process of each set of calibration energy data.

In some embodiments of the present application, before the electronic device 100 leaves the factory (when neither the speaker a1 nor the microphone B1 blocks the hole), the electronic device 100 controls the speaker a1 to output the test audio (i.e., the second audio) at X volume levels (at least two preset volume levels divided for the speaker a1), respectively. For each volume level, the test audio is collected by the microphone B1 under Y level gains (at least two first preset level gains divided by the microphone B1), so as to obtain X × Y calibration energy data.

Wherein, the testing audio is audio with a frequency range of 20Hz-20KHz in human ear hearing range. For example, the test audio may be audio in the frequency band 300Hz-700 Hz.

The volume level represents the level at which the volume of the audio is. X volume levels represent X different volumes, X being a positive integer greater than 1, e.g. 5, 7, 10. The volume level may be positively correlated to volume, for example, volume level 1 is less than volume level 2, volume level 1 represents 50 decibels, and volume level 2 represents 70 decibels. The volume level may also be inversely related to the volume, e.g., volume level 3 is greater than volume level 2, volume level 3 represents 60 decibels, and volume level 2 represents 70 decibels. The level gain represents the amplification of the captured audio. The Y level gains represent Y different amplification factors, Y being a positive integer greater than 1, e.g. 3, 8, 10. The gain of the level may be positively or negatively correlated with the amplification. The embodiment of the present application is not particularly limited to this.

The obtained calibration energy data will be described below with reference to table 1, taking 5 volume levels (i.e., X ═ 5) and 5 level gains (i.e., Y ═ 5) as examples.

Table 1: detection of calibration energy data obtained by detecting the loudspeaker A1 by the microphone B1

Wherein, XiRepresenting the ith volume level in the 5 volume levels, wherein i is more than or equal to 1 and less than or equal to 5, and i is a positive integer. Y isjRepresents the j-th grade gain in the 5 grade gains, wherein j is more than or equal to 1 and less than or equal to 5, and j is a positive integer. ZBijSpeaker A1 at X representing an unblocked holeiWhen the test audio is output, the microphone B1 with an unblocked hole is arranged at YjThe volume collected is measured. In the embodiment of the present application, the energy data is used to indicate the volume of the collected audio, and is measured in decibel-milliwatt (dBm), which is a negative value. For example, -9dBm, -20 dBm. Where the volume of the audio indicated by-9 dBm is greater than-20 dBm.

It should be understood that neither speaker a1 nor microphone B1 may block the aperture until the electronic device 100 is shipped. Thus, the calibration energy data shown in Table 1 may indicate that microphone B1 is not plugged, and may also indicate that speaker A1 is not plugged. Based on this, table 1 may be invoked by embodiments in which the detected audio modules are microphone B1 and speaker a 1.

In the same embodiment, before the electronic apparatus 100 is shipped, the electronic apparatus 100 controls the speaker a1 to output test audio at X volume levels, respectively. For each volume level, the test audio is collected by the microphone B2 under y level gains (at least two second preset level gains divided by the microphone B2), so as to obtain X × y calibration energy data. Wherein y is a positive integer greater than 1. In the following, 5 volume levels (i.e., X is 5) and 5 level gains (i.e., y is 5) are described as examples in conjunction with table 2.

Table 2: detection of calibration energy data obtained by detecting the loudspeaker A1 by the microphone B2

Wherein, XiRepresenting the ith volume level in the 5 volume levels, wherein i is more than or equal to 1 and less than or equal to 5, and i is a positive integer. y isjRepresents the j-th grade gain in the 5 grade gains, wherein j is more than or equal to 1 and less than or equal to 5, and j is a positive integer. ZFijSpeaker A1 at X representing an unblocked holeiWhen the test audio is output, the microphone B2 with an unblocked hole is arranged at yjAnd (4) acquiring energy data.

It should be understood that neither speaker a1 nor microphone B2 may block the aperture until the electronic device 100 is shipped. Thus, the calibration energy data shown in Table 2 may indicate that microphone B2 is not plugged, and may also indicate that speaker A1 is not plugged. Based on this, table 2 may be invoked by embodiments in which the detected audio modules are microphone B2 and speaker a 1.

In the same embodiment, before the electronic device 100 leaves the factory, the electronic device 100 controls the earpiece a2 to output test audio at M volume levels (at least two preset volume levels divided for the earpiece a2), respectively. For each volume level, the test audio is collected by using a microphone B1 under Y level gains, respectively, to obtain M × Y calibration energy data. Wherein M is a positive integer greater than 1. In the following, 5 volume levels (i.e., M ═ 5) and 5 level gains (i.e., Y ═ 5) are described as examples in conjunction with table 3.

Table 3: detection of calibrated energy data obtained by detecting earphone A2 by microphone B1

Wherein M isiRepresenting the ith volume level in the 5 level gains, i is more than or equal to 1 and less than or equal to 5, and i is a positive integer. Y isjRepresents the j-th grade gain in the 5 grade gains, wherein j is more than or equal to 1 and less than or equal to 5, and j is a positive integer. ZZBijRepresentative earpiece A2 at MiWhen the test audio is output, the microphone B1 is used at YjAnd (4) acquiring energy data.

It should be understood that neither earpiece a2 nor microphone B1 may block the aperture until the electronic device 100 is shipped. Thus, the calibration energy data shown in table 3 may indicate that microphone B1 is not plugged and may also indicate that earpiece a2 is not plugged. Based on this, table 3 may be recalled for embodiments in which the detected audio modules are microphone B1 and earpiece a 2.

In the same embodiment, before the electronic device 100 leaves the factory, the electronic device 100 controls the handset a2 to output test audio at M volume levels, respectively. For each volume level, the test audio is collected by using a microphone B2 under y level gains, and M × y calibration energy data are obtained. In the following, 5 volume levels (i.e., M is 5) and 5 level gains (i.e., y is 5) are described as examples in conjunction with table 3.

Table 4: detection of calibrated energy data obtained by detecting earphone A2 by microphone B2

Wherein M isiRepresenting the ith volume level in the 5 level gains, i is more than or equal to 1 and less than or equal to 5, and i is a positive integer. y isjRepresents the j-th grade gain in the 5 grade gains, wherein j is more than or equal to 1 and less than or equal to 5, and j is a positive integer. ZZFijRepresentative earpiece A2 at MiWhen the test audio is output, the microphone B2 is used for outputting the test audio at yjAnd (4) acquiring energy data.

It should be understood that neither earpiece a2 nor microphone B2 may block the aperture until the electronic device 100 is shipped. Thus, the calibration energy data shown in table 4 may indicate that microphone B2 is not plugged and may also indicate that earpiece a2 is not plugged. Based on this, table 4 may be recalled for embodiments in which the detected audio modules are microphone B2 and earpiece a 2.

In other embodiments of the present application, the data in tables 1 to 4 may be obtained after the electronic device 100 is shipped. For example, during a first activation of the electronic device 100 by a user. As another example, the detection may be performed within a period of time (e.g., one week, three weeks, one month, etc.) after the user first activates.

In other embodiments of the present application, the data in tables 1 to 4 may also be obtained by testing other test electronic devices of the same model as the electronic device 100, and stored in the server or the electronic device 100 for the electronic device 100 to obtain. In a specific implementation process, when the data in tables 1 to 4 are stored in the server, the electronic device 100 may obtain the data in tables 1 to 4 from the server according to the unique identifier such as the model of the electronic device 100.

After obtaining the data in tables 1 to 4, the electronic device 100 may be triggered to start the audio hole blockage detection function based on the following application scenario (1) and application scenario (2), and after the audio hole blockage detection function is triggered to start, the audio channel hole blockage detection method provided in the embodiment of the present application may be executed to detect whether the audio acquisition module or the audio output module of the electronic device 100 is blocked.

Application scenario (1):

the electronic device 100 starts the audio hole blockage detection function in response to the user's opening operation of the opening control.

Illustratively, as shown in (a) of fig. 4, the electronic device 100 has a setting interface 101, a function option 1011 of "audio hole blockage detection" is included in the setting interface 101, and in response to a user clicking the function option 1011 of "audio hole blockage detection", the electronic device 100 displays an audio hole blockage detection interface 102 shown in (b) of fig. 4. As shown in fig. 4 (b), the audio hole blockage detection interface 102 includes a switch control 1021 for turning on the audio hole blockage detection function. In response to the user's opening operation of the switch control 1021, the electronic device 100 displays the audio hole blockage detection interface 102 shown in (c) of fig. 4, and the audio hole blockage detection function is turned on.

Application scenario (2):

the electronic device 100 starts the audio hole plugging detection function based on a preset period. The preset period is a time interval required for the audio hole plugging detection function to be started every time. For example, the preset period may be 10 days, one month, three months, or the like. Take the preset period of 10 days as an example. Suppose that the electronic device 100 turns on the audio hole blockage detection function at time 1, the audio hole blockage detection function will be turned on again at time 2 after 10 days, and the audio hole blockage detection function will be turned on again at time 3 after 10 days after time 2, and so on.

For example, the preset period may be set in the audio hole blockage detection interface 103 shown in (c) of fig. 5.

As shown in (a) of fig. 5, the electronic device 100 has a setting interface 101, a function option 1011 of "audio hole blockage detection" is included in the setting interface 101, and in response to a user clicking the function option 1011 of "audio hole blockage detection", the electronic device 100 displays the audio hole blockage detection interface 103 shown in (b) of fig. 5. As shown in fig. 5 (b), the audio hole blockage detection interface 103 includes a switch control 1031 for turning on the audio hole blockage detection function. In response to the user being able to perform an opening operation on the switch control 1031, the electronic device 100 displays the audio hole blockage detection interface 103 shown in (c) of fig. 5. As shown in fig. 5 (c), an input field 1032 for acquiring a preset period is included in the audio hole blockage detection interface 103. In response to an input operation of the user to the input field 1032, a preset period is obtained, and the audio hole blockage detection function is turned on.

After the electronic device 100 is triggered to start the audio hole blockage detection function, the electronic device 100 executes the audio module detection method provided by the embodiment of the application. The audio module detection method provided by the embodiment of the application is different according to different detected audio modules, and four cases are separately described below.

In the first embodiment, the detected audio module is the speaker a1 in fig. 1.

For example, as shown in fig. 6, when the detected audio module is the speaker a1 in fig. 1, the audio module detection method can be implemented as follows S601 to S606:

s601, when a loudspeaker A1 outputs a first audio, collecting the first audio through a microphone B1 to obtain first energy data; the first audio is captured by microphone B2 to obtain second energy data.

The specific definition of the first audio may refer to a test audio, which is not described herein again.

The first audio may be the same audio that the electronic device controls speaker a1 to instantly output as the test audio. It should be noted that the test audio may be any audio, such as music, stories, etc.

The first audio may also be an audio different from the test audio, which is output by the electronic device controlling the speaker a1 immediately after the audio hole blockage detection function is triggered to be turned on. In this case, the above-mentioned first audio may be any audio such as music, a story, and the like. Even more, the first audio may be an audio selected by the user according to self-preference.

The first audio may also be the audio output by the speaker a1 during the user's daily use of the speaker a1 after the audio hole blockage detection function is triggered to be turned on. For example, when the user clicks control 1021 shown in (b) in fig. 4 at time 1, and the user clicks a music player at time 2 after time 1 to play audio 2, and the music player outputs audio 2 through speaker a1, then audio 2 may be the first audio. For another example, when the user clicks the control 1021 shown in (b) of fig. 4 at time 1, the electronic apparatus 100 outputs an incoming call ringtone due to an incoming call by another electronic apparatus at time 3 after time 1. The first audio may be audio 2, incoming call ringtone, in addition to the audio output through the speaker a1An outgoing ring tone played over speaker a1, a voice message played over speaker a1 (e.g., WeChat)TM、QQTMEtc. for social software), audio during the call (e.g., WeChat) output through speaker a1TM、QQTMEtc., a voice call, or a video call of the social software), or play audio of a media asset (e.g., a media asset such as a game, video, music, etc.), etc. It can be seen that the implementation of this example ensures that S601 can be executed in the background of electronic device 100 during the user' S daily use of speaker a1 without separately enabling speaker a1 to output the first audio execution.

It should be noted that, when the first audio and the test audio are different, in order to avoid the influence of the difference between the first audio and the test audio on the energy data, the first audio and the test audio may be the same audio. For example, the first audio and the test audio are both audio in the frequency band 300Hz-700 Hz. Based on this, in some embodiments, the first audio may be a predetermined audio in the same frequency band region as the test audio. In other embodiments, the first audio may also be obtained by performing frequency band filtering extraction on the audio output by the speaker a1, where the filtering extraction refers to extracting frames in the same frequency band interval as the frequency band of the test audio, and filtering frames not in the same frequency band interval.

The first energy data is used for indicating the volume of the first audio collected by the microphone B1, and the second energy data is used for indicating the volume of the first audio collected by the microphone B2. The first energy data and the second energy data may be obtained by:

first, the first energy data may be: when speaker a1 outputs the first audio at the first volume level, microphone B1 captures the volume at the first level gain.

The second energy data may be: when speaker a1 outputs the first audio at the second volume level, microphone B1 captures the volume at the third level of gain.

Wherein the first volume level may be any one of X volume levels, and the first level gain may be any one of Y level gains; the second volume level may be any one of X volume levels and the third level gain may be any one of y level gains.

It should be understood that the first volume level and the second volume level may be the same or different. Illustratively, speaker a1 begins at time a with X1Outputting the first audio, the microphone B1 and the microphone B2 each capture the first audio at a time B after the time a, resulting in first energy data and second energy data. In this case, the first volume level and the second volume level are the same. Illustratively, speaker a1 begins at time a with X1Outputting a first audio, and acquiring the first audio by a microphone B1 at a time B after the time a to obtain first energy data; speaker a1 starts at time c with X2The first audio is output and is captured by microphone B2 at time d, which is after time c, resulting in second energy data. In this case, the first volume level and the second volume level are not the same.

Preferably, the first volume level and the second volume level are the same. Thus, the microphone B1 and the microphone B2 can acquire at the same time without staggering acquisition at different times, and the speaker a1 can output the first audio without changing volume levels, so that the acquisition process is simpler and more convenient.

Further, since the microphone B1 and the microphone B2 belong to different functional units, the first level gain and the second level gain may be the same or different.

It should be noted that, in the process of the electronic device 100 executing the above S601, the first volume level and the second volume level may be any volume levels set by the user for the speaker a1 in the daily use of the electronic device 100 when the electronic device 100 triggers the audio hole blockage detection function of the electronic device 100 to be started. Illustratively, the user may set the first volume level via volume button C in FIG. 1 (corresponding to button 390 in FIG. 3), or via the sound and vibration interface 104 shown in FIG. 7.

As shown in (a) of fig. 7, the electronic device 100 has a setting interface 101, a sound and vibration function option 1012 is included in the setting interface 101, and in response to a click operation of the sound and vibration function option 1012 by a user, the electronic device 100 displays the sound and vibration interface 104 shown in (b) of fig. 7. As shown in fig. 6 (b), the sound and vibration interface 104 includes a slider 1041 and a slider 1042 for adjusting the volume level of the speaker a 1. The user may adjust the volume level of speaker a1 by sliding block 1042 on slide bar 1041.

Similarly, the first level gain and the second level gain may be any level of gain that a user sets for microphone B1 and microphone B2 during daily use of the electronic device 100 when triggering activation of the audio hole blockage detection function of the electronic device 100. The level gain may be set by the user through the sound and vibration interface 104 shown in fig. 7 (b) during use of the electronic device 100. As shown in fig. 7 (B), the sound and vibration interface 104 further includes a slider 1043 and a slider 1044 for adjusting the gain of the microphone B1 level. The user can adjust the grade gain by sliding the block 1044 on the slider 1043.

As such, when the audio hole blockage detection function of the electronic device 100 is triggered on, speaker a1 outputs first audio at the first volume level that has been set by the user, and microphone B1 captures first energy data at the first level gain that has been set by the user; and speaker a1 outputs first audio at the second volume level that has been set by the user and microphone B2 captures second energy data at the first level gain that has been set by the user.

Furthermore, the first volume level, the second volume level, the first level gain, and the second level gain may be any values that are set in the background by the electronic device 100 when the audio hole blockage detection function of the electronic device 100 is activated. This is not a particular limitation of the present application.

Following to detect energy data BijIndicating that speaker a1 is at volume level XiWhen the first audio is output, the microphone B1 performs gain Y in leveljThe volume collected; detecting energy data FijIndicating that speaker a1 is at volume level XiLower output firstAt audio frequency, gain y is graded by microphone B2jThe volume collected. Then, when the first volume level is X1The first level gain is Y2When the first energy data is the detection energy data B12(ii) a When the second volume level is X2The gain of the second stage is y2Then, the second energy data is the detected energy data F22

In order to reduce the false positive rate, the first energy data and the second energy data may be obtained by a second method as follows:

second, the first energy data is determined based on a plurality of first detected energy data acquired by the microphone B1; the plurality of first detected energy data is: when the speaker a1 outputs the first audio at the first volume level, the microphone B1 acquires the volume at the plurality of second level gains in one-to-one correspondence with each of the second level gains.

The second energy data is determined based on a plurality of second detected energy data acquired by the microphone B2; the plurality of second detected energy data is: when the speaker a1 outputs the first audio at the second volume level, the microphone B2 acquires a volume corresponding to each of the fourth level gains at a plurality of fourth level gains.

The specific implementation of the first volume level and the second volume level may refer to the related content of the first manner, and will not be described herein again.

The plurality of second level gains may be any plurality of Y level gains, and the plurality of fourth level gains may be any plurality of Y level gains. The following description will be given by taking the plurality of second-level gains as an example, and specific implementations of the plurality of fourth-level gains may be referred to.

The number of second level gains may be 2 or more and Y or less (the number of level gains divided when the calibration energy data is measured for the microphone B1), and the plurality of second level gains may be any value among the Y level gains, and are not required to be consecutive level gains among the Y level gains. For example, referring to Table 1, the number of second level gains may be 2,3. 4, or 5. Taking the number of the second level gains as 3 as an example, the second level gains may be Y1、Y2、Y3May also be Y1、Y3、Y5And the like.

It should be noted that, in the process of the electronic device 100 executing the above S601, the electronic device 100 may automatically adjust the level gain of the microphone B1 in a manner of from high to low, from low to high, or randomly adjusting in the background, so as to obtain the above second level gains. As such, the microphone B1 may acquire at a plurality of different second level gains and obtain a corresponding first detected energy data at each second level gain, thereby obtaining a plurality of first detected energy data.

With the first volume level being X1The plurality of second-level gains are Y1、Y3、Y5For example, the first detected energy data are detected energy data B11、B13、B15The first energy data is based on the detected energy data B11、B13、B15And (4) determining.

After obtaining the plurality of first detected energy data, the first energy data is determined based on the plurality of first detected energy data, so as to obtain the first energy data of the second mode. It should be noted that the manner in which the first energy data is determined by the plurality of first detected energy data may include, but is not limited to: weighted average, arithmetic average.

The second energy data is similar to the first energy data, and reference may be made to the implementation, which is not described in detail here, but only by way of example. For example, at a second volume level of X1The gains of the fourth levels are y2、y4、y5For example, the plurality of second detected energy data are detected energy data F12、F14、F15The second energy data is detected from the detected energy data F12、F14、F15And (4) determining.

The reason why the second method can reduce the misjudgment rate will be described with reference to fig. 8 by taking the first energy data as an example.

Referring to FIG. 8, the microphones B1 are respectively arranged at Y1To Y5For the speaker A1 with unblocked holes (at X)1Lower output test audio) are respectively as follows: calibration energy data ZB11、ZB12、ZB13、ZB14、ZB15. Microphones B1 are at Y respectively1To Y5For the speaker A1 with blocked hole (at X)1Lower output test audio) are respectively as follows: detecting energy data B11、B12、B13、B14、B15. As can be seen by comparing the two sets of data, the amount of energy attenuated by the plugged holes is not linear for speaker a1 after plugging the holes at different levels of gain. For example, B15And ZB15Is greater than B (i.e., the amount of energy attenuated by plugging of the hole)11And ZB11The difference of (a). Therefore, in this embodiment, the first energy data is determined by the plurality of first detected energy data, and the second energy data is determined by the plurality of second detected energy data, so that the hole blockage of the speaker a1 can be more accurately characterized than the detected energy data under a single level gain, thereby avoiding misjudgment caused by judgment by a single detected energy data with a large deviation.

Note that, since the second method requires adjusting the level gain of the microphone during the first audio output from the speaker a 1. Based on this, when the first audio output by the speaker a1 is the audio during the call, in order to avoid affecting the call quality of both parties of the call, the first energy data and the second energy data can be implemented in the first manner. Therefore, the electronic device 100 does not need to adjust the level gains of the microphone B1 and the microphone B2 for detection, so that the problem that the volume is suddenly changed in the call process due to adjustment of the level gains is avoided, and the call quality is favorably ensured.

It will be appreciated that the foregoing illustrates the case where both the first energy data and the second energy data are obtained by the first means or by the second means. It should be appreciated that in other embodiments, the first energy data and the second energy data may be obtained differently. For example, the first energy data is obtained by a first method, and the second energy data is obtained by a second method, which is not specifically limited in this embodiment of the present application.

In addition, in both the first and second embodiments, the electronic device 100 may perform the operation at any volume level and level gain without adjusting the volume level of the speaker a1 to a specific volume level or adjusting the level gain of the microphone to a specific level gain in the process of performing S601. Therefore, on the first aspect, because the volume level does not need to be adjusted to a specific volume level, the problem that the audio output by the speaker a1 is suddenly large and suddenly small due to the adjustment of the volume level does not exist, and the auditory experience of a user is favorably ensured. This embodiment does not affect the user's daily use experience of speaker a1, particularly for the case where the first audio is the audio output by speaker a1 in the user's daily use of speaker a 1. In a second aspect, as shown in fig. 8, under different level gains, the attenuated volume of the detected audio module due to hole blockage is not constant, and the embodiment of the invention performs detection under any level gain, so that misjudgment caused by data contingency can be avoided. In a third aspect, since the volume level and the level gain set by the user during the daily use of the electronic device 100 are uncertain, and S601 is supported to be performed at any volume level and any level gain, the present embodiment may support S601 to be implemented at any time when the speaker a1 outputs audio daily.

After the first energy data and the second energy data are obtained, it is necessary to determine whether the speaker a1 is plugged based on the first energy data and the second energy data, and a process of determining whether the speaker a1 is plugged based on the first energy data and the second energy data will be described in detail below.

S602, judging whether the difference value between the first calibration data and the first energy data is larger than a first threshold value.

If yes, go to S603; if not, it is determined that speaker a1 is not plugging the hole, in which case S606 may be performed.

The first calibration data is the volume collected by the microphone B1 when the speaker a1 outputs the test audio without blocking the hole. Since the first calibration data was collected when speaker a1 and microphone B1 were not plugged, the first calibration data may indicate that speaker a1 and microphone B1 were not plugged.

It should be noted that the first calibration data, which is different from the first energy data, is different based on the different obtaining manner of the first energy data, and is discussed in the following cases:

as a first example, if the first energy data is obtained by the first manner in S601, the first calibration data is: when speaker a1 outputs the test audio at the first volume level, the volume collected by microphone B1 at the first level gain is obtained as the calibrated energy data corresponding to the first volume level and the first level gain in table 1. That is, the first energy data and the first calibration data have the same volume level and the same level gain.

To obtain the first calibration data in the first example, electronic device 100 may look up and recall from Table 1 based on the first volume level of speaker A1 and the first level gain of microphone B1 to obtain first calibration data having the same volume level and the same level gain.

Continuing with the above example, referring to Table 1, if the first volume level is X1The first level gain is Y2If the first energy data is the detected energy data B12The first calibration data is calibration energy data ZB12. As another example, if the first volume level is X3The first level gain is Y4If the first energy data is the detected energy data B34The first calibration data is calibration energy data ZB34

As a second example, if the first energy data is acquired in the second manner in S601, the first calibration data is determined based on a plurality of first calibration energy data acquired by the microphone B1; the plurality of first calibration energy data is: when the speaker a1 outputs the test audio at the first volume level, the microphone B1 acquires, at a plurality of second level gains, volumes corresponding to each of the second level gains, that is, the calibration energy data corresponding to the first volume level and each of the second level gains in table 1. It can be seen that the first energy data and the first calibration data are obtained at the same volume level and at a plurality of the same level gains.

In order to obtain the first calibration data in the second example, it is first necessary to obtain the above-mentioned plurality of first calibration energy data. Specifically, the electronic device 100 may look up and recall from table 1 according to the first volume level of the speaker a1 and the plurality of second level gains of the microphone B1 to obtain a plurality of first calibration energy data corresponding to the plurality of first detected energy data one to one. After obtaining the plurality of first calibration energy data, the first energy data is determined based on the obtained plurality of first calibration energy data. It should be understood that the manner in which the first calibration data is determined by the plurality of first calibration energy data is the same as the manner in which the first energy data is determined based on the plurality of first detection energy data, and reference may be made to the implementation, and details are not described here.

Continuing with the above example, referring to Table 1, if the first volume level is X1The second level gain is Y1、Y3、Y5Then, the first detected energy data are detected energy data B11、B13、B15The first energy data is based on the detected energy data B11、B13、B15Determining; the plurality of first calibration energy data are respectively calibration energy data ZB11、ZB13、ZB15The first calibration data is based on the calibration energy data ZB11、ZB13、ZB15And (4) determining.

In order to obtain the first threshold for determining whether speaker a1 is plugged, the embodiment of the present application may obtain a set of plugged hole calibration energy data indicating that speaker a1 is plugged. The process of obtaining the calibration energy data for the set of plugged holes is described below.

For example, before the electronic device 100 (here, the electronic device 100 is understood as other electronic devices having the same model) leaves the factory, the situation that the speaker a1 is blocked is simulated by smearing impurities at the position of the speaker a1 of the electronic device 100. Then, using the same detection process as in table 1, the plugged hole calibration energy data shown in table 5 can be obtained, which is not described herein again.

Table 5: the microphone B1 detects the data of the energy of the calibration with the blocked hole obtained by the detection of the loudspeaker A1

Wherein, A1BijSpeaker A1 at X representing a plugged holeiWhen the test audio is output, the microphone B1 with an unblocked hole is arranged at YjThe volume collected is measured. Since the data of table 5 was collected when speaker a1 plugged, the plugged hole calibration energy data shown in table 5 may indicate that speaker a1 plugged holes.

The first threshold in S602 may be obtained by subtracting an error margin reserved for a misjudgment factor (e.g., the accuracy of the microphone B1, the difference between the test audio and the first audio source, etc.) from the difference between the first calibration data and the first hole plugging calibration data. The specific obtaining manner of the first calibration data may refer to relevant contents in S602, and details are not described here. The first plugged-hole calibration data is used to indicate the volume obtained by the microphone B1 that is not plugged by collecting the test audio output by the plugged-hole speaker a1, and thus the first plugged-hole calibration data may indicate that the speaker a1 is plugged by a hole, and may be obtained based on table 5. Since the first calibration data may indicate that speaker a1 is not plugged, the first plugged hole calibration data may indicate that speaker a1 is plugged, and thus, the difference between the two may indicate a situation when the difference between the first calibration data and the first energy data is at the time of speaker a1 plugging.

It should be noted that the first plugged hole calibration data used to determine the first threshold value may be different according to the manner in which the first energy data and the first calibration data are obtained, and will be discussed in detail in the following.

In some embodiments of the present application, if the first energy data in S601 is the first mode, the first calibration data is calibration energy data corresponding to the first volume level and the first level gain in table 1, and the first plugged hole calibration data is plugged hole calibration energy data corresponding to the first volume level and the first level gain in table 5. The electronic device 100 may look up and recall from tables 1 and 5 based on the first volume level of speaker a1 and the first level gain of microphone B1 to obtain first calibration data and first plugged hole calibration data, respectively. It can be seen that the first calibration data and the first plugged hole calibration energy data are obtained at the same volume level and level gain.

Continuing with the above example, if the first energy data and the first calibration data are respectively the detected energy data BijAnd calibration energy data ZBijThen the first threshold value can be the calibration energy data ZBijCalibration energy data with plugged hole A1BijAnd subtracting the error margin (e.g., 2). For example, the first energy data is detected energy data B12(ii) a The first calibration data is calibration energy data ZB12Then the first hole plugging calibration data is A1B12The first threshold is (ZB)12-A1B12) -2. As another example, the first energy data is detected energy data B34(ii) a The first calibration data is calibration energy data ZB34Then the first hole plugging calibration data is A1B34The first threshold is (ZB)34-A1B34)-2。

In other embodiments of the present application, if the first energy data in S601 is the second type, the first calibration data is determined based on a plurality of first calibration energy data corresponding to the first volume level and the second level gains in table 1. The first plugged hole calibration data is determined based on the plurality of first plugged hole calibration energy data. Wherein, a plurality of first stifled hole calibration energy data are: when the speaker a1 without blocking the hole outputs the test audio at the first volume level, the microphone B1 with blocking the hole acquires the volume corresponding to each second level gain one by one at a plurality of second level gains. Electronic device 100 may look up and recall from table 5 based on the first volume level of speaker a1 and the second level gains of microphone B1 to obtain a first plurality of plugged hole calibration energy data. It can be seen that the first calibration data and the first plugged hole calibration energy data are obtained at the same volume level and at a plurality of the same level gains.

It will be appreciated that the first plugged hole calibration data is determined from the plurality of first plugged hole calibration energy data in the same manner as the first calibration data is determined from the plurality of first calibration energy data. For example, the first calibration data is determined based on a weighted average of a plurality of first calibration energy data, and the first plugged hole calibration data should also be determined based on a weighted average of a plurality of first plugged hole calibration energy data, which may refer to a specific implementation of the first calibration data, and is not described herein again. It should be understood that, if the first energy data in S601 is the first mode, the first threshold may also be determined based on the embodiment, and this application is not limited thereto.

Continuing with the above example, if the first energy data is detected by the detected energy data B11、B13、B15Determining that the first calibration data is composed of calibration energy data ZB11、ZB13、ZB15Determination (for example as ZB1) Then, the plurality of first plugged hole calibration energy data are respectively plugged hole calibration energy data A1B11、A1B13、A1B14The first hole-plugging calibration data is the hole-plugging calibration energy data A1B11、A1B13、A1B14Determination (e.g., as A1B1) The first threshold is (ZB)1-A1B1)-2。

It should be noted that, in the first threshold, on the basis of the difference between the first calibration data and the first plugged hole calibration data, the reason for subtracting the error margin is as follows:

the first calibration data, the first energy data and the first hole plugging calibration data are all negative values, and the larger the absolute value is, the smaller the representative volume is. Therefore, when the speaker a1 blocks the hole, the first energy data as the decrement in S602 and the first hole-blocking calibration data as the decrement in the first threshold are both reduced. In this case, the first energy data and the first plugged hole calibration data will be less than the first calibration data. Based on this, the difference between the first calibration data and the first energy data, and the difference between the first calibration data and the first plugged hole calibration data will increase and are positive values.

When the speaker a1 blocks the hole, theoretically, if there is no error factor, the difference between the first calibration data and the first energy data should be larger than the difference between the first calibration data and the first blocked hole calibration data. However, the difference between the first calibration data and the first energy data may be reduced by the presence of the error factor, so that the difference is smaller than the difference between the first calibration data and the first plugged hole calibration data. If the first threshold is taken as the difference between the first calibration data and the first plugged hole calibration data, then the presence of the error factor may cause the difference between the first calibration data and the first energy data to still be less than the first threshold (the condition for plugging the hole by speaker a1 in S602 is not satisfied), which is obviously not in accordance with the fact that the hole by speaker a1 is plugged. Based on this, in order to avoid the error factor interfering with the determination of the speaker a1 that is plugged, the first threshold needs to be decreased by subtracting the error margin from the difference between the first calibration data and the first plugged hole calibration data. In this way, when the speaker a1 blocks a hole, even if the difference between the first calibration data and the first energy data becomes small due to an error factor, since the first threshold value is also lowered, the difference between the first calibration data and the first energy data will be larger than the first threshold value (the condition that the speaker a1 blocks a hole in S602 is satisfied), so that erroneous determination can be avoided.

S603, judging whether the difference value between the second calibration data and the second energy data is larger than a second threshold value.

If yes, go to S604; if not, it is determined that speaker a1 is not plugging the hole, in which case S606 may be performed.

Wherein the second calibration data is the energy data collected by the microphone B1 when the speaker a1 outputs the test audio without plugging the hole, i.e. the second calibration data is collected when the speaker a1 does not plug the hole, and therefore the second calibration data may indicate that the speaker a1 does not plug the hole.

It should be noted that, the obtaining manner of the second energy data is different, the second calibration data that is different from the second energy data in S603, and the second threshold are also different, the specific implementation is similar to the first calibration data and the first threshold, and the specific implementation of the first calibration data and the first threshold may be referred to separately, which is not described herein again. It should be appreciated that, unlike the first calibration data, the second calibration data may be obtained by calling up the data of Table 2.

It should be understood that the execution order of the above S602 and S603 may also be reversed, and this is not particularly limited in this embodiment of the application.

And S604, determining that the loudspeaker A1 blocks the hole.

In particular implementations, the speaker a1 occlusion may be determined by defining a variable and assigning a value to the variable. For example, a variable a is defined to determine the detection result of the speaker a1, and when the variable a is 1, it is determined that the speaker a1 blocks a hole; when the variable a is 0, it is determined that the speaker a1 does not block the hole.

It should be understood that S604 may not be present, that is, S603 is satisfied, and S605 is executed by directly skipping S604.

In order to improve the audio effect of the speaker a1, after performing S604 in fig. 6, the audio module detecting method shown in fig. 6 may further include:

s605, outputting a hole-plugging prompt message indicating that the speaker a1 plugged a hole, and/or increasing the volume level of the speaker a 1.

The hole blocking prompt message can be in the forms of characters and/or voice and the like.

Illustratively, in S605, as shown in fig. 9, in response to a pull-down operation of the electronic apparatus 100 by the user, the electronic apparatus 100 displays the notification bar 105. The notification bar 105 may output a word "speaker a1 has blocked a hole, please clean up the hole in time" to remind the user to clean up the speaker a1 that has blocked the hole in time, thereby improving the audio of the speaker a 1.

For example, in S605, when it is determined that the speaker a1 is plugged, the volume level of the speaker a1 may be increased to compensate for the attenuated energy value. For example, the volume level 1 of the speaker a1 is raised to the volume level 2 to amplify the volume of the output audio.

It should be noted that after executing S605 in fig. 6, the audio module detecting method shown in fig. 6 may further include:

and S606, closing the audio hole blockage detection function of the electronic equipment 100.

Through this step, the audio hole blockage detection function of the electronic device 100 can be immediately turned off after the hole blockage condition of the speaker a1 is determined, so that the audio hole blockage detection function of the electronic device 100 is prevented from being frequently triggered to execute the detection process of fig. 6 when being turned on for a long time. Of course, in other embodiments, the audio module detection method may not include S606, which is not specifically limited in this embodiment of the application.

In the scenario shown in fig. 6, when the speaker a1 blocks the hole, the energy of the first audio output therefrom is cut, so that the first energy data collected by the microphone B1 and the second energy data collected by the microphone B2 are both greatly reduced. The difference between the first calibration data and the first energy data, and the difference between the second calibration data and the second energy data are increased. It may be determined whether speaker a1 is plugged by determining whether the difference between the first calibration data and the first energy data is greater than a first threshold (a first condition) indicative of plugging of speaker a1 and whether the difference between the second calibration data and the second energy data is greater than a second threshold (a second condition) indicative of plugging of speaker a 1.

In the solution shown in fig. 6, the misjudgment rate can be reduced by determining the hole blockage of the speaker a1 using the energy data collected by the two microphones, for the following reasons:

when the speaker a1 is not plugged, but the microphone B1 or the microphone B2 is plugged, the energy value of the first audio is also attenuated by the plugged microphone, so that the first energy data is greatly reduced, the first condition is satisfied, and a situation similar to the situation of plugging the speaker a1 occurs. In this case, if the situation of the plugged hole of the speaker a1 is determined according to the energy data collected by the single microphone, when the first condition is satisfied, that is, the speaker a1 is determined to be plugged, obviously, this is not consistent with the fact that the microphone B1 is plugged and the speaker a1 is not plugged, and thus the misdetermination occurs. In addition, the probability that a single microphone blocks a hole is high, and the probability that the acquired energy data meets the hole blocking condition is high, so that the probability of misjudgment is high.

In order to determine the audio module with a blocked hole, in the scheme shown in fig. 6, a microphone B2 is also introduced to capture the first audio output by the speaker a 1. When the audio module of the blocked hole is the microphone B1, the second energy data collected by the microphone B2 cannot be influenced, so that the difference value between the second calibration data and the second energy data cannot be increased, the difference value is not easily larger than a second threshold value, the second condition of the loudspeaker A1 for blocking the hole is not met, and the audio module cannot be mistakenly judged as the loudspeaker A1 for blocking the hole. In other words, unless it is the speaker a1 that blocks the hole, it is difficult for the possibility that both the first condition and the second condition are satisfied to occur.

In addition, in the scheme shown in fig. 6, the microphone B1 and the microphone B2 block the holes at the same time, which also results in the first energy data and the second energy data being both greatly reduced, so that the first condition and the second condition may be satisfied. However, compared with the scheme of detecting by using a single microphone, the probability that the holes are simultaneously blocked by the microphone B1 and the microphone B2 is low, so that the possibility that the holes are simultaneously blocked by the microphone B1 and the microphone B2 is met, and the first condition and the second condition are both satisfied, so that the embodiment is beneficial to reducing the misjudgment rate compared with the scheme of detecting by using a single microphone.

In order to reduce the chance of a single detection result, which results in a high false positive rate, in some embodiments of the present application, the hole plugging condition of the speaker a1 may be detected multiple times by circularly performing a single detection process of the audio module detection method shown in fig. 6, and based on the results of the multiple detections, it is determined whether the speaker a1 is plugged.

For example, as shown in fig. 10, unlike the audio module detection method shown in fig. 6, in S603, if yes, it only indicates that the speaker a1 is determined to be plugged in the process of the current detection. In this case, in order to reduce the chance of a single detection result, the misjudgment rate that causes the speaker a1 to determine the plugged hole is not directly determined, but the plugging of the speaker a1 is performed a plurality of times by performing S603a and S603b as follows.

And S603a, increasing the times of hole plugging.

Wherein the number of plugged holes is used to record the total number of times that speaker a1 was determined to be plugged during multiple tests. The number of times of hole blockage may be a variable defined within the electronic device 100, assigned an initial value (e.g., 0) when the electronic device 100 is triggered to turn on the audio hole blockage detection function, and increased when speaker a1 is determined to be blocked during a single detection event.

And S603b, judging whether the hole plugging times are larger than the preset hole plugging times.

The preset hole plugging times can be set to be any value larger than the initial value of the hole plugging times according to needs. For example, the number of times of hole plugging is given an initial value of 0, the preset number of times of hole plugging may be 50, 60, 80, or the like.

If yes, go to step S604.

In this embodiment, by adding a condition that the speaker a1 is plugged when the number of times of plugging is greater than the preset number of times of plugging, the scheme in fig. 10 may collect energy data of the first audio at different times to perform multiple judgments, and compared with the case that only energy data at one time is collected in fig. 6, the misjudgment rate of plugging may be reduced.

Further, the situation of the hole blockage of the speaker a1 is determined based on the single detection result, and there is a possibility of erroneous determination. In order to avoid the situation that the number of times of hole blockage exceeds the preset number of times of hole blockage due to long-time accumulation of single detection results, as shown in fig. 10, which is different from the audio module detection method shown in fig. 6, in S602 and S603, if not, the following S602a is executed.

And S602a, judging whether the hole plugging times are larger than the preset reference times.

If yes, go to S602 b. The preset reference number is an initial value (e.g. 0) given when the electronic device 100 is triggered to start the audio hole blockage detection function, and may be set as required.

And S602b, reducing the hole blocking times.

For the definition of the number of plugging holes, reference may be made to the description of S603a, which is not described herein again. The number of times of plugging is reduced when it is determined that a hole is not plugged in a single test.

In this embodiment, when a difference between the first calibration data and the first energy data is greater than a first threshold, or a difference between the second calibration data and the second energy data is greater than a second threshold, it indicates that the current detection result is that the hole is not blocked. Then, in the previous detection process, since the hole plugging times (the part larger than the preset reference times) accumulated due to the hole plugging of the detection result may be misjudged, when the current detection result is different from the previous detection result, the accumulated hole plugging times are punched by reducing the hole plugging times, so that the situation that the hole plugging times exceed the preset hole plugging times due to excessive misjudgment times of single detection can be avoided, and the final misjudgment occurs.

In order to reduce the power consumption of the electronic device 100, in some embodiments of the present application, unlike the audio module detection method shown in fig. 6, after performing S602b, S603b, or S603a, as shown in fig. 10, the execution may further continue with S602 c.

And S602c, judging whether the preset condition is met.

Wherein the preset conditions in S602c include one or more of the following:

whether the function triggering time is greater than a preset time. The function triggering time is a time period that lasts from a time when the electronic apparatus 100 is triggered to turn on the audio hole blockage detection function to a time when the electronic apparatus 100 executes S602 b. The preset time may be set as desired, for example, 5 days, 15 days, etc. It should be noted that if the audio hole blockage detection function is triggered based on the application scenario (2), the preset time here is not greater than the preset period in the application scenario (2).

Whether the detection times are larger than the preset detection times or not. The electronic device 100 performs the audio module detection method shown in fig. 10 as a single detection process. The detection times are accumulated times of the electronic device 100 executing the single detection process since the electronic device 100 is triggered to start the audio hole blockage detection function. It should be understood that, in order to obtain the number of detections of the electronic device 100, in the method shown in fig. 10, after performing S604 or performing S602a, the number of detections may be increased. The preset number of times of detection may be set as desired, for example, 60 times, 70 times, etc.

If yes, go to S606; if not, S602d is executed.

S602d, waiting for triggering the next detection process.

It should be understood that the next detection process refers to the next time the aforementioned single detection process is performed. The trigger condition for the next detection process may be as follows:

the first condition is as follows: the electronic device 100 may trigger the next detection process when being triggered to output another first audio.

For example, assume that the first audio output by speaker a1 is audio a during the detection process currently being performed by electronic device 100. Then when the first audio output by speaker a1 is audio B, the next detection process is triggered.

Case two: the electronic apparatus 100 may trigger a next detection process based on a preset detection period in outputting the first audio.

It should be understood that the preset detection period here is not the same as the preset period in the application scenario (2). The preset period in the application scene (2) is a time interval required for starting the audio hole blockage detection function once, and is a period aiming at the audio hole blockage detection function. The preset detection period is a time interval required for triggering the detection process once, and is a period for the detection process. After the electronic device 100 is triggered to start the audio hole blockage detection function, multiple detection processes may be performed based on a preset detection period until the audio hole blockage detection function is turned off; and then the audio hole plugging detection function is turned on again based on a preset period. Based on this, the preset detection period should be smaller than the preset period.

For example, the preset detection period may be 2 minutes, 5 minutes, or the like. Taking the preset detection period of 5 minutes as an example, assume that the current time is T1The electronic device 100 performs the current detection process. Then T after 5 minutes2Triggering the next detection process.

In this embodiment, when the judgment condition of the preset condition is satisfied, the audio hole blockage detection function of the electronic device 100 is turned off, so that the audio hole blockage detection function of the electronic device 100 is turned off under the condition that the speaker a1 is not blocked, power consumption caused by the electronic device 100 executing the audio module detection method shown in fig. 10 in a circulating manner is avoided, and the effect of reducing power consumption is achieved. Of course, in other embodiments, S602c and S602d may not be provided, and this is not limited in this embodiment of the present application.

In the second embodiment, the detected audio module is the earphone a2 in fig. 1.

When the detected audio module is the receiver a2 in fig. 1, the above-mentioned audio module detection method can be implemented by the audio module detection methods shown in fig. 11 and 12. For example, referring to fig. 11 and 12, when the detected audio module is the earphone a2 in the second embodiment, which is the speaker a1 in the first embodiment, it is different from the audio module detection method shown in fig. 6 and 10, in the audio module detection method shown in fig. 11 and 12, S1101, S1104, and S1105 are respectively used instead of S601, S604, and S605, and the specific details are as follows:

s1101, when the earphone A2 outputs a first audio, collecting the first audio through a microphone B1 to obtain first energy data; the first audio is captured by microphone B2 to obtain second energy data.

And S1104, determining that the earphone A2 blocks the hole.

And S1105, outputting a hole blocking prompt message for indicating that the earphone A2 blocks the hole, and/or increasing the volume level of the earphone A2.

It should be noted that the specific implementations of S1101, S1104, and S1105 are similar to those of S601, S604, and S605, respectively, and reference may be made to the implementations, which are not described in detail here. It should be appreciated that in a first embodiment, the first volume level and the second volume level are any one of M volume levels. The first calibration data may be obtained by calling the data of table 3 and the second calibration data may be obtained by calling the data of table 4.

It can be seen that, when the detected audio module is the receiver a2 in fig. 1, the difference between the second embodiment and the first embodiment is that the detected object is replaced by the speaker a1 and the receiver a2, and there is no substantial difference therebetween. Therefore, the effect of the audio module detection method shown in fig. 11 and 12 can refer to the effect of the audio module detection method shown in fig. 6 and 10, and is not described herein again.

In the third embodiment, the detected audio module is the microphone B1 in fig. 1.

When the detected audio module is the microphone B1 in fig. 1, the above-mentioned audio module detection method can be implemented by the audio module detection methods shown in fig. 13 and 14. Exemplarily, as shown in fig. 13 and 14, when the detected audio module is changed from the speaker a1 in the first embodiment to the microphone B1 in the third embodiment, different from the audio module detection method shown in fig. 6 and 10, in the audio module detection method shown in fig. 13 and 14, S1302, S1303, S1304, and S1305 are respectively used instead of S602, S603, S604, and S605, and the specific implementation is as follows:

s1302, determining whether a difference between the first energy data and the second energy data is less than a third threshold.

If yes, executing S1303; alternatively, if not, it is determined that microphone B1 is not plugged.

It should be noted that there are two ways to obtain the first energy data and the second energy data, and the specific implementation may refer to the relevant contents of S601 in the first embodiment, which is not described herein again. Different from the first embodiment, the comparison object in the third embodiment is the first energy data and the second energy data. To be comparable, the first energy data and the second energy data are preferably obtained in the same way. For example, the first energy data and the second energy data are both obtained by the first manner or the second manner. In this way, the first energy data and the second energy data are compared in the same dimension, and the comparison result is comparable to the judgment of whether the microphone B1 is plugged.

In order to obtain the third threshold value for determining whether the microphone B1 is plugged, a set of plugged hole calibration energy data indicating that the microphone B1 is plugged may be obtained in advance in the embodiment of the present application. The process of obtaining the calibration energy data for the set of plugged holes is described below.

For example, before the electronic device 100 (here, the electronic device 100 is understood as other electronic devices with the same model) leaves the factory, the microphone B1 is simulated to be plugged by smearing impurities at the position of the microphone B1 of the electronic device 100. Then, using the same detection process as in table 1, the plugged hole calibration energy data shown in table 6 can be obtained, which is not described herein again.

Table 6: the microphone B1 detects the data of the energy of the calibration with the blocked hole obtained by the detection of the loudspeaker A1

Wherein, B1BijSpeaker A1 at X representing an unblocked holeiWhen the test audio is output, the microphone B1 is plugged at YjThe volume collected. Since the data of table 6 was collected when microphone B1 plugged, the plugged hole calibration energy data shown in table 6 may indicate that microphone B1 plugged holes.

The third threshold may be obtained by superimposing an error margin on the difference between the second plugged hole calibration data and the second calibration data. This margin of error is reserved for some misjudgment factors (e.g., the accuracy of the microphone B1 itself, the difference between the test audio and the first audio source, etc.).

The second calibration data may be obtained based on table 2, and the definition and specific implementation of the second calibration data may refer to S603, which is not described herein again. The second plugged hole calibration data is used to indicate the volume obtained by the plugged hole microphone B1 for the test audio acquisition, and thus the second plugged hole calibration data may indicate that microphone B1 is plugged hole, which may be obtained based on table 6. Since the second calibration data may indicate that speaker a1 and microphone B2 are not plugged, the second plugged hole calibration data may indicate that microphone B1 is plugged, and thus, the difference between the two may indicate a situation when the difference between the first energy data and the second energy data is at the time of plugging of the microphone B1.

It should be noted that the second plugged hole calibration data and the second calibration data are different according to the different obtaining manners of the first energy data and the second energy data, and will be discussed in detail in the following cases.

In some embodiments of the present application, if the first energy data and the second energy data in S1302 are obtained by the first method, the second calibration data is calibration energy data corresponding to the second volume level and the third level gain in table 2; the second plugged hole calibration data is the plugged hole calibration energy data corresponding to the first volume level and the first level gain in table 6. Electronic device 100 may look up and recall from tables 2 and 6 based on the first volume level of speaker a1 and the first level gain of microphone B1 to obtain second calibration data and second plugged hole calibration data, respectively. It can be seen that the second plugged hole calibration energy data and the first energy data are obtained at the same volume level and level gain.

Continuing with the above example, if the first energy data is the detected energy data BijThe second energy data is the detected energy data FijIf the second calibration data is the calibration energy data ZFij, the second plugged hole calibration data is the plugged hole calibration energy data B1Bij, and the third threshold may be the plugged hole calibration energy data B1BijAnd calibration energy data ZFijAnd an error margin (e.g., 2) is added. For example, the first energy data is detected energy data B12(ii) a The second energy data is detected energy data F34Then the third threshold is (B1B)12-ZF34)+2。

In other embodiments of the present application, if the first energy data and the second energy data in S1302 are obtained in the second manner, the second calibration data is determined based on a plurality of calibration energy data in which the second volume level and the fourth level gains in table 2 correspond to each other one by one; the second plugged hole calibration data is determined based on a plurality of second plugged hole calibration energy data. When the speaker a1 with the second plugged holes outputs the test audio at the first volume level, the microphone B1 with the plugged holes acquires the volume corresponding to each third level gain one by one under the third level gains. It can be seen that the second plugged hole calibration energy data and the first energy data are obtained at the same volume level and at a plurality of the same level gains.

It should be understood that the manner of determining the second plugged hole calibration data by the plurality of second plugged hole calibration energy data is the same as the manner of determining the first energy data by the plurality of first detection energy data, and the implementation may be referred to, and details are not repeated herein. If the first energy data and the second energy data in S701 are the first mode, the third threshold may be determined based on the present embodiment, and the present application is not limited to this specifically.

Illustratively, if the first energy data is detected by the detection energy data B11、B13、B15Determining that the second energy data is composed of the detected energy data F12、F14、F15If it is determined that the second calibration data is the calibration energy data ZF in Table 212、ZF14、ZF15Determination (e.g. as ZF)1) The second plugged hole calibration energy data are the plugged hole calibration energy data B1B in Table 711、B1B13、B1B15The second hole-plugging calibration data is the hole-plugging calibration energy data B1B11、B1B13、B1B15Determination (e.g. as B1B1) The third threshold value is (B1B)1-ZF1)+2。

It should be noted that, in the third threshold, on the basis of the difference between the second plugged hole calibration data and the second calibration data, the reason for superimposing the error margin is as follows:

the first energy data, the second hole plugging calibration data and the second calibration data are all negative values, and the larger the absolute value is, the smaller the representative volume is. Therefore, when the microphone B1 blocks the hole, the first energy data and the second block calibration data, which are the subtracted numbers, are greatly reduced, and the difference between the first energy data and the second energy data, and the difference between the second block calibration data and the second calibration data are greatly reduced.

When the microphone B1 blocks a hole, theoretically, if there is no error factor, the difference between the first energy data and the second energy data should be smaller than the difference between the second hole-blocked calibration data and the second calibration data. However, the difference between the second plugged hole calibration data and the second calibration data may increase due to the error factor, and thus be larger than the difference between the second plugged hole calibration data and the second calibration data. If the second threshold is the difference between the second hole-blocked calibration data and the second calibration data, the presence of the error factor may cause the difference between the first energy data and the second energy data to be still greater than the second threshold (the condition that the hole is blocked by the microphone B1 in S1302 is not satisfied), which obviously does not match the fact that the hole is blocked by the microphone B1. Based on this, in order to avoid the error factor interfering with the judgment of the microphone B1 that is plugged, the second threshold needs to be increased by superimposing an error margin on the difference between the second plugged hole calibration data and the second calibration data. In this way, when the microphone B1 blocks a hole, even if the difference between the first energy data and the second energy data becomes large due to an error factor, since the second threshold value becomes large, the difference between the first energy data and the second energy data will be smaller than the first threshold value (the condition that the microphone B1 blocks a hole in S1302 is satisfied), so that erroneous determination can be avoided.

And S1303, judging whether the first energy data is smaller than a fourth threshold value.

If yes, go to S1304; if not, it is determined that microphone B1 does not block the hole, in which case S606 may be performed.

The fourth threshold for determining whether the microphone B1 is plugged may be based on the second plugged hole calibration data and may be obtained by adding an error margin. This margin of error is reserved for some misjudgment factors (e.g., the accuracy of the microphone B1 itself, the difference between the test audio and the first audio source, etc.). It should be noted that, for specific implementation of the second plugged hole calibration data, reference may be made to the related description of S1402, and details are not described here again.

Continuing with the above example, if the first energy data is the detected energy data BijIf the second hole plugging calibration data is the hole plugging calibration energy data B1Bij. In this case, the fourth threshold may be the plugged hole calibration energy data B1BijAnd the sum of the error margin (e.g., 2). For example, the first energy data is detected energy data B12Then the fourth threshold is B1B12+2。

If the first energy data is detected energyData B11Detecting energy data B13Detecting energy data B15If it is determined that the second plugged hole calibration data is the plugged hole calibration energy data B1B in Table 611、B1B13、B1B15Determination (e.g. as B1B1). In this case, the fourth threshold value is B1B1+2。

It should be understood that the execution order of the above S1302 and S1303 may also be reversed, and this is not specifically limited in this embodiment of the application.

And S1304, determining that the microphone B1 blocks the hole.

The step can be implemented with reference to S604, and details are not repeated here.

To improve the audio effect of the microphone B1, after performing S1304, S1305 may also be performed.

S1305, a hole plugging prompt information for indicating that the microphone B1 plugs a hole is output, and/or the level gain of the microphone B1 is increased.

When the microphone B1 is determined to be blocked, the grade gain of the microphone B1 can be increased, and the weakened energy value can be compensated. For example, the level gain 1 of the microphone B1 is raised to the level gain 2 to amplify the volume of the captured audio. In addition, step S605 may be referred to for specific implementation of the hole plugging indication information, and details thereof are not described here.

In the audio module detecting method shown in fig. 13 and 14, when the microphone B1 blocks the hole, it collects the first audio output by the speaker a1, and the volume of the first audio is weakened, so that the collected first energy data is greatly reduced, the microphone B2 is not affected, the collected second energy data is not affected, and therefore, the difference between the first energy data and the second energy data is reduced. It may be determined whether the microphone B1 is plugged by determining whether the first energy data is less than a fourth threshold (a first condition) that can indicate that the microphone B1 is plugged, and whether a difference between the first energy data and the second energy data is less than a third threshold (a second condition) that can indicate that the microphone B1 is plugged.

In the solutions shown in fig. 13 and 14, the misjudgment rate can be reduced by determining the hole blockage of the microphone B1 by using the energy data collected by the two microphones, for the following reasons:

when the speaker a1 blocks the hole and the microphone B1 does not block the hole, the first energy data is also greatly reduced, the first condition is satisfied, and the situation similar to the case where the microphone B1 blocks the hole occurs. In this case, if the hole blockage of the microphone B1 is determined according to the energy data collected by the single microphone, when the first condition is satisfied, that is, the microphone B1 is determined to be blocked, it is obviously inconsistent with the fact that the speaker a1 blocks the hole and the microphone B1 does not block the hole, and thus a false determination occurs. In addition, the probability that a single microphone blocks a hole is high, and the probability that the acquired energy data meets the hole blocking condition is high, so that the probability of misjudgment is high.

In order to determine the audio module with a blocked hole, the scheme shown in fig. 13 and 14 further introduces a microphone B2 to capture the first audio output by the speaker a 1. When the audio module of the plugged hole is the loudspeaker A1, the first energy data and the second energy data are affected by being greatly reduced, so that the difference value of the first energy data and the second energy data is not changed too much and is not easy to be smaller than a third threshold value, the second condition of plugging the hole by the microphone B1 is not met, and the audio module of the plugged hole cannot be mistakenly judged to be the microphone B1. In other words, unless the microphone B1 blocks the hole, it is difficult to make it possible that both the first condition and the second condition are satisfied.

In the fourth embodiment, the detected audio module is the microphone B2 in fig. 1.

For example, as shown in fig. 15 and 16, when the detected audio module is changed from the microphone B1 in the third embodiment to the microphone B2 in the fourth embodiment, different from the audio module detection method shown in fig. 13 and 14, in the audio module detection method shown in fig. 15 and 16, S1302, S1303, S1304, and S1305 may be replaced by S1502, S1503, S1504, and S1505, respectively, which are specifically as follows:

s1502, it is determined whether the difference between the second energy data and the first energy data is less than or equal to a fifth threshold.

If yes, go to S1503; if not, it is determined that microphone B2 does not block the hole, in which case S606 may be performed.

It should be noted that there are two ways to obtain the first energy data and the second energy data, and the specific implementation may refer to the relevant contents of S601 in the first embodiment, which is not described herein again. In addition, for comparability, preferably, the first energy data and the second energy data have the same obtaining manner, and the specific implementation may refer to S1302, which is not described herein again.

In order to obtain the above-mentioned fifth threshold value for determining whether the microphone B2 is plugged, the embodiment of the present application may also obtain a set of plugged hole calibration energy data indicating that the microphone B2 is plugged. The process of obtaining the calibration energy data for the set of plugged holes is described below.

Foreign substances are smeared at the position of the microphone B2 of the electronic device 100, and the condition that the microphone B2 is blocked is simulated. And the same detection procedure as in table 2 was used to obtain the plugged hole calibration energy data shown in table 7.

Table 7: detection of microphone B2 on plugged-hole calibration energy data of speaker A1

Wherein, B2FijSpeaker A1 at x representing an unblocked holeiWhen the test audio is output, the microphone B2 is plugged at yjThe volume collected. Since the data of table 7 was collected when microphone B2 plugged, the plugged hole calibration energy data shown in table 7 can be used to indicate when microphone B2 plugged a hole.

It should be noted that, unlike S1302, since the detected audio module is changed from the microphone B1 to the microphone B2, in S1502, the second energy data acquired by the microphone B2 is a subtrahend, and the first energy data acquired by the microphone B1 is a subtrahend.

Based on this, the fifth threshold is obtained based on the difference between the third calibration data (representing the volume collected when the microphone B2 is not plugged) and the first calibration data (representing the volume collected when the microphone B1 is not plugged), and is superimposed with the margin of error reserved for the error factors (such as the accuracy of the microphone B2 itself, the difference between the two sound sources of the test audio and the first audio, and the like), as distinguished from the third threshold. The reason for superimposing the error margin on the difference between the third plugged hole calibration data and the first calibration data may refer to the description related to the third threshold, and is not described herein again.

The third plugged hole calibration data is used to indicate the volume of the plugged hole microphone B2 collected for the test audio output by the unplugged hole speaker a1, so that the third plugged hole calibration data may indicate that the microphone B2 is plugged, and may be obtained based on table 7; the specific manner of obtaining the first calibration data can be seen from the related contents in S602. Since the first calibration data may indicate that speaker a1 and microphone B1 are not plugged, and the third plugged hole calibration data may indicate that microphone B2 is plugged, the difference between the two may indicate when the difference between the second energy data and the first energy data is at the time of plugging of the microphone B2.

It should be noted that the third plugged hole calibration data and the first calibration data are different according to the different obtaining manner of the first energy data and the second energy data, and will be discussed in detail in the following.

In some embodiments of the present application, if the first energy data and the second energy data in S1502 are obtained by the first method, the first calibration data is calibration energy data corresponding to the first volume level and the first level gain in table 1, and the third plugged hole calibration data is plugged hole calibration energy data corresponding to the second volume level and the third level gain in table 7.

Continuing with the above example, if the first energy data is the detected energy data BijThe second energy data is the detected energy data FijIf the first calibration data is the calibration energy data ZBijThe third calibration data is calibration energy data B2FijThe fifth threshold may be the hole plugging calibration energy data B1BijAnd calibration energy data ZFijAnd adding an error margin (e.g., 2). For example, the first energy data is detected energy data B12(ii) a The second energy data is detected energy data F34Then the fifth threshold is (B2F)34-ZF12)+2。

In other embodiments of the present application, if the first energy data and the second energy data in S1502 are obtained by the second method, the first calibration data is determined based on a plurality of calibration energy data in which the first volume level and the plurality of third level gains in table 1 correspond to each other one by one; the third plugged hole calibration data is determined based on a plurality of third plugged hole calibration energy data. When the third plugged hole calibration energy data is that the speaker A1 without a plugged hole outputs the test audio at the second volume level, the microphone B2 with a plugged hole acquires the volume corresponding to each fourth level gain one by one under the fourth level gains. It can be seen that the third plugged hole calibration energy data and the second energy data are obtained at the same volume level and at a plurality of the same level gains.

It should be understood that the manner of determining the third plugged hole calibration data by the plurality of third plugged hole calibration energy data is the same as the manner of determining the second energy data by the plurality of second detection energy data, and the implementation may be referred to, and details are not repeated herein. It should be noted that, if the first energy data and the second energy data in S1502 are obtained by the first method, the fifth threshold may also be determined based on the embodiment, and this application is not particularly limited thereto.

Illustratively, if the first energy data is detected by the detection energy data B11、B13、B15Determining that the second energy data is composed of the detected energy data F12、F14、F15If it is determined that the first calibration data is the calibration energy data ZB in Table 111、ZB13、ZB15Determination (e.g. ZB)1) The third plugged hole calibration energy data are the plugged hole calibration energy data B2F in table 7 respectively12、B2F14、B2F15The third hole-plugging calibration data is the hole-plugging calibration energy data B2F12、B2F14、B2F15Determination (e.g., B2F)1) The fifth threshold is (B2F)1-ZB1)+2。

S1503, it is determined whether the second energy data is smaller than a sixth threshold.

If yes, go to S1504; if not, it is determined that microphone B2 does not block the hole, in which case S606 may be performed.

The sixth threshold for determining whether the microphone B2 is plugged may be based on the third plugged hole calibration data and may be obtained by adding an error margin. Wherein the error margin is reserved for some misjudgment factors (such as the accuracy of the microphone B2 itself, the difference between the test audio and the first audio, etc.). It should be noted that, for specific implementation of the third plugged hole calibration data, reference may be made to the related description of S1502, and details are not described here.

Continuing with the above example, if the second energy data is the detected energy data FijIf the third plugged hole calibration data is the plugged hole calibration energy data B2Fij. In this case, the sixth threshold may be the plugged hole calibration energy data B2FijAnd the sum of the error margin (e.g., 2). For example, the second energy data is the detected energy data F12Then the sixth threshold is B2F12+2。

If the second energy data is detected from the detected energy data F11、F13、F15If it is determined that the third plugged hole calibration data is the plugged hole calibration energy data B2F in Table 611、B2F13、B2F15Determination (e.g. as B2F)1). In this case, the sixth threshold value is B2F1+2。

It should be understood that the execution order of S1502 and S1503 described above may also be reversed, and this is not particularly limited in the embodiment of the present application.

And S1504, determining that the microphone B2 blocks the hole.

S1505, outputting a hole plugging indication information indicating that the microphone B2 plugs the hole, and/or increasing the level gain of the microphone B2.

The specific implementation of steps S1504 and S1505 can refer to steps S1304 and S1305, respectively, and will not be described herein again.

It should be understood that, except for the detected audio module being different, the detection process of the microphone B2 in the fourth embodiment is similar to that in the third embodiment, and therefore, the implementation effect of the audio module detection method shown in fig. 15 and fig. 16 can refer to the technical effect of the audio module detection method shown in fig. 13 and fig. 14, and will not be described herein again.

It should be noted that the third embodiment and the fourth embodiment illustrate the case where the first audio is output through the speaker a 1. Since the volume of the speaker a1 when outputting the first audio is large, the accuracy requirements for the microphone B1 and the microphone B2 are lower, and the energy data acquired by the microphone B1 and the microphone B2 by collecting the first audio output by the speaker a1 is more accurate. It should be understood that, in other embodiments, the third embodiment and the fourth embodiment may also be cases where the first audio is output by the earpiece a2 in fig. 1, that is, the audio output module is the earpiece a2, and this is not limited in this application. It is to be understood that, when the first audio is output by the earpiece a2 in fig. 1 in the third and fourth embodiments, the first volume level and the second volume level are any one of M volume levels, the first calibration data is obtained based on table 3, and the second calibration data is obtained based on table 4.

It should be noted that, in the first to fourth embodiments, the first audio capturing module is the microphone B1, and the second audio capturing module is the microphone B2. In other embodiments, the first audio capturing module may also be the microphone B2, and the second audio capturing module may also be the microphone B1, which are not substantially different from each other in the specific implementation process and can be implemented by reference, and therefore, the detailed description is omitted here.

As can be seen from the first to fourth embodiments, no matter what the detected audio module belongs to, in the audio module detection method provided in the embodiments of the present application, the first audio output by the audio output module (e.g., the speaker a1 or the earpiece a2) is collected by two audio collection modules (e.g., the microphone B1 and the microphone B2 in fig. 1, or two of the microphone B1, the microphone B2, and the microphone B3 in fig. 2), and the hole blockage condition of the detected audio module is determined according to the collected first energy data and second energy data.

On the one hand, compared with a scheme of detecting by using a single audio acquisition module, for example, the first energy data acquired by the first audio output by the speaker a1 by using the microphone B1 is used for judging the hole blocking condition of the detected audio module, and both the microphone B1 and the speaker a1 may have the hole blocking problem, so that the first energy data can be greatly reduced, and therefore, whether the microphone B1 or the speaker a1 has the problem cannot be judged only by depending on the first energy data, so that misjudgment is easy to occur. That is, the scheme using a single audio acquisition module for detection is prone to false positives.

In the embodiment of the application, the hole blocking condition of the detected audio module is judged according to the first energy data and the second energy data acquired by the two audio acquisition modules. Since the second energy data and the first energy data are both related to the audio output module, if the audio output module blocks the hole, both the first energy data and the second energy data are affected. If the first audio acquisition module or the second audio acquisition module blocks the hole, only the first energy data or the second energy data is affected. Conversely, the module of the plugged hole can be determined by utilizing the difference between the first energy data and the second energy data.

On the other hand, no matter what the detected audio module is, only the two data of the first energy data and the second energy data need to be collected for detection, and the data collection process is simple and convenient.

Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.

Each functional unit in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.

The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or make a contribution to the prior art, or all or part of the technical solutions may be implemented in the form of a software product stored in a storage medium and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard drive, read only memory, random access memory, magnetic or optical disk, and the like.

In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present embodiment, "a plurality" means two or more unless otherwise specified.

The above is only a specific implementation of the embodiments of the present application, but the scope of the embodiments of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the embodiments of the present application should be covered by the scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.

54页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于手机车联网应用的手机分屏方法、系统、设备及介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类