A control method, circuit and device of an audio stream control circuit
By using an electronic switch array and hardware sound detection module in AI calls, the microphone path is physically cut off and the user interrupts quickly, solving the problems of incomplete microphone muting and delayed interruption response, and achieving hardware-level privacy protection and smooth interaction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN WORKEC TECH
- Filing Date
- 2026-02-04
- Publication Date
- 2026-06-05
AI Technical Summary
In existing AI call solutions, incomplete microphone muting poses a risk of privacy leaks, delayed response to user interruptions severely impacts real-time interaction, and software echo cancellation algorithms are resource-intensive and have limited effectiveness.
The audio path between the microphone, Bluetooth module, and sound card module is physically cut off by an electronic switch array. Combined with the hardware sound detection module, user interruptions are detected in real time, generating a hardware interrupt signal to quickly control the switching of audio paths.
It achieves hardware-level privacy and security protection, significantly improves the response speed when users interrupt, enhances the fluency and real-time performance of voice interaction, and eliminates audio echo interference.
Smart Images

Figure CN122160673A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of audio control technology, and particularly relates to a control method, circuit and device for an audio flow control circuit. Background Technology
[0002] With the rapid popularization of large language models and AI voice assistants, AI telephone robots have been widely used in various fields such as customer service, intelligent outbound calling, and voice question answering. However, most current AI call solutions based on terminal devices such as personal computers or communication devices such as smartphones still rely on pure software implementation, which has the following technical shortcomings: First, muting the microphone at the software level is not a physical disconnection; the microphone remains powered on and picking up sound, which poses a risk of being eavesdropped on by malware or backdoor programs.
[0003] Second, when a user attempts to interrupt the AI during its speech, the entire process involves audio acquisition, operating system scheduling, software-level voice activity detection, command issuance, and stopping the synthesized speech playback. This software process involves multiple layers of data transmission, system scheduling, and algorithm calculations, making the overall process lengthy. This can result in a response delay of hundreds of milliseconds when a user tries to interrupt, making it impossible to interrupt instantly and severely impacting the real-time performance and natural fluency of human-computer voice interaction.
[0004] Third, software echo cancellation algorithms consume CPU resources and are limited in effectiveness under high volume or complex acoustic environments, which can easily lead to echo interference. Summary of the Invention
[0005] This invention provides a control method for an audio stream control circuit, which aims to improve the response speed to user interruptions during AI calls and strengthen the protection of call privacy and security.
[0006] The present invention is implemented as follows: a control method for an audio stream control circuit, the control method for the audio stream control circuit comprising the following steps: When the terminal device outputs the response audio stream generated by the AI large model, the main control module controls the electronic switch array to disconnect the first audio path between the microphone and the Bluetooth module and the second audio path between the microphone and the sound card module. The hardware sound detection module detects the sound signal picked up by the microphone and generates a hardware interrupt signal when the amplitude of the sound signal is greater than a preset threshold. In response to the hardware interrupt signal, the main control module controls the electronic switch array to connect the first audio path and / or the second audio path, and instructs the terminal device to stop outputting the response audio stream.
[0007] Furthermore, after the step of the main control module controlling the electronic switch array to connect the first audio path and / or the second audio path in response to the hardware interrupt signal, and instructing the terminal device to stop outputting the response audio stream, the method further includes: The main control module monitors the level status of the output terminal of the hardware sound detection module; The timing starts when the level state changes from an active level state to an inactive level state. If the duration of the invalid level state reaches a preset duration, the main control module controls the electronic switch array to disconnect the first audio path and the second audio path, and instructs the terminal device to resume outputting the response audio stream.
[0008] Furthermore, the step of the main control module controlling the electronic switch array to disconnect the first audio path and the second audio path, and instructing the terminal device to resume outputting the response audio stream if the duration of the invalid level state reaches a preset duration, further includes: The main control module controls the electronic switch array to disconnect the third audio path between the Bluetooth module and the audio playback interface, and connects the fourth audio path between the sound card module and the audio playback interface.
[0009] Furthermore, the step of the main control module controlling the electronic switch array to connect the first audio path and / or the second audio path in response to the hardware interrupt signal, and instructing the terminal device to stop outputting the response audio stream, further includes: The main control module controls the electronic switch array to connect the third audio path between the Bluetooth module and the audio playback interface, and disconnects the fourth audio path between the sound card module and the audio playback interface.
[0010] This invention also provides an audio stream control circuit, which includes a main control module, a Bluetooth module, a sound card module, a hardware sound detection module, an electronic switch array, a microphone, and an audio playback interface. The main control module is bidirectionally connected to the Bluetooth module and the sound card module, and the control terminal of the main control module is connected to the controlled terminal of the electronic switch array. The microphone's output is connected to the input of the hardware sound detection module, and the hardware sound detection module's output is connected to the external interrupt pin of the main control module. The first and second input terminals of the electronic switch array are both connected to the output terminal of the microphone, and the first and second output terminals of the electronic switch array are respectively connected to the audio input terminal of the Bluetooth module and the audio input terminal of the sound card module. The third and fourth input terminals of the electronic switch array are respectively connected to the audio output terminal of the Bluetooth module and the audio output terminal of the sound card module, and the third and fourth output terminals of the electronic switch array are both connected to the audio playback interface.
[0011] Furthermore, the electronic switch array includes a first electronic switch, a second electronic switch, a third electronic switch, and a fourth electronic switch; The input terminal of the first electronic switch serves as the first input terminal of the electronic switch array, and the output terminal of the first electronic switch serves as the first output terminal of the electronic switch array. The input terminal of the second electronic switch serves as the second input terminal of the electronic switch array, and the output terminal of the second electronic switch serves as the second output terminal of the electronic switch array; The input terminal of the third electronic switch serves as the third input terminal of the electronic switch array, and the output terminal of the third electronic switch serves as the third output terminal of the electronic switch array. The input terminal of the fourth electronic switch serves as the fourth input terminal of the electronic switch array, and the output terminal of the fourth electronic switch serves as the fourth output terminal of the electronic switch array. The controlled terminals of the first electronic switch, the second electronic switch, the third electronic switch, and the fourth electronic switch are connected one-to-one to multiple control terminals of the main control module.
[0012] Furthermore, the hardware sound detection module includes a preamplifier, an envelope detector, and a comparator; The input terminal of the preamplifier is connected to the output terminal of the microphone, the output terminal of the preamplifier is connected to the input terminal of the envelope detector, the output terminal of the envelope detector is connected to the first input terminal of the comparator, the second input terminal of the comparator receives a preset threshold, and the output terminal of the comparator is connected to the external interrupt pin of the main control module.
[0013] Furthermore, the audio stream control circuit also includes a USB interface, through which the sound card module communicates with the terminal device.
[0014] This invention also provides an audio stream control device, which includes the audio stream control circuit described in any of the preceding embodiments.
[0015] This invention effectively eliminates audio echo interference and blocks privacy leaks at the hardware level by physically severing the main audio path between the microphone, Bluetooth module, and sound card module through an electronic switch array during the AI response phase, thus putting the microphone in a hardware-mute state. This provides reliable hardware-level security. Furthermore, the invention utilizes a hardware sound detection module connected to the microphone in a bypass path to detect and identify user interruptions, quickly connecting the corresponding audio path upon detection. This seamless switching between AI voice output and user interruption significantly improves the response speed to user interruptions, enhancing the fluency and real-time performance of voice interaction. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating an embodiment of the control method for the audio stream control circuit of the present invention; Figure 2 This is a schematic diagram of the circuit structure of an embodiment of the audio flow control circuit of the present invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0018] This invention physically cuts off the main audio path between the microphone, Bluetooth module, and sound card module via an electronic switch array during the AI response phase, putting the microphone in a hardware-mute state. This effectively eliminates audio echo interference and blocks privacy leakage pathways at the hardware level, achieving reliable hardware-level security protection. A hardware sound detection module, bypassed and connected to the microphone, detects and identifies user interruptions. Upon detection, it quickly connects the corresponding audio path, achieving seamless switching between AI voice output and user interruption. This significantly improves the response speed for user interruptions, enhancing the fluency and real-time performance of voice interaction. Compared to traditional solutions that rely on long-latency response paths due to software perception and operating system scheduling, this invention, through a physical link built with hardware detection, hardware interruption, and hardware switching, not only significantly improves the response speed for user interruptions but also achieves hardware-level privacy and security protection, balancing interactive fluency and usage security.
[0019] Example 1 Reference Figure 1 This invention provides a control method for an audio stream control circuit, applied to... Figure 2 The audio stream control circuit shown includes the following core modules: Main control module: Employs a low-power microcontroller such as the ARM Cortex-M series as the control center of the entire circuit. It establishes bidirectional communication links with the Bluetooth module and sound card module, such as UART, I2C, and USB. The general-purpose input / output pins of the main control module are connected to the controlled terminals of the electronic switch array to output high / low level signals, directly controlling the physical on / off state of each analog electronic switch in the array.
[0020] Bluetooth module: Supports Bluetooth HFP (Hands-Free Profile), which is used to establish and maintain voice call links with communication devices such as smartphones.
[0021] Sound card module: It acts as a hardware bridge for interaction with terminal devices to transmit upstream and downstream audio streams.
[0022] Hardware sound detection module: This is a hardware voice activity detection module. Its input is directly connected to the microphone output without going through an electronic switch array. It is used to detect the voltage amplitude of the sound signal picked up by the microphone in real time. When the voltage amplitude of the sound signal exceeds a preset threshold, it immediately generates a digital level transition signal, i.e., a hardware interrupt signal, from its output.
[0023] The electronic switch array consists of multiple analog electronic switches, such as MOSFETs or relays, forming a controlled cross-connection network. The first and second inputs of the electronic switch array are connected to a single output of the microphone. The first output of the electronic switch array is connected to the audio input of the Bluetooth module, and the second output is connected to the audio input of the sound card module. Controlled by the main control module, the electronic switch array can physically disconnect the first audio path between the microphone and the Bluetooth module, as well as the second audio path between the microphone and the sound card module. The third input of the electronic switch array is connected to the audio output of the Bluetooth module, and the fourth input is connected to the audio output of the sound card module. The third and fourth outputs of the electronic switch array are connected to a single audio playback interface, which is used to connect audio playback devices such as headphones or speakers. The electronic switch array, controlled by the main control module, can physically disconnect the third audio path between the Bluetooth module and the audio playback interface, as well as the fourth audio path between the sound card module and the audio playback interface.
[0024] In practical applications, the audio stream control circuit of this invention establishes a wireless connection with a communication device, such as a smartphone, via a Bluetooth module. The smartphone is responsible for accessing a cellular network, such as GSM or VoLTE, demodulating the voice signal of the other party in the call, converting it into an audio stream in pulse code modulation format, and then transmitting it to the circuit in real time via the Bluetooth module.
[0025] The audio stream control circuit also features a communication interface such as a USB port. The sound card module connects to a terminal device, such as a personal computer, via this interface. The terminal device then connects to a cloud-based AI model via a network. During a call, the main control module receives the other party's voice signal via Bluetooth and transmits it to the sound card module. The sound card module then sends the received voice signal to the terminal device via the USB port. The terminal device uploads the received voice signal to the cloud-based AI model via the network. This AI model performs speech recognition (STT) and large language model (LLM) inference, generates an intelligent response text, and returns it to the terminal device.
[0026] Based on the received intelligent reply text, the terminal device generates a corresponding reply audio stream using a local or network-connected text-to-speech (TTS) engine and sends it back to the sound card module via a USB interface. The sound card module can then route the reply audio stream to an audio playback interface for playback through locally connected speakers or headphones for the local user to hear. Alternatively, the reply audio stream can be sent to a communication device via the main control module or Bluetooth module, and then to the other party in the call.
[0027] The control method of this audio stream control circuit includes the following steps: Step S1: When the terminal device outputs the response audio stream generated by the AI large model, the main control module controls the electronic switch array to disconnect the first audio path between the microphone and the Bluetooth module and disconnect the second audio path between the microphone and the sound card module. In this embodiment, when the terminal device outputs a response audio stream generated based on an AI large model, the main control module sends a control signal to the electronic switch array according to program settings or instructions from the terminal device. This control signal causes the corresponding electronic switches within the electronic switch array to activate, physically disconnecting the first audio path between the microphone and the Bluetooth module, and also physically disconnecting the second audio path between the microphone and the sound card module. At this time, the microphone is disconnected from the Bluetooth module and the sound card module at the hardware circuit level. In this situation, even if the terminal device's operating system is controlled by malware, it cannot obtain any actual audio signal from the microphone, thus achieving absolutely reliable hardware-level privacy protection. Furthermore, it fundamentally eliminates the acoustic echo that may be generated during AI voice playback.
[0028] Step S2: The sound signal picked up by the microphone is detected by the hardware sound detection module, and a hardware interrupt signal is generated when the amplitude of the sound signal is greater than a preset threshold. Although the audio path between the microphone and the Bluetooth and sound card modules is cut off, the input of the hardware sound detection module is directly bypassed to the microphone's output, operating independently and continuously monitoring the analog voltage signal generated by the microphone. When a user intends to interrupt the AI's speech and begins to speak, their sound waves are picked up by the microphone and converted into an electrical signal. Once the instantaneous voltage amplitude of this electrical signal exceeds a preset voltage threshold within the hardware sound detection module, the module generates a low-to-high or high-to-low level transition within microseconds. This level transition serves as a hardware interrupt signal, directly sent to the external interrupt pin of the main control module.
[0029] Step S3: In response to the hardware interrupt signal, the main control module controls the electronic switch array to connect the first audio path and / or the second audio path, and instructs the terminal device to stop outputting the response audio stream.
[0030] Upon receiving a hardware interrupt signal from the hardware sound detection module, the main control module's hardware interrupt system immediately suspends the current task and performs the following operations with the highest priority: First, a control signal is sent to the electronic switch array, driving it to quickly reclose the first audio path and / or the second audio path. This allows the user's voice to be instantly transmitted to the other party via Bluetooth, and / or uploaded to the terminal device's AI model for recognition and processing via the sound card module, thereby achieving real-time transparent transmission and uplink interaction of the user's voice and ensuring call continuity.
[0031] Second, simultaneously, the main control module sends instructions to the terminal device via a communication interface such as a USB interface, instructing it to stop outputting the current response audio stream. This enables real-time interruption of AI voice, eliminating voice overlap and interaction conflicts caused by continuous AI speaking, and significantly improving the naturalness and fluency of human-computer dialogue.
[0032] The technical solution of this invention, during the process of the terminal device outputting the AI response audio stream, involves the main control module controlling an electronic switch array to cut off the first audio path between the microphone and the Bluetooth module, as well as the second audio path between the microphone and the sound card module, thus putting the microphone in a hardware mute state. Simultaneously, a hardware sound detection module collects and detects the sound signal picked up by the microphone in real time. When a user interruption is detected, a hardware interrupt signal is directly generated and sent to the main control module. The main control module quickly controls the electronic switch array to connect the corresponding audio path and simultaneously instructs the terminal device to stop outputting the AI response audio stream, thereby achieving a seamless and high-speed switch between the AI speaking phase and the user interruption phase. This invention relies on hardware interrupts to achieve millisecond-level response, significantly improving the real-time performance and smoothness of user interruption. Furthermore, by physically isolating the microphone path through hardware switching, it fundamentally avoids audio echo interference and privacy leakage risks, constructing a hardware-level security and privacy protection mechanism.
[0033] Example 2 Based on the above embodiments, step S3 further includes: Step S4: The main control module controls the electronic switch array to connect the third audio path between the Bluetooth module and the audio playback interface, and disconnects the fourth audio path between the sound card module and the audio playback interface.
[0034] In this embodiment, the main control module can simultaneously perform the following operations the instant the user interrupts: control the electronic switch array to connect the third audio path between the Bluetooth module and the audio playback interface, and disconnect the fourth audio path between the sound card module and the audio playback interface. The purpose of this operation is to immediately switch the audio source from the AI voice to the voice of the other party in the call when the user interrupts the AI voice and begins speaking, allowing the user to hear real-time voice feedback immediately after interrupting, further improving the real-time nature and naturalness of the call interaction.
[0035] Example 3 Based on the above embodiments, after step S3, the method further includes: Step S5: Monitor the level status of the output terminal of the hardware sound detection module through the main control module; Step S6: Start timing when the level state switches from an active level state to an inactive level state; Step S7: If the duration of the invalid level state reaches a preset duration, the main control module controls the electronic switch array to disconnect the first audio path and the second audio path, and instructs the terminal device to resume outputting the response audio stream.
[0036] In this embodiment, after responding to a hardware interrupt signal and restoring the first audio path between the microphone and the Bluetooth module, and the second audio path between the microphone and / or the sound card module, the main control module continuously monitors the level state of the output terminal of the hardware sound detection module. The level state of the output terminal of the hardware sound detection module reflects whether the user is still speaking in front of the microphone; that is, a valid level state represents the presence of user voice, and an invalid level state represents the absence of user voice. The valid level state is the steady-state level maintained by the hardware sound detection module after detecting voice activity, while the hardware interrupt signal is the transient edge signal generated when the level transitions from an invalid state to a valid state; this transition edge from invalid to valid constitutes the hardware interrupt signal.
[0037] When the output level of the hardware sound detection module switches from an active level to an inactive level, it indicates that the user has stopped speaking. The main control module then starts an internal timer to time the duration of the inactive level state at the output of the hardware sound detection module. If the duration of the inactive level state at the output of the hardware sound detection module reaches a preset duration, such as 2 seconds or 3 seconds, the main control module determines that the user's interruption interaction has ended. At this time, the main control module performs the following operations: 1. Send a command to the electronic switch array to control it to disconnect the first audio path and the second audio path, thereby achieving hardware-level physical mute of the microphone again.
[0038] Second, send a command to the terminal device, instructing it to resume outputting the response audio stream generated by the AI large model, thus resuming the AI dialogue.
[0039] Based on the above embodiments, step S7 further includes: Step S8: The main control module controls the electronic switch array to disconnect the third audio path between the Bluetooth module and the audio playback interface, and connect the fourth audio path between the sound card module and the audio playback interface.
[0040] In this embodiment, after responding to the AI dialogue, the main control module also controls the electronic switch array to disconnect the third audio path between the Bluetooth module and the audio playback interface, and connect the fourth audio path between the sound card module and the audio playback interface. The purpose of this operation is to ensure that when the system switches back to AI dialogue, the AI response audio stream output by the terminal device can be routed to the speaker or headphones connected to the audio playback interface for playback, while simultaneously cutting off the other party's voice from the Bluetooth module to avoid auditory confusion caused by the mixing of the two audio signals, ensuring that the user can clearly hear the AI's response.
[0041] Reference Figure 2The present invention also provides an audio stream control circuit, which includes a main control module, a Bluetooth module, a sound card module, a hardware sound detection module, an electronic switch array, a microphone, and an audio playback interface, with the following connection relationships: The main control module has a bidirectional communication connection with the Bluetooth module and a bidirectional communication connection with the sound card module. The control terminal of the main control module is connected to the controlled terminal of the electronic switch array. The microphone's output is connected to the input of the hardware sound detection module, and the output of the hardware sound detection module is connected to the external interrupt pin of the main control module. The first and second input terminals of the electronic switch array are both connected to a single output terminal of the microphone, and the first and second output terminals of the electronic switch array are respectively connected to the audio input terminal of the Bluetooth module and the audio input terminal of the sound card module. The third and fourth input terminals of the electronic switch array are connected to the audio output terminals of the Bluetooth module and the sound card module, respectively, while the third and fourth output terminals of the electronic switch array are both connected to the audio playback interface.
[0042] In one specific embodiment, the electronic switch array includes a first electronic switch S1, a second electronic switch S2, a third electronic switch S3, and a fourth electronic switch S4, with each electronic switch's controlled terminal connected to multiple control terminals of the main control module. The input terminal of the first electronic switch S1 serves as the first input terminal of the electronic switch array, and the output terminal of the first electronic switch S1 serves as the first output terminal of the electronic switch array. The first electronic switch S1 is controlled by the main control module and is used to physically connect or disconnect the first audio path between the microphone and the Bluetooth module.
[0043] The input terminal of the second electronic switch S2 serves as the second input terminal of the electronic switch array, and the output terminal of the second electronic switch S2 serves as the second output terminal of the electronic switch array. The second electronic switch S2 is controlled by the main control module and is used to physically connect or disconnect the second audio path between the microphone and the sound card module.
[0044] The input terminal of the third electronic switch S3 serves as the third input terminal of the electronic switch array, and the output terminal of the third electronic switch S3 serves as the third output terminal of the electronic switch array. The third electronic switch S3 is controlled by the main control module and is used to physically connect or disconnect the third audio path between the Bluetooth module and the audio playback interface.
[0045] The input terminal of the fourth electronic switch S4 serves as the fourth input terminal of the electronic switch array, and the output terminal of the fourth electronic switch S4 serves as the fourth output terminal of the electronic switch array. The fourth electronic switch S4 is controlled by the main control module and is used to physically connect or disconnect the fourth audio path between the Bluetooth module and the audio playback interface.
[0046] In one specific embodiment, the hardware sound detection module includes a preamplifier, an envelope detector, and a comparator; wherein, the input terminal of the preamplifier is connected to the output terminal of the microphone, the output terminal of the preamplifier is connected to the input terminal of the envelope detector, the output terminal of the envelope detector is connected to the first input terminal of the comparator, the second input terminal of the comparator receives a preset threshold, and the output terminal of the comparator is connected to the external interrupt pin of the main control module.
[0047] This preamplifier is used to receive the weak voltage signal generated by the microphone picking up sound. It amplifies the signal initially, improving the signal-to-noise ratio and ensuring reliable detection by subsequent circuitry.
[0048] This envelope detector is used to extract the envelope of the amplified audio signal, filter out high-frequency details and rapid fluctuations in the speech signal, and output a slowly varying DC or low-frequency signal that reflects the energy changes of speech activity.
[0049] The comparator's first input, the inverting input, is connected to the output of the envelope detector to receive the envelope voltage signal reflecting the current sound intensity. Its second input, the inverting input, receives a preset threshold. This preset threshold is precisely set to correspond to the sound pressure level that distinguishes between ambient noise and effective human voice. When the amplitude of the envelope voltage signal exceeds the preset threshold, the comparator output immediately flips to an active level, i.e., outputs a hardware interrupt signal; when the amplitude of the envelope voltage signal falls below the threshold, the output returns to an inactive level. The comparator's output is directly connected to the external interrupt pin of the main control module.
[0050] Specifically, when a user speaks, the microphone picks up the corresponding analog sound signal in real time. This analog sound signal is then amplified by a preamplifier, and the envelope is extracted by an envelope detector to obtain an envelope voltage signal corresponding to the speech intensity. When the amplitude of this envelope voltage signal exceeds a preset threshold, the comparator's output level changes from invalid to valid, thus outputting a hardware interrupt signal to the external interrupt pin of the main control module. The main control module then performs the corresponding operation.
[0051] This hardware sound detection module is a purely analog hardware link, requiring no analog-to-digital conversion or software algorithms. It can complete the entire response process from sound signal pickup and amplitude determination to interrupt signal triggering within microseconds, providing core circuit support for low-latency user interruption functionality. Furthermore, this hardware sound detection module determines the presence of user voice solely based on the amplitude of the sound signal, without performing voice content parsing, recognition, or uploading. It does not involve data analysis at the semantic level of user voice, fundamentally ensuring user voice privacy and security from the hardware architecture perspective.
[0052] Working process: When a user speaks, the microphone picks up the user's voice signal. After pre-amplification and envelope extraction, the amplitude of the envelope voltage signal exceeds a preset threshold, causing the comparator output level to change, thereby generating the hardware interrupt signal. This purely analog detection link requires no analog-to-digital conversion, no software intervention, and no buffer. It can complete the entire process from sound detection to interruption triggering in microseconds, significantly improving the response speed when the AI interrupts the user's speech. Furthermore, this circuit only judges the signal amplitude and does not involve voice content analysis, fundamentally protecting user privacy and security.
[0053] The control method of this audio stream control circuit includes the following steps: Step S1: When the terminal device outputs the response audio stream generated by the AI large model, the main control module controls the electronic switch array to disconnect the first audio path between the microphone and the Bluetooth module and disconnect the second audio path between the microphone and the sound card module. In this embodiment, when the terminal device outputs a response audio stream generated based on an AI large model, the main control module sends a control signal to the electronic switch array according to program settings or instructions from the terminal device. This control signal causes the corresponding electronic switches within the electronic switch array to activate, physically disconnecting the first audio path between the microphone and the Bluetooth module, and also physically disconnecting the second audio path between the microphone and the sound card module. At this time, the microphone is disconnected from the Bluetooth module and the sound card module at the hardware circuit level. In this situation, even if the terminal device's operating system is controlled by malware, it cannot obtain any actual audio signal from the microphone, thus achieving absolutely reliable hardware-level privacy protection. Furthermore, it fundamentally eliminates the acoustic echo that may be generated during AI voice playback.
[0054] Step S2: The sound signal picked up by the microphone is detected by the hardware sound detection module, and a hardware interrupt signal is generated when the amplitude of the sound signal is greater than a preset threshold. Although the audio path between the microphone and the Bluetooth and sound card modules is cut off, the input of the hardware sound detection module is directly bypassed to the microphone's output, operating independently and continuously monitoring the analog voltage signal generated by the microphone. When a user intends to interrupt the AI's speech and begins to speak, their sound waves are picked up by the microphone and converted into an electrical signal. Once the instantaneous voltage amplitude of this electrical signal exceeds a preset voltage threshold within the hardware sound detection module, the module generates a low-to-high or high-to-low level transition within microseconds. This level transition serves as a hardware interrupt signal, directly sent to the external interrupt pin of the main control module.
[0055] Step S3: In response to the hardware interrupt signal, the main control module controls the electronic switch array to connect the first audio path and / or the second audio path, and instructs the terminal device to stop outputting the response audio stream.
[0056] Upon receiving a hardware interrupt signal from the hardware sound detection module, the main control module's hardware interrupt system immediately suspends the current task and performs the following operations with the highest priority: First, a control signal is sent to the electronic switch array, driving it to quickly reclose the first audio path and / or the second audio path. This allows the user's voice to be instantly transmitted to the other party via Bluetooth, and / or uploaded to the terminal device's AI model for recognition and processing via the sound card module, thereby achieving real-time transparent transmission and uplink interaction of the user's voice and ensuring call continuity.
[0057] Second, simultaneously, the main control module sends instructions to the terminal device via a communication interface such as a USB interface, instructing it to stop outputting the current response audio stream. This enables real-time interruption of AI voice, eliminating voice overlap and interaction conflicts caused by continuous AI speaking, and significantly improving the naturalness and fluency of human-computer dialogue.
[0058] The technical solution of this invention, during the process of the terminal device outputting the AI response audio stream, involves the main control module controlling an electronic switch array to cut off the first audio path between the microphone and the Bluetooth module, as well as the second audio path between the microphone and the sound card module, thus putting the microphone in a hardware mute state. Simultaneously, a hardware sound detection module collects and detects the sound signal picked up by the microphone in real time. When a user interruption is detected, a hardware interrupt signal is directly generated and sent to the main control module. The main control module quickly controls the electronic switch array to connect the corresponding audio path and simultaneously instructs the terminal device to stop outputting the AI response audio stream, thereby achieving a seamless and high-speed switch between the AI speaking phase and the user interruption phase. This invention relies on hardware interrupts to achieve millisecond-level response, significantly improving the real-time performance and smoothness of user interruption. Furthermore, by physically isolating the microphone path through hardware switching, it fundamentally avoids audio echo interference and privacy leakage risks, constructing a hardware-level security and privacy protection mechanism.
[0059] In one embodiment, step S3 further includes: Step S4: The main control module controls the electronic switch array to connect the third audio path between the Bluetooth module and the audio playback interface, and disconnects the fourth audio path between the sound card module and the audio playback interface.
[0060] In this embodiment, the main control module can simultaneously perform the following operations the instant the user interrupts: control the electronic switch array to connect the third audio path between the Bluetooth module and the audio playback interface, and disconnect the fourth audio path between the sound card module and the audio playback interface. The purpose of this operation is to immediately switch the audio source from the AI voice to the voice of the other party in the call when the user interrupts the AI voice and begins speaking, allowing the user to hear real-time voice feedback immediately after interrupting, further improving the real-time nature and naturalness of the call interaction.
[0061] In one embodiment, after step S3, the method further includes: Step S5: Monitor the level status of the output terminal of the hardware sound detection module through the main control module; Step S6: Start timing when the level state switches from an active level state to an inactive level state; Step S7: If the duration of the invalid level state reaches a preset duration, the main control module controls the electronic switch array to disconnect the first audio path and the second audio path, and instructs the terminal device to resume outputting the response audio stream.
[0062] In this embodiment, after responding to a hardware interrupt signal and restoring the first audio path between the microphone and the Bluetooth module, and the second audio path between the microphone and / or the sound card module, the main control module continuously monitors the level state of the output terminal of the hardware sound detection module. The level state of the output terminal of the hardware sound detection module reflects whether the user is still speaking in front of the microphone; that is, a valid level state represents the presence of user voice, and an invalid level state represents the absence of user voice. The valid level state is the steady-state level maintained by the hardware sound detection module after detecting voice activity, while the hardware interrupt signal is the transient edge signal generated when the level transitions from an invalid state to a valid state; this transition edge from invalid to valid constitutes the hardware interrupt signal.
[0063] When the output level of the hardware sound detection module switches from an active level to an inactive level, it indicates that the user has stopped speaking. The main control module then starts an internal timer to time the duration of the inactive level state at the output of the hardware sound detection module. If the duration of the inactive level state at the output of the hardware sound detection module reaches a preset duration, such as 2 seconds or 3 seconds, the main control module determines that the user's interruption interaction has ended. At this time, the main control module performs the following operations: 1. Send a command to the electronic switch array to control it to disconnect the first audio path and the second audio path, thereby achieving hardware-level physical mute of the microphone again.
[0064] Second, send a command to the terminal device, instructing it to resume outputting the response audio stream generated by the AI large model, thus resuming the AI dialogue.
[0065] Based on the above embodiments, step S7 further includes: Step S8: The main control module controls the electronic switch array to disconnect the third audio path between the Bluetooth module and the audio playback interface, and connect the fourth audio path between the sound card module and the audio playback interface.
[0066] In this embodiment, after responding to the AI dialogue, the main control module also controls the electronic switch array to disconnect the third audio path between the Bluetooth module and the audio playback interface, and connect the fourth audio path between the sound card module and the audio playback interface. The purpose of this operation is to ensure that when the system switches back to AI dialogue, the AI response audio stream output by the terminal device can be routed to the speaker or headphones connected to the audio playback interface for playback, while simultaneously cutting off the other party's voice from the Bluetooth module to avoid auditory confusion caused by the mixing of the two audio signals, ensuring that the user can clearly hear the AI's response.
[0067] The present invention also provides an audio stream control device, which includes the audio stream control circuit as described in any of the preceding claims. The detailed structure of this audio stream control circuit can be found in the above embodiments and will not be repeated here. It is understood that since the above-described audio stream control circuit is used in the audio stream control device of the present invention, the embodiments of the audio stream control device of the present invention include all the technical solutions of all the embodiments of the above-described audio stream control circuit, and the achieved technical effects are completely the same, and will not be repeated here.
[0068] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A control method for an audio flow control circuit, characterized in that, The control method of the audio stream control circuit includes the following steps: When the terminal device outputs the response audio stream generated by the AI large model, the main control module controls the electronic switch array to disconnect the first audio path between the microphone and the Bluetooth module and the second audio path between the microphone and the sound card module. The hardware sound detection module detects the sound signal picked up by the microphone and generates a hardware interrupt signal when the amplitude of the sound signal is greater than a preset threshold. In response to the hardware interrupt signal, the main control module controls the electronic switch array to connect the first audio path and / or the second audio path, and instructs the terminal device to stop outputting the response audio stream.
2. The control method for the audio stream control circuit as described in claim 1, characterized in that, After the step of the main control module controlling the electronic switch array to connect the first audio path and / or the second audio path in response to the hardware interrupt signal, and instructing the terminal device to stop outputting the reply audio stream, the method further includes: The main control module monitors the level status of the output terminal of the hardware sound detection module; The timing starts when the level state changes from an active level state to an inactive level state. If the duration of the invalid level state reaches a preset duration, the main control module controls the electronic switch array to disconnect the first audio path and the second audio path, and instructs the terminal device to resume outputting the response audio stream.
3. The control method for the audio stream control circuit as described in claim 2, characterized in that, The step of the main control module controlling the electronic switch array to disconnect the first audio path and the second audio path, and instructing the terminal device to resume outputting the response audio stream if the duration of the invalid level state reaches a preset duration, further includes: The main control module controls the electronic switch array to disconnect the third audio path between the Bluetooth module and the audio playback interface, and connects the fourth audio path between the sound card module and the audio playback interface.
4. The control method for the audio stream control circuit as described in claim 1, characterized in that, The step of the main control module controlling the electronic switch array to connect the first audio path and / or the second audio path in response to the hardware interrupt signal, and instructing the terminal device to stop outputting the reply audio stream, further includes: The main control module controls the electronic switch array to connect the third audio path between the Bluetooth module and the audio playback interface, and disconnects the fourth audio path between the sound card module and the audio playback interface.
5. An audio flow control circuit, characterized in that, The audio stream control circuit includes a main control module, a Bluetooth module, a sound card module, a hardware sound detection module, an electronic switch array, a microphone, and an audio playback interface. The main control module is bidirectionally connected to the Bluetooth module and the sound card module, and the control terminal of the main control module is connected to the controlled terminal of the electronic switch array. The microphone's output is connected to the input of the hardware sound detection module, and the hardware sound detection module's output is connected to the external interrupt pin of the main control module. The first and second input terminals of the electronic switch array are both connected to the output terminal of the microphone, and the first and second output terminals of the electronic switch array are respectively connected to the audio input terminal of the Bluetooth module and the audio input terminal of the sound card module. The third and fourth input terminals of the electronic switch array are respectively connected to the audio output terminal of the Bluetooth module and the audio output terminal of the sound card module, and the third and fourth output terminals of the electronic switch array are both connected to the audio playback interface.
6. The audio flow control circuit as described in claim 5, characterized in that, The electronic switch array includes a first electronic switch, a second electronic switch, a third electronic switch, and a fourth electronic switch; The input terminal of the first electronic switch serves as the first input terminal of the electronic switch array, and the output terminal of the first electronic switch serves as the first output terminal of the electronic switch array. The input terminal of the second electronic switch serves as the second input terminal of the electronic switch array, and the output terminal of the second electronic switch serves as the second output terminal of the electronic switch array; The input terminal of the third electronic switch serves as the third input terminal of the electronic switch array, and the output terminal of the third electronic switch serves as the third output terminal of the electronic switch array. The input terminal of the fourth electronic switch serves as the fourth input terminal of the electronic switch array, and the output terminal of the fourth electronic switch serves as the fourth output terminal of the electronic switch array. The controlled terminals of the first electronic switch, the second electronic switch, the third electronic switch, and the fourth electronic switch are connected one-to-one to multiple control terminals of the main control module.
7. The audio flow control circuit as described in claim 5, characterized in that, The hardware sound detection module includes a preamplifier, an envelope detector, and a comparator. The input terminal of the preamplifier is connected to the output terminal of the microphone, the output terminal of the preamplifier is connected to the input terminal of the envelope detector, the output terminal of the envelope detector is connected to the first input terminal of the comparator, the second input terminal of the comparator receives a preset threshold, and the output terminal of the comparator is connected to the external interrupt pin of the main control module.
8. The audio flow control circuit as described in any one of claims 5 to 7, characterized in that, The audio stream control circuit also includes a USB interface, through which the sound card module communicates with the terminal device.
9. An audio stream control device, characterized in that, The audio stream control device includes an audio stream control circuit as described in any one of claims 5 to 8.