A TWS earphone control method, device, equipment and storage medium
By monitoring the signal strength and battery information in real time, it automatically selects the earphone with sufficient power as the main earphone, and automatically switches the microphone and noise reduction module status when the noise signal meets the conditions. This solves the problem of main earphone selection and control in TWS earphones, improves battery life and control efficiency, and enhances user experience.
Patent Information
- Application Number
- CN202411672849.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-11-21
AI Technical Summary
How to select the main earphone in TWS earphones and how to control the microphone and noise reduction module of the main earphone to improve battery life and convenience. The existing technology has problems such as uneven power supply leading to shortened battery life and complex manual control operations.
By monitoring the signal strength and battery information in real time, the headset with sufficient battery power is automatically selected as the main headset, and the status of the microphone and noise reduction module is automatically switched when the noise signal meets the noise reduction conditions, reducing manual intervention.
It improves the battery life and control efficiency of the main headset, reduces the user's operation burden, and improves call quality and user experience.
Smart Images

Figure CN119172688B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of audio technology, and in particular to a TWS headset control method, device, equipment, and storage medium. Background Art
[0002] TWS earphones, short for True Wireless Stereo earphones, are an audio device designed with the latest Bluetooth wireless technology. In the design of TWS earphones, the left and right earbuds each play an important role. They not only have the ability to receive and play audio signals independently, but also can achieve synchronous transmission of audio signals wirelessly, providing users with an immersive stereo experience.
[0003] In addition, for compatibility and user habits, manufacturers usually set the right earphone in TWS earphones as the primary earphone. When the right earphone is used as the primary earphone, its battery tends to consume faster than the left earphone as the secondary earphone because the primary earphone needs to bear more data transmission and processing tasks. If the battery level of the right earphone is lower than that of the left earphone, this may result in a shorter battery life of the primary earphone, thus affecting the overall user experience. Therefore, how to choose the primary earphone between the right and left earphones in TWS earphones is an urgent problem that needs to be solved.
[0004] Furthermore, the primary earphone integrates a microphone and noise reduction module. Existing control of these modules relies on manual control. This manual control requires users to perform a series of complex operations, such as long presses, short presses, or specific touch gestures, to activate or adjust the primary earphone's microphone and noise reduction functions. These steps require users to memorize them accurately, increasing the user's operational burden and reducing the convenience of controlling the microphone and noise reduction modules. Therefore, how to control the primary earphone's microphone and noise reduction module is also a pressing issue.
[0005] To sum up, how to select the main earphone between the right earphone and the left earphone of the TWS earphone, and how to control the microphone and noise reduction module of the main earphone are problems that need to be solved urgently. Summary of the Invention
[0006] The present invention provides a TWS headset control method, device, terminal device and storage medium to solve the problem of how to select a main headset between the right headset and the left headset of the TWS headset, and how to control the microphone and noise reduction module of the main headset.
[0007] In a first aspect, a TWS headset control method is provided, which is applied to a terminal device, wherein the terminal device is connected to a TWS headset, and the TWS headset includes a left headset and a right headset, including:
[0008] During a call, obtain the signal strength of the TWS headset connected to the device;
[0009] When the signal strength is greater than a preset strength, obtaining the battery information of the TWS headset;
[0010] From the power information, obtain the power of the left earphone and the power of the right earphone;
[0011] When the power level of the left earphone is greater than that of the right earphone, the left earphone is selected as the master earphone; when the power level of the left earphone is less than that of the right earphone, the right earphone is selected as the master earphone;
[0012] Obtaining a current state of the microphone of the primary headset, and when the current state of the microphone is off, controlling the microphone to switch from the off state to the on state;
[0013] Acquire the sound signal collected by the microphone in the on state, acquire the noise signal in the sound signal, and when the noise signal meets the noise reduction condition, control the noise reduction module to switch from the standby state to the working state.
[0014] The step of obtaining the sound signal collected by the microphone in the turned-on state, obtaining the noise signal in the sound signal, and controlling the noise reduction module to switch from the standby state to the working state when the noise signal meets the noise reduction condition includes:
[0015] Sending a second acquisition instruction to the master earphone, where the second acquisition instruction is an instruction for acquiring a current state of the noise reduction module;
[0016] receiving a current state of the noise reduction module returned by the master headset according to the second acquisition instruction;
[0017] When the current state of the noise reduction module is the standby state, obtaining the sound signal collected by the microphone in the turned-on state;
[0018] Acquire a speech signal and a noise signal from the sound signal, and save the speech signal and the noise signal;
[0019] When the noise signal meets the noise reduction condition, a second control instruction is sent to the master earphone so that the master earphone controls the noise reduction module to switch from the standby state to the working state according to the second control instruction. The second control instruction is an instruction to control the noise reduction module to switch from the standby state to the working state.
[0020] Furthermore, when the signal strength is greater than a preset strength, obtaining the battery information of the TWS headset includes:
[0021] When the signal strength is greater than a preset strength, a read request is sent to the TWS headset, where the read request carries a power level indicator;
[0022] Receive the power information returned by the TWS headset according to the power identifier.
[0023] Furthermore, obtaining the power level of the left earphone and the power level of the right earphone from the power level information includes:
[0024] Get read instruction;
[0025] The read instruction is executed to read the power level of the left earphone and the power level of the right earphone from the power level information.
[0026] Further, when the power level of the left earphone is greater than that of the right earphone, the left earphone is selected as the master earphone; when the power level of the left earphone is less than that of the right earphone, the right earphone is selected as the master earphone, including:
[0027] When the power level of the left earphone is greater than the power level of the right earphone, a first selection instruction is sent to the TWS earphone, so that the TWS earphone selects the left earphone as the master earphone according to the first selection instruction, where the first selection instruction is an instruction to select the left earphone as the master earphone;
[0028] When the power of the left earphone is less than the power of the right earphone, a second selection instruction is sent to the TWS earphone, so that the TWS earphone selects the right earphone as the main earphone according to the second selection instruction, and the second selection instruction is an instruction to select the right earphone as the main earphone.
[0029] Furthermore, the acquiring the current state of the microphone of the master headset, and when the current state of the microphone is off, controlling the microphone to switch from the off state to the on state, includes:
[0030] Sending a first acquisition instruction to the master earphone, where the first acquisition instruction is an instruction for acquiring a current state of the microphone;
[0031] Receive the current state of the microphone returned by the main earphone according to the first acquisition instruction, and when the current state of the microphone is off, send a first control instruction to the main earphone, so that the main earphone controls the microphone to switch from the off state to the on state according to the first control instruction, wherein the first control instruction is an instruction to control the microphone to switch from the off state to the on state.
[0032] Furthermore, the acquiring of the sound signal collected by the microphone in the turned-on state, acquiring a noise signal in the sound signal, and when the noise signal meets the noise reduction condition, controlling the noise reduction module to switch from the standby state to the working state includes:
[0033] Sending a second acquisition instruction to the master earphone, where the second acquisition instruction is an instruction for acquiring a current state of the noise reduction module;
[0034] receiving the current state of the noise reduction module returned by the master headset according to the second acquisition instruction; when the current state of the noise reduction module is the standby state, acquiring the sound signal collected by the microphone in the turned-on state;
[0035] Acquire a speech signal and a noise signal from the sound signal, and save the speech signal and the noise signal;
[0036] When the noise signal meets the noise reduction condition, a second control instruction is sent to the master earphone so that the master earphone controls the noise reduction module to switch from the standby state to the working state according to the second control instruction. The second control instruction is an instruction to control the noise reduction module to switch from the standby state to the working state.
[0037] Exemplarily, obtaining a speech signal and a noise signal from the sound signal and saving the speech signal and the noise signal include:
[0038] Uploading the sound signal and an instruction to the server, wherein the instruction is used to instruct the first server to perform blind source separation on the sound signal to obtain a speech signal and a noise signal;
[0039] Obtaining the voice signal and the noise signal returned by the server according to the instruction, and calculating a signal-to-noise ratio between the voice signal and the noise signal;
[0040] When the signal-to-noise ratio between the speech signal and the noise signal is less than a preset signal-to-noise ratio, the speech signal and the noise signal are saved.
[0041] Furthermore, when the noise signal satisfies the noise reduction condition, sending a second control instruction to the master earphone includes:
[0042] Obtaining a comprehensive evaluation coefficient of the noise signal through a predefined acquisition method;
[0043] When the comprehensive evaluation coefficient is greater than the preset coefficient, it is determined that the noise signal meets the noise reduction condition, and a second control instruction is sent to the master earphone.
[0044] Exemplarily, obtaining the comprehensive evaluation coefficient of the noise signal through a predefined acquisition method includes:
[0045] Obtaining a start time and an end time of a noise signal, determining a duration of the noise signal based on the start time and the end time, and comparing the duration with a preset duration to generate a first ratio;
[0046] Acquiring multiple amplitude values of the linear amplitude spectrum of the noise signal, selecting a maximum value among the multiple amplitude values as a maximum amplitude value, and comparing the maximum amplitude value with a preset amplitude value to generate a second ratio;
[0047] acquiring multiple frequencies of the linear amplitude spectrum of the noise signal, selecting a maximum value among the multiple frequencies as a maximum frequency, and comparing the maximum frequency with a preset frequency to generate a third ratio;
[0048] The first ratio, the second ratio, and the third ratio are added together to generate a comprehensive evaluation coefficient of the noise signal.
[0049] Optionally, obtaining a start time and an end time of a noise signal, determining a duration of the noise signal based on the start time and the end time, and comparing the duration with a preset duration to generate a first ratio includes:
[0050] Obtaining the start time and end time of the noise signal, determining the duration of the noise signal based on the start time and the end time, comparing the duration with a preset duration to generate an initial ratio, and determining whether the initial ratio is greater than a preset maximum ratio;
[0051] When the initial ratio is greater than a preset maximum ratio, the initial ratio is multiplied by a magnification coefficient to generate the amplified initial ratio, and the amplified initial ratio is selected as the first ratio.
[0052] The method of obtaining a plurality of amplitude values of the linear amplitude spectrum of the noise signal, selecting a maximum value among the plurality of amplitude values as a maximum amplitude value, and comparing the maximum amplitude value with a preset amplitude value to generate a second ratio includes:
[0053] Performing Fourier transform on the noise signal to obtain a linear amplitude spectrum of the noise signal;
[0054] A plurality of amplitude values of the linear amplitude spectrum of the noise signal is obtained, a maximum value among the plurality of amplitude values is selected as a maximum amplitude value, and the maximum amplitude value is compared with a preset amplitude value to generate a second ratio.
[0055] wherein, a plurality of frequencies of the linear amplitude spectrum of the noise signal are obtained, a maximum value among the plurality of frequencies is selected as a maximum frequency, and the maximum frequency is compared with a preset frequency to generate a third ratio;
[0056] Acquire multiple frequencies of the linear amplitude spectrum of the noise signal, and sort the multiple frequencies;
[0057] According to the sorting result, a maximum value among the multiple frequencies is selected as the maximum frequency, and the maximum frequency is compared with a preset frequency to generate a third ratio.
[0058] Optionally, adding the first ratio, the second ratio, and the third ratio to generate a comprehensive evaluation coefficient of the noise signal includes:
[0059] According to a preset generation model, the first ratio, the second ratio, and the third ratio are added together to generate a comprehensive evaluation coefficient of the noise signal.
[0060] Wherein, the generation model is:
[0061] E= E1×M1+ E2×M2+ E3×M3;
[0062] Among them, E is the comprehensive evaluation coefficient, E1 is the first ratio, M1 is the first weight coefficient; E2 is the second ratio, M2 is the second weight coefficient; E3 is the third ratio, M3 is the third weight coefficient, and the sum of M1, M2 and M3 is 1.
[0063] Exemplarily, when the comprehensive evaluation coefficient is greater than a preset coefficient, it is determined that the noise signal meets the noise reduction condition, and a second control instruction is sent to the master earphone, including:
[0064] When the comprehensive evaluation coefficient is greater than a preset coefficient, obtaining the transmission delay of the master earphone;
[0065] When the transmission delay is less than the preset delay, a second control instruction is sent to the master headset.
[0066] In a second aspect, a TWS headset control device is provided, which is applied to a terminal device, wherein the terminal device is connected to a TWS headset, and the TWS headset includes a left headset and a right headset, including:
[0067] A first acquisition module is used to obtain the signal strength of the TWS headset during a call;
[0068] A second acquisition module is used to obtain the power information of the TWS headset when the signal strength is greater than a preset strength;
[0069] a third acquisition module, configured to acquire the power level of the left earphone and the power level of the right earphone from the power level information;
[0070] A selection module, configured to select the left earphone as the master earphone when the power level of the left earphone is greater than that of the right earphone, and select the right earphone as the master earphone when the power level of the left earphone is less than that of the right earphone;
[0071] a first control module, configured to obtain a current state of the microphone of the primary headset, and when the current state of the microphone is off, control the microphone to switch from the off state to the on state;
[0072] The second control module is used to obtain the sound signal collected by the microphone in the turned-on state, obtain the noise signal in the sound signal, and when the noise signal meets the noise reduction condition, control the noise reduction module to switch from the standby state to the working state.
[0073] In a third aspect, a terminal device is provided, including a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the steps of the above-mentioned TWS headset control method are implemented.
[0074] In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of the above-mentioned TWS headset control method are implemented.
[0075] The present application provides a TWS headset control method, device, terminal device and storage medium, which have beneficial effects in two aspects. On the one hand, when the power of the left earphone is greater than that of the right earphone, the left earphone is selected as the main earphone; when the power of the left earphone is less than that of the right earphone, the right earphone is selected as the main earphone, which solves the problem of how to select the main earphone between the right earphone and the left earphone of the TWS headset, and is beneficial to improving the battery life of the selected main earphone; on the other hand, the current state of the microphone of the main earphone is obtained, and when the current state of the microphone is off, the microphone is controlled to switch from the off state to the on state; the sound signal collected by the microphone in the on state is obtained, and the noise signal in the sound signal is obtained. When the noise signal meets the noise reduction condition, the noise reduction module is controlled to switch from the standby state to the working state, which solves the problem of how to control the microphone and noise reduction module of the main earphone. Since there is no need to manually control the microphone and noise reduction module, the control time of the microphone and noise reduction module is reduced, which is beneficial to improving the control efficiency of the microphone and noise reduction module. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0077] Figure 1 This is a schematic diagram of an application environment of a TWS headset control method according to an embodiment of the present invention;
[0078] Figure 2 A schematic flow chart of a TWS headset control method provided by one embodiment of the present invention;
[0079] Figure 3 yes Figure 1 A schematic flow chart of a specific implementation of step S23;
[0080] Figure 4 yes Figure 1 A schematic flow chart of a specific implementation of step S25;
[0081] Figure 5 yes Figure 1 A schematic flow chart of a specific implementation of step S26;
[0082] Figure 6 2 is a schematic structural diagram of a TWS earphone control device in one embodiment of the present invention. DETAILED DESCRIPTION
[0083] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, but not all of the embodiments.
[0084] See also Figure 1 , Figure 1 This is a schematic diagram of an application environment of a TWS headset control method according to an embodiment of the present invention. The TWS headset control method provided by the embodiment of the present invention can be applied in the following situations: Figure 1 In the application environment, the terminal device communicates with the TWS headset via Bluetooth.
[0085] During a call, the terminal device obtains the signal strength of the TWS headset;
[0086] When the signal strength is greater than a preset strength, obtaining the battery information of the TWS headset;
[0087] From the power information, obtain the power of the left earphone and the power of the right earphone;
[0088] When the left earphone has more power than the right earphone, the left earphone is selected as the master earphone; when the left earphone has less power than the right earphone, the right earphone is selected as the master earphone.
[0089] Obtaining the current state of the microphone of the master earphone, when the current state of the microphone is a closed state, controlling the microphone to switch from the closed state to an open state;
[0090] Obtaining the sound signal collected by the microphone in the open state, obtaining the noise signal in the sound signal, when the noise signal meets the noise reduction condition, controlling the noise reduction module to switch from the standby state to the working state.
[0091] Among them, the terminal device can include but is not limited to smart phones, notebook computers, tablet computers and portable wearable devices.
[0092] The application provides a TWS earphone control method, device, terminal device and storage medium, which has two beneficial effects. On the one hand, it solves the problem of how to select the master earphone from the right earphone and the left earphone of the TWS earphone, and is conducive to improving the endurance time of the selected master earphone. On the other hand, it solves the problem of how to control the microphone and the noise reduction module of the master earphone. Since the microphone and the noise reduction module do not need to be controlled manually, the control time of the microphone and the noise reduction module is reduced, which is conducive to improving the control efficiency of the microphone and the noise reduction module.
[0093] Please refer to Figure 2 , Figure 2 A flowchart of a TWS earphone control method provided by an embodiment of the application, Figure 2 The TWS earphone control method is applied to a terminal device, the terminal device is connected to a TWS earphone, the TWS earphone includes a left earphone and a right earphone, and the TWS earphone control method includes the following steps:
[0094] S21, obtaining the signal strength of the connected TWS earphone during the call process;
[0095] Here, the terminal device refers to the subject, which is used to perform the signal strength acquisition operation. The TWS earphone is a wireless earphone device connected to the terminal device through Bluetooth technology, which is the measured object, i.e. the object.
[0096] When the terminal device successfully establishes a Bluetooth connection with the TWS earphone, the terminal device will monitor the signal strength between the terminal device and the TWS earphone in real time through the built-in Bluetooth chip or module during the call process. This process is usually automatic and does not require manual intervention. The Bluetooth chip will send signals to the Bluetooth earphone at a certain frequency and receive its response, and the current signal strength will be calculated by measuring the strength of the response signal to ensure the stability of the Bluetooth connection.
[0097] S22, when the signal strength is greater than the preset strength, obtaining the power information of the TWS earphone;
[0098] The signal strength is an important indicator of connection quality, and when the signal strength is greater than the preset strength, the power information of the TWS earphone is obtained. This step effectively avoids the failure or error of power information acquisition caused by unstable signals, and improves the accuracy and reliability of the acquired power information of the TWS earphone.
[0099] The signal strength is an important indicator of connection quality, and when the signal strength is greater than the preset strength, the power information of the TWS earphone is obtained. This step effectively avoids the failure or error of power information acquisition caused by unstable signals, and improves the accuracy and reliability of the acquired power information of the TWS earphone.
[0100] When the signal strength is greater than the preset strength, a read request is sent to the TWS earphone, and the read request carries a power identifier;
[0101] The TWS earphone returns the power information according to the power identifier.
[0102] The terminal device sends a read request to the TWS earphone when the signal strength is greater than the preset strength, and the read request carries a power identifier;
[0103] The TWS earphone receives the read request and returns the power information to the terminal device according to the power identifier in the read request.
[0104] The terminal device receives the power information returned by the TWS earphone according to the power identifier.
[0105] The terminal device receives the power information returned by the TWS earphone according to the power identifier.
[0106] S23, in the power information, obtaining the power of the left earphone and the power of the right earphone;
[0107] S24, when the power of the left earphone is greater than the power of the right earphone, selecting the left earphone as the main earphone, and when the power of the left earphone is less than the power of the right earphone, selecting the right earphone as the main earphone.
[0108] Among them, the terminal device compares the power levels of the left earphone and the right earphone and can select the earphone with more power as the primary earphone, which can increase the battery life of the primary earphone and thus improve the user's overall usage experience. In addition, using the primary earphone for calls can ensure that calls are not interrupted due to low earphone power, thereby extending the overall call time. In addition, the earphone with lower power may cause unstable Bluetooth connection due to degraded battery performance. Selecting the earphone with more power as the primary earphone can ensure the stability of the Bluetooth connection and thus improve call quality.
[0109] The method of selecting the left earphone as the master earphone when the power level of the left earphone is greater than the power level of the right earphone, and selecting the right earphone as the master earphone when the power level of the left earphone is less than the power level of the right earphone, includes:
[0110] When the power level of the left earphone is greater than the power level of the right earphone, a first selection instruction is sent to the TWS earphone, so that the TWS earphone selects the left earphone as the master earphone according to the first selection instruction, where the first selection instruction is an instruction to select the left earphone as the master earphone;
[0111] When the power of the left earphone is less than the power of the right earphone, a second selection instruction is sent to the TWS earphone, so that the TWS earphone selects the right earphone as the main earphone according to the second selection instruction, and the second selection instruction is an instruction to select the right earphone as the main earphone.
[0112] S25, obtaining a current state of the microphone of the master headset, and when the current state of the microphone is off, controlling the microphone to switch from the off state to the on state;
[0113] Among them, the microphone is switched from the off state to the on state, and the microphone of the main earphone is turned on, so that the voice of the user of the main earphone can be transmitted to the other party in real time, completing two-way voice communication.
[0114] S26, obtaining the sound signal collected by the microphone in the turned-on state, obtaining the noise signal in the sound signal, and when the noise signal meets the noise reduction condition, controlling the noise reduction module to switch from the standby state to the working state.
[0115] The noise reduction module has a standby state and a working state.
[0116] The standby state refers to a state in which the noise reduction module does not perform noise reduction processing.
[0117] When the noise reduction module enters the standby state, no noise reduction processing is performed to reduce power consumption.
[0118] The working state refers to the state in which the noise reduction module performs noise reduction processing.
[0119] When the noise reduction module enters the working state, it captures and analyzes the noise in the surrounding environment, and then generates reverse sound waves to offset it to achieve the noise reduction effect. Among them, it is determined that the noise signal meets the noise reduction conditions, and a second control instruction is sent to the main earphone. This helps the main earphone to promptly control the noise reduction module to switch from standby mode to working mode. In this way, it can quickly identify the noise in the call environment and automatically take suppression measures to minimize these unnecessary noises. This process not only enhances the dominant position of the human voice, making the voices of both parties on the call clearer and more natural, but also greatly improves the overall quality of the call. Even in complex noisy environments, it can ensure the smoothness and coherence of the call, thereby bringing users a more pleasant and efficient communication experience.
[0120] When the noise signal satisfies the noise reduction condition, sending a second control instruction to the master earphone includes:
[0121] Obtaining a comprehensive evaluation coefficient of the noise signal through a predefined acquisition method;
[0122] When the comprehensive evaluation coefficient is greater than the preset coefficient, it is determined that the noise signal meets the noise reduction condition, and a second control instruction is sent to the master earphone.
[0123] Among them, by comparing the comprehensive evaluation coefficient of the noise signal and the preset coefficient, the comprehensive characteristics of the noise signal can be verified, the error and uncertainty can be reduced, which is conducive to enhancing the recognition ability of the noise signal and improving the recognition accuracy of the noise signal.
[0124] Exemplarily, obtaining the comprehensive evaluation coefficient of the noise signal through a predefined acquisition method includes:
[0125] Obtaining a start time and an end time of a noise signal, determining a duration of the noise signal based on the start time and the end time, and comparing the duration with a preset duration to generate a first ratio;
[0126] Acquiring multiple amplitude values of the linear amplitude spectrum of the noise signal, selecting a maximum value among the multiple amplitude values as a maximum amplitude value, and comparing the maximum amplitude value with a preset amplitude value to generate a second ratio;
[0127] acquiring multiple frequencies of the linear amplitude spectrum of the noise signal, selecting a maximum value among the multiple frequencies as a maximum frequency, and comparing the maximum frequency with a preset frequency to generate a third ratio;
[0128] The first ratio, the second ratio, and the third ratio are added together to generate a comprehensive evaluation coefficient of the noise signal.
[0129] Optionally, the preset duration is 5 seconds.
[0130] Optionally, the preset amplitude value is 0.8.
[0131] Optionally, the preset frequency is 1000 Hz.
[0132] For ease of explanation, the following example shows the process of setting the preset duration:
[0133] For example, consider urban traffic noise, which includes the engine noise, tire friction, and horn honking. If the horn honks continuously for more than five seconds, this constant noise is enough to distract people from the speech content, forcing them to focus on and adapt to the horn.
[0134] Therefore, optionally, the preset duration is 5 seconds.
[0135] For ease of explanation, the process of setting the preset amplitude value is as follows:
[0136] For example, consider the noise signal originating from urban traffic noise. The linear amplitude spectrum of urban traffic noise exhibits varying intensities at different frequencies. The 1000Hz frequency band is particularly important for speech intelligibility. For example, the linear amplitude spectrum of urban traffic noise has an amplitude of 1.5 at 1000Hz, while the linear amplitude spectrum of a speech signal has an amplitude of 0.8 at 1000Hz. These numerical values directly reflect the relative strength of the speech signal.
[0137] During a call, when noise and voice signals are simultaneously captured by the TWS headset's integrated microphone, if the noise signal has a high amplitude, it will dominate the voice signal reception and processing. This noise can mask key information in the sender's voice signal, such as important vocabulary or intonation, making it difficult for the receiver to accurately understand the call.
[0138] Therefore, optionally, the preset amplitude value is 0.8.
[0139] For ease of explanation, the following example shows the process of setting the preset frequency:
[0140] For example, taking the noise signal from urban traffic noise as an example, the energy of urban traffic noise in the range of hundreds of hertz is more significant, such as 300Hz to 1000Hz. This is mainly due to the engines of cars, motorcycles, and buses, the friction between tires and the road, and the vibration of the car body, which all generate noise in this frequency band. 1000Hz to 3000Hz is generally considered to be one of the frequency bands that the human ear is most sensitive to, and is crucial to the clarity of speech.
[0141] When the frequency distribution of urban traffic noise is also concentrated around 1000Hz, the interference between the noise signal and the speech signal becomes particularly significant. This is because when the noise signal and the speech signal coexist in the same frequency band, they interfere with each other, distorting key information in the speech signal and reducing speech intelligibility and clarity.
[0142] Therefore, optionally, the preset frequency is 1000 Hz.
[0143] The duration of the noise signal refers to the length of time it takes for the noise signal to start and end.
[0144] For ease of explanation, the process of obtaining the start time and end time of a noise signal and determining the duration of the noise signal based on the start time and end time is exemplified as follows:
[0145] For example, when the noise signal starts at the 2nd second and ends at the 8th second, the duration of the noise signal is:
[0146] Duration = 8 seconds - 2 seconds = 6 seconds.
[0147] For example, when the noise signal starts at the 3rd second and ends at the 12th second, the duration of the noise signal is:
[0148] Duration = 12 seconds - 3 seconds = 9 seconds.
[0149] Among them, obtaining the start time and end time of the noise signal and determining the duration of the noise signal based on the start time and end time can eliminate accidental or temporary noise interference and improve the efficiency of noise recognition to a certain extent.
[0150] Optionally, obtaining a start time and an end time of a noise signal, determining a duration of the noise signal based on the start time and the end time, and comparing the duration with a preset duration to generate a first ratio includes:
[0151] obtaining a start time and an end time of the noise signal, determining a duration of the noise signal according to the start time and the end time, comparing the duration with a preset duration to generate an initial ratio value, and determining whether the initial ratio value is greater than a preset maximum ratio value;
[0152] When the initial ratio value is greater than the preset maximum ratio value, multiplying the initial ratio value by an amplification coefficient to generate an amplified initial ratio value, and selecting the amplified initial ratio value as a first ratio value.
[0153] Among them, the communication environment itself exists a sustained noise source, such as busy streets, airports, railway stations or construction sites nearby, noisy noise on the street, construction noise, noise of aircraft take-off and landing continues, the noise signal generated by these noises will interfere with the call for a long time, resulting in the duration of the noise signal far exceeding the expectation.
[0154] When the maximum duration of the noise signal exceeds 10 seconds, the two parties of the call may begin to feel obvious discomfort and distraction, affecting the quality and efficiency of communication.
[0155] Optionally, the maximum duration of the noise signal is 10 seconds.
[0156] Among them, the maximum ratio value = maximum duration / preset duration.
[0157] Among them, when the maximum duration of the noise signal is 10 seconds, the maximum ratio value = 10 seconds / 5 seconds = 2.
[0158] Among them, because there are sometimes situations where the duration of the noise signal far exceeds the expectation in the communication environment, multiplying the first ratio value by an amplification coefficient to generate an amplified first ratio value, the amplified first ratio value can enhance the influence of the duration of the noise signal on the comprehensive evaluation coefficient, which is beneficial for noise identification in the communication environment.
[0159] Among them, a plurality of amplitude values of the linear amplitude spectrum of the noise signal are obtained, and the maximum value in the plurality of amplitude values is selected as a maximum amplitude value, and the maximum amplitude value is compared with a preset amplitude value to generate a second ratio value, including:
[0160] performing Fourier transform on the noise signal to obtain a linear amplitude spectrum of the noise signal;
[0161] obtaining a plurality of amplitude values of the linear amplitude spectrum of the noise signal, selecting the maximum value in the plurality of amplitude values as a maximum amplitude value, and comparing the maximum amplitude value with a preset amplitude value to generate a second ratio value.
[0162] Among them, Fourier Transform is an important mathematical tool that can convert time domain signals into frequency domain signals, thereby revealing the characteristics of the signal in frequency.
[0163] During noise monitoring and analysis, the maximum of the multiple amplitude values is selected as the maximum amplitude value, avoiding a comprehensive and complex analysis of multiple amplitude values in the linear amplitude spectrum, thereby improving the efficiency of noise identification. This is particularly important during real-time noise monitoring, as it allows terminal devices to quickly respond and take appropriate noise reduction measures.
[0164] A linear amplitude spectrum represents a noise signal in the frequency domain, with amplitude values expressed on a linear scale. The amplitude values directly and accurately reflect the relative strength of the noise signal. Specifically, higher amplitude values indicate stronger noise energy at that frequency, meaning it's louder or more noticeable. Conversely, lower amplitude values indicate weaker noise energy at that frequency, making it softer or less noticeable.
[0165] The graph of the linear amplitude spectrum is a two-dimensional graph, in which the horizontal axis represents the frequency and the vertical axis represents the amplitude value.
[0166] For ease of explanation, the process of selecting the maximum value among the multiple amplitude values as the maximum amplitude value is exemplified as follows:
[0167] For example, there are 3 amplitude values, which are 0.81, 0.82, and 0.85 respectively.
[0168] Select 0.85 as the maximum amplitude value.
[0169] For example, there are 5 amplitude values, which are 0.51, 0.52, 0.55, 0.56, and 0.57.
[0170] Select 0.57 as the maximum amplitude value.
[0171] wherein, a plurality of frequencies of the linear amplitude spectrum of the noise signal are obtained, a maximum value among the plurality of frequencies is selected as a maximum frequency, and the maximum frequency is compared with a preset frequency to generate a third ratio;
[0172] Acquire multiple frequencies of the linear amplitude spectrum of the noise signal, and sort the multiple frequencies;
[0173] According to the sorting result, a maximum value among the multiple frequencies is selected as the maximum frequency, and the maximum frequency is compared with a preset frequency to generate a third ratio.
[0174] During noise monitoring and analysis, the maximum value of the multiple frequencies is selected as the maximum frequency, avoiding the need for comprehensive and complex analysis of multiple frequencies in the linear amplitude spectrum, thereby improving noise identification efficiency. This is particularly important during real-time noise monitoring, as it also facilitates rapid response and the implementation of appropriate noise reduction measures by the terminal device.
[0175] For ease of explanation, the process of selecting the maximum value among the multiple frequencies as the maximum frequency is exemplified as follows:
[0176] For example, if there are three frequencies, 500 Hz, 600 Hz, and 800 Hz, select 800 Hz as the maximum frequency.
[0177] For example, if there are five frequencies, namely 300 Hz, 400 Hz, 500 Hz, 600 Hz, and 700 Hz, select 700 Hz as the maximum frequency.
[0178] Among them, the first ratio, the second ratio, and the third ratio are generated respectively according to the duration, the maximum amplitude value, and the maximum frequency, and the first ratio, the second ratio, and the third ratio are integrated into a comprehensive evaluation coefficient of the noise signal. This can greatly simplify the complexity of the system. Since the comprehensive evaluation coefficient can integrate the information of the first ratio, the second ratio, and the third ratio, it can reflect the overall state of the noise signal more comprehensively and accurately, which makes the analysis of the noise signal easier.
[0179] Optionally, adding the first ratio, the second ratio, and the third ratio to generate a comprehensive evaluation coefficient of the noise signal includes:
[0180] According to a preset generation model, the first ratio, the second ratio, and the third ratio are added together to generate a comprehensive evaluation coefficient of the noise signal.
[0181] Among them, this mechanism ensures that the evaluation system can accurately reflect the contribution of the first ratio, the second ratio, and the third ratio to the overall result.
[0182] Wherein, the generation model is:
[0183] E= E1×M1+ E2×M2+ E3×M3;
[0184] Among them, E is the comprehensive evaluation coefficient, E1 is the first ratio, M1 is the weight coefficient of the first ratio; E2 is the second ratio, M2 is the weight coefficient of the second ratio; E3 is the third ratio, M3 is the weight coefficient of the third ratio, and the sum of M1, M2 and M3 is 1.
[0185] Wherein, the first ratio is greater than 1, indicating that the current difference between the duration and the preset duration is greater than the expected difference between the duration and the preset duration;
[0186] The first ratio is equal to 1, indicating that the current difference between the duration and the preset duration is equal to the expected difference between the duration and the preset duration;
[0187] The first ratio is less than 1, indicating that the current difference between the duration and the preset duration is less than the expected difference between the duration and the preset duration.
[0188] Wherein, the second ratio is greater than 1, indicating that the current difference between the maximum amplitude value and the preset amplitude value is greater than the expected difference between the maximum amplitude value and the preset amplitude value;
[0189] The second ratio is equal to 1, indicating that the current difference between the maximum amplitude value and the preset amplitude value is equal to the expected difference between the maximum amplitude value and the preset amplitude value;
[0190] The second ratio is less than 1, indicating that the current difference between the maximum amplitude value and the preset amplitude value is less than the expected difference between the maximum amplitude value and the preset amplitude value.
[0191] The third ratio is greater than 1, indicating that the current difference between the maximum frequency and the preset frequency is greater than the expected difference between the maximum frequency and the preset frequency.
[0192] The third ratio is equal to 1, indicating that the current difference between the maximum frequency and the preset frequency is equal to the expected difference between the maximum frequency and the preset frequency;
[0193] The third ratio is less than 1, indicating that the current difference between the maximum frequency and the preset frequency is less than the expected difference between the maximum frequency and the preset frequency.
[0194] The larger the weight coefficient of the first ratio is, the greater the influence of the first ratio on the comprehensive evaluation coefficient is; the smaller the weight coefficient of the first ratio is, the smaller the influence of the first ratio on the comprehensive evaluation coefficient is.
[0195] The larger the weight coefficient of the second ratio, the greater the influence of the second ratio on the comprehensive evaluation coefficient; the smaller the weight coefficient of the second ratio, the smaller the influence of the second ratio on the comprehensive evaluation coefficient;
[0196] The larger the weight coefficient of the third ratio, the greater the influence of the third ratio on the comprehensive evaluation coefficient; the smaller the weight coefficient of the third ratio, the smaller the influence of the third ratio on the comprehensive evaluation coefficient.
[0197] This mechanism ensures that the evaluation system can accurately reflect the contribution of the first ratio, the second ratio, and the third ratio to the comprehensive evaluation coefficient.
[0198] Optionally, the first weight coefficient is 0.4, the second weight coefficient is 0.3, and the third weight coefficient is 0.3.
[0199] The technical effects of this weight distribution strategy are: First, it highlights the core position of the first ratio in the overall evaluation, because the first ratio has a weight coefficient of 0.4, the highest among the three, indicating that the first ratio contributes the most to the comprehensive evaluation coefficient and is decisive or crucial. Secondly, by giving the second and third ratios a weight coefficient of 0.3, it ensures that they also occupy a very important position in the evaluation system, avoiding the situation where the second and third ratios are neglected due to over-emphasis on the first ratio. This balance not only reflects the importance attached to the first ratio, but also ensures the comprehensiveness and fairness of the evaluation. In general, such a weight distribution strategy not only highlights the key points but also takes into account the overall situation, which is conducive to a more scientific and reasonable comprehensive evaluation.
[0200] Exemplarily, when the comprehensive evaluation coefficient is greater than a preset coefficient, it is determined that the noise signal meets the noise reduction condition, and a second control instruction is sent to the master earphone, including:
[0201] When the comprehensive evaluation coefficient is greater than a preset coefficient, obtaining the transmission delay of the master earphone;
[0202] When the transmission delay is less than the preset delay, a second control instruction is sent to the master headset.
[0203] The second control instruction is an instruction for controlling the noise reduction module to switch from a standby state to a working state.
[0204] The noise reduction module is activated only when the transmission delay is less than the preset delay. This ensures that the noise reduction process does not introduce additional delay during communication, thus maintaining the real-time nature of communication. This is particularly important for applications that require instant response, such as voice calls, video conferencing, and online gaming.
[0205] Exemplarily, after obtaining the sound signal collected by the microphone in the turned-on state, obtaining the noise signal in the sound signal, and controlling the noise reduction module to switch from the standby state to the working state when the noise signal meets the noise reduction condition, the TWS headset control device further includes:
[0206] Obtain scores corresponding to the multiple noise suppression algorithms, add the scores corresponding to the multiple noise suppression algorithms, and generate a total score;
[0207] Dividing the scores corresponding to the multiple noise suppression algorithms by the total score to generate the confidence levels corresponding to the multiple noise suppression algorithms;
[0208] Obtaining noise suppression amounts corresponding to each of the plurality of noise suppression algorithms;
[0209] multiplying the noise suppression amounts corresponding to the plurality of noise suppression algorithms by the confidence levels corresponding to the plurality of noise suppression algorithms to generate evaluation values corresponding to the plurality of noise suppression algorithms;
[0210] The noise suppression algorithm with the largest evaluation value is selected to perform noise reduction on the sound signal.
[0211] The server is connected to obtain scores of multiple noise suppression algorithms on the scoring page through the server.
[0212] For ease of explanation, the following examples are given:
[0213] For example, there are three noise suppression algorithms, namely noise suppression algorithm 1, noise suppression algorithm 2, and noise suppression algorithm 3; the scoring page has three rows, the first row displays the score of noise suppression algorithm 1, the second row displays the score of noise suppression algorithm 2, and the scoring page has three rows, the third row displays the score of noise suppression algorithm 3.
[0214] The higher the score corresponding to the noise suppression algorithm, the more positive evaluations there are for the noise suppression algorithm, and the lower the score corresponding to the noise suppression algorithm, the lower the positive evaluations there are for the noise suppression algorithm.
[0215] Among them, when evaluating noise suppression algorithms, the score becomes an important yardstick for measuring trust.
[0216] Noise suppression is a parameter used to quantitatively evaluate the effectiveness of noise reduction or elimination. It generally refers to the magnitude or ratio of the noise level reduction after a specific treatment or system application, relative to the pre-treatment level. By calculating the noise energy, power, or decibel level before and after treatment, the degree of noise suppression can be quantified, helping end devices evaluate noise suppression algorithms.
[0217] For ease of explanation, the following examples are given:
[0218] For example, there are three noise suppression algorithms, namely noise suppression algorithm 1, noise suppression algorithm 2, and noise suppression algorithm 3;
[0219] A test signal containing noise is obtained, and the test signal is processed by noise suppression algorithm 1 to obtain the test signal processed by noise suppression algorithm 1. The noise suppression amount corresponding to each noise suppression algorithm 1 is determined by comparing the test signal before processing with the test signal after processing by noise suppression algorithm 1. The noise suppression amount corresponding to noise suppression algorithm 1 is multiplied by the confidence level corresponding to noise suppression algorithm 1 to generate an evaluation value corresponding to noise suppression algorithm 1.
[0220] Obtain a test signal containing noise, process the test signal through noise suppression algorithm 2, obtain the test signal processed by noise suppression algorithm 2, determine the noise suppression amount corresponding to each noise suppression algorithm 2 by comparing the test signal before processing with the test signal after processing by noise suppression algorithm 2, multiply the noise suppression amount corresponding to noise suppression algorithm 2 by the trust degree corresponding to noise suppression algorithm 2, and generate an evaluation value corresponding to noise suppression algorithm 2.
[0221] Obtain a test signal containing noise, process the test signal using noise suppression algorithm 3 to obtain a test signal processed by noise suppression algorithm 3, determine a noise suppression amount corresponding to each noise suppression algorithm 3 by comparing the test signal before processing with the test signal after processing by noise suppression algorithm 3, multiply the noise suppression amount corresponding to noise suppression algorithm 3 by the confidence level corresponding to noise suppression algorithm 3, and generate an evaluation value corresponding to noise suppression algorithm 3;
[0222] When the evaluation value corresponding to the noise suppression algorithm 1 is the largest, the noise suppression algorithm 1 is selected to perform noise reduction on the sound signal;
[0223] When the evaluation value corresponding to the noise suppression algorithm 2 is the largest, the noise suppression algorithm 2 is selected to perform noise reduction on the sound signal;
[0224] When the evaluation value corresponding to the noise suppression algorithm 3 is the largest, the noise suppression algorithm 3 is selected to perform noise reduction on the sound signal.
[0225] Among them, noise suppression algorithm 1, noise suppression algorithm 2, and noise suppression algorithm 3 are different noise suppression algorithms.
[0226] Among them, although TWS headphones provide a certain degree of noise reduction effect, the terminal device will still activate the noise suppression algorithm as a means of secondary noise reduction to more accurately identify and suppress residual background noise and ensure the purity of the voice during the call.
[0227] In an embodiment of the present invention, the beneficial effects are in two aspects. On the one hand, when the power of the left earphone is greater than that of the right earphone, the left earphone is selected as the main earphone; when the power of the left earphone is less than that of the right earphone, the right earphone is selected as the main earphone, which solves the problem of how to select the main earphone between the right earphone and the left earphone of the TWS earphone, and is beneficial to improving the battery life of the selected main earphone; on the other hand, the current state of the microphone of the main earphone is obtained, and when the current state of the microphone is off, the microphone is controlled to switch from the off state to the on state; the sound signal collected by the microphone in the on state is obtained, and the noise signal in the sound signal is obtained. When the noise signal meets the noise reduction condition, the noise reduction module is controlled to switch from the standby state to the working state, which solves the problem of how to control the microphone and the noise reduction module of the main earphone. Since there is no need to manually control the microphone and the noise reduction module, the control time of the microphone and the noise reduction module is reduced, which is beneficial to improving the control efficiency of the microphone and the noise reduction module.
[0228] See also Figure 3 , Figure 3 yes Figure 1 A specific implementation flow diagram of step S23 is described in detail as follows:
[0229] S31, obtain a read instruction;
[0230] S32: Execute the read instruction and read the power level of the left earphone and the power level of the right earphone from the power level information.
[0231] In the embodiment of the present invention, the power level of the left earphone and the power level of the right earphone are read from the power level information, so that the power level of the left earphone and the power level of the right earphone can be obtained.
[0232] See also Figure 4 , Figure 4 yes Figure 1 A specific implementation flow diagram of step S25 is described in detail as follows:
[0233] S41, sending a first acquisition instruction to the master earphone, where the first acquisition instruction is an instruction for acquiring the current state of the microphone;
[0234] S42, receiving the current state of the microphone returned by the main earphone according to the first acquisition instruction, when the current state of the microphone is off, sending a first control instruction to the main earphone, so that the main earphone controls the microphone to switch from the off state to the on state according to the first control instruction, the first control instruction is an instruction to control the microphone to switch from the off state to the on state.
[0235] In an embodiment of the present invention, when the current state of the microphone is the off state, a first control instruction is sent to the main earphone. Since there is no need to manually control the microphone to switch from the off state to the on state, the process of controlling the microphone to switch from the off state to the on state is simplified, thereby reducing the control time of the microphone and helping to improve the control efficiency of the microphone.
[0236] See also Figure 5 , Figure 5 yes Figure 1 A specific implementation flow diagram of step S26 is described in detail as follows:
[0237] S51, sending a second acquisition instruction to the master earphone, where the second acquisition instruction is an instruction for acquiring the current state of the noise reduction module;
[0238] S52, receiving the current status of the noise reduction module returned by the master headset according to the second acquisition instruction;
[0239] S53, when the current state of the noise reduction module is the standby state, obtaining the sound signal collected by the microphone in the turned-on state;
[0240] S54, acquiring a speech signal and a noise signal from the sound signal, and saving the speech signal and the noise signal;
[0241] S55. When the noise signal meets the noise reduction condition, a second control instruction is sent to the master earphone so that the master earphone controls the noise reduction module to switch from the standby state to the working state according to the second control instruction. The second control instruction is an instruction to control the noise reduction module to switch from the standby state to the working state.
[0242] Exemplarily, obtaining a speech signal and a noise signal from the sound signal and saving the speech signal and the noise signal include:
[0243] Uploading the sound signal and an instruction to the server, wherein the instruction is used to instruct the first server to perform blind source separation on the sound signal to obtain a speech signal and a noise signal;
[0244] Obtaining the voice signal and the noise signal returned by the server according to the instruction, and calculating a signal-to-noise ratio between the voice signal and the noise signal;
[0245] When the signal-to-noise ratio between the speech signal and the noise signal is less than a preset signal-to-noise ratio, the speech signal and the noise signal are saved.
[0246] Among them, blind source separation (BSS) aims to recover multiple unknown source signals from a set of observed mixed signals without knowing the specific information of these source signals or the characteristics of the mixed system in advance.
[0247] As a powerful computing platform, the server has sufficient processing power to perform blind source separation on the sound signal to obtain a speech signal and a noise signal.
[0248] By uploading the sound signal and the instruction to the server, the instruction is used to instruct the first server to perform blind source separation on the sound signal to obtain a speech signal and a noise signal,
[0249] This allows for quick acquisition of speech and noise signals.
[0250] In an embodiment of the present invention, when the noise signal meets the noise reduction condition, a second control instruction is sent to the main earphone. Since there is no need to manually control the noise reduction module to switch from the standby state to the working state, the process of controlling the microphone to switch from the standby state to the working state is simplified, thereby reducing the control time of the noise reduction module, which is conducive to improving the control efficiency of the noise reduction module.
[0251] See also Figure 6 , Figure 6 FIG. 1 is a schematic diagram of a structure of a TWS earphone control device according to an embodiment of the present invention. Figure 6 As shown, the TWS earphone control device includes a first acquisition module 101, a second acquisition module 102, a third acquisition module 103, a selection module 104, a first control module 105, and a second control module 106. Figure 6 The TWS earphone control device is applied to a terminal device, the terminal device is connected to a TWS earphone, and the TWS earphone includes a left earphone and a right earphone. The functional modules of the TWS earphone control device are described in detail as follows:
[0252] The first acquisition module 101 is used to obtain the signal strength of the TWS headset during a call;
[0253] A second acquisition module 102 is configured to acquire power information of the TWS headset when the signal strength is greater than a preset strength;
[0254] A third acquisition module 103 is configured to acquire the power level of the left earphone and the power level of the right earphone from the power level information;
[0255] The selection module 104 is configured to select the left earphone as the master earphone when the power of the left earphone is greater than the power of the right earphone, and select the right earphone as the master earphone when the power of the left earphone is less than the power of the right earphone.
[0256] The first control module 105 is configured to acquire a current state of a microphone of the master earphone, and control the microphone to switch from a closed state to an open state when the current state of the microphone is the closed state.
[0257] The second control module 106 is configured to acquire a sound signal collected by the microphone in the open state, acquire a noise signal in the sound signal, and control a noise reduction module to switch from a standby state to a working state when the noise signal meets a noise reduction condition.
[0258] The TWS earphone control method, device, terminal device and storage medium provided by the present application have two beneficial effects. On the one hand, the left earphone is selected as the master earphone when the power of the left earphone is greater than the power of the right earphone, and the right earphone is selected as the master earphone when the power of the left earphone is less than the power of the right earphone, thereby solving the problem of how to select the master earphone from the right earphone and the left earphone of the TWS earphone and improving the endurance time of the selected master earphone. On the other hand, the current state of the microphone of the master earphone is acquired, and the microphone is controlled to switch from the closed state to the open state when the current state of the microphone is the closed state. The sound signal collected by the microphone in the open state is acquired, the noise signal in the sound signal is acquired, and the noise reduction module is controlled to switch from the standby state to the working state when the noise signal meets the noise reduction condition, thereby solving the problem of how to control the microphone and the noise reduction module of the master earphone. Since the microphone and the noise reduction module do not need to be manually controlled, the control time of the microphone and the noise reduction module is reduced, and the control efficiency of the microphone and the noise reduction module is improved.
[0259] The specific limitations of the TWS earphone control device can be referred to the limitations of the TWS earphone control method described above, which will not be described here.
[0260] The modules in the TWS earphone control device described above can be realized by software, hardware or a combination thereof.
[0261] In one embodiment, a terminal device is provided, which includes a memory, a processor and a computer program stored in the memory and executable on the processor.
[0262] It should be noted that the functions or steps that the computer readable storage medium or the terminal device can achieve described above can be referred to the related description in the foregoing method embodiments, which will not be described here to avoid repetition.
[0263] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
Claims
1. A TWS headset control method, applied to a terminal device, the terminal device is connected to a TWS headset, the TWS headset includes a left headset and a right headset, characterized in that: include: During a call, obtain the signal strength of the TWS headset connected to the device; When the signal strength is greater than a preset strength, obtaining the battery information of the TWS headset; From the power information, obtain the power of the left earphone and the power of the right earphone; When the power level of the left earphone is greater than that of the right earphone, the left earphone is selected as the master earphone; when the power level of the left earphone is less than that of the right earphone, the right earphone is selected as the master earphone; Obtaining a current state of the microphone of the primary headset, and when the current state of the microphone is off, controlling the microphone to switch from the off state to the on state; obtaining a sound signal collected by the microphone in the turned-on state, obtaining a noise signal in the sound signal, and when the noise signal meets a noise reduction condition, sending a second control instruction to the master earphone, so that the master earphone controls the noise reduction module to switch from a standby state to an active state according to the second control instruction; Obtain scores corresponding to the multiple noise suppression algorithms, add the scores corresponding to the multiple noise suppression algorithms, and generate a total score; Divide the scores corresponding to the multiple noise suppression algorithms by the total score to generate the confidence levels corresponding to the multiple noise suppression algorithms; Obtaining noise suppression amounts corresponding to multiple noise suppression algorithms; Multiplying the noise suppression amount corresponding to each of the multiple noise suppression algorithms by the confidence level corresponding to each of the multiple noise suppression algorithms to generate evaluation values corresponding to each of the multiple noise suppression algorithms; Select the noise suppression algorithm with the largest evaluation value to reduce the noise of the sound signal; When the noise signal meets the noise reduction condition, a second control instruction is sent to the main earphone, including: Obtaining the start time and end time of the noise signal, determining the duration of the noise signal based on the start time and the end time, and comparing the duration with a preset duration to generate a first ratio; Performing a Fourier transform on the noise signal to obtain a linear amplitude spectrum of the noise signal, obtaining multiple amplitude values of the linear amplitude spectrum of the noise signal, selecting a maximum value among the multiple amplitude values as a maximum amplitude value, and comparing the maximum amplitude value with a preset amplitude value to generate a second ratio; obtaining multiple frequencies of a linear amplitude spectrum of the noise signal, selecting a maximum value among the multiple frequencies as a maximum frequency, and comparing the maximum frequency with a preset frequency to generate a third ratio; According to a preset generation model, the first ratio, the second ratio, and the third ratio are added to generate a comprehensive evaluation coefficient of the noise signal; When the comprehensive evaluation coefficient is greater than a preset coefficient, determining that the noise signal meets the noise reduction condition, and sending a second control instruction to the master earphone; Among them, the generation model is: E=E1×M1+E2×M2+E3×M3; Wherein, E is the comprehensive evaluation coefficient, E1 is the first ratio, M1 is the first weight coefficient; E2 is the second ratio, M2 is the second weight coefficient; E3 is the third ratio, M3 is the third weight coefficient, and the sum of M1, M2, and M3 is 1; The preset duration is 5 seconds, the preset amplitude value is 0.8, and the preset frequency is 1000Hz; The first weight coefficient is 0.4, the second weight coefficient is 0.3, and the third weight coefficient is 0.
3.
2. The TWS headset control method according to claim 1, characterized in that: When the signal strength is greater than a preset strength, obtaining the battery information of the TWS headset includes: When the signal strength is greater than a preset strength, a read request is sent to the TWS headset, where the read request carries a power level indicator; Receive the power information returned by the TWS headset according to the power identifier.
3. The TWS headset control method according to claim 1, characterized in that: The acquiring, from the power information, the power of the left earphone and the power of the right earphone, includes: Get read instruction; The read instruction is executed to read the power level of the left earphone and the power level of the right earphone from the power level information.
4. The TWS headset control method according to claim 1, wherein: The method further comprises: selecting the left earphone as the master earphone when the power level of the left earphone is greater than the power level of the right earphone, and selecting the right earphone as the master earphone when the power level of the left earphone is less than the power level of the right earphone, including: When the power level of the left earphone is greater than the power level of the right earphone, a first selection instruction is sent to the TWS earphone, so that the TWS earphone selects the left earphone as the master earphone according to the first selection instruction, where the first selection instruction is an instruction to select the left earphone as the master earphone; When the power of the left earphone is less than the power of the right earphone, a second selection instruction is sent to the TWS earphone, so that the TWS earphone selects the right earphone as the main earphone according to the second selection instruction, and the second selection instruction is an instruction to select the right earphone as the main earphone.
5. The TWS headset control method according to claim 1, characterized in that: The acquiring the current state of the microphone of the master headset, and when the current state of the microphone is off, controlling the microphone to switch from the off state to the on state, includes: Sending a first acquisition instruction to the master earphone, where the first acquisition instruction is an instruction for acquiring a current state of the microphone; Receive the current state of the microphone returned by the main earphone according to the first acquisition instruction, and when the current state of the microphone is off, send a first control instruction to the main earphone, so that the main earphone controls the microphone to switch from the off state to the on state according to the first control instruction, wherein the first control instruction is an instruction to control the microphone to switch from the off state to the on state.
6. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the TWS headset control method according to any one of claims 1 to 5 are implemented.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, the steps of the TWS headset control method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Binaural consistency control method, graphical interface, system and related device
CN114827973A
Method, system and chip for adaptively adjusting noise reduction mode
CN118865936A