A microphone audio processing method based on an external computing unit and related equipment
Patent Information
- Application Number
- CN202611103308.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]然而,这种方案依赖内置DSP芯片进行本地计算,导致接收端的硬件制造成本居高不下
[0025] 1. This application delivers the original audio frames to an external smart terminal application for processing, utilizing its general computing power and software flexibility to complete the sound effect rendering, enabling the device to provide diverse and iteratively upgradeable sound effect processing capabilities without increasing local hardware manufacturing costs.
Smart Images

Figure CN122934129A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of wireless audio processing technology, and in particular to a microphone audio processing method and related equipment based on an external computing unit. Background Technology
[0002] With the increasing popularity of multimedia interactive scenarios, wireless microphone systems are widely used in home karaoke, conferences, and live streaming. Typically, a wireless microphone system consists of a microphone transmitter and a receiver. The receiver usually takes the form of a USB dongle as a standard audio peripheral, which is directly plugged into playback devices such as TVs or stereos to provide plug-and-play audio input services.
[0003] To enhance the user's auditory experience, it's common practice to process the captured voice using audio effects such as noise reduction, feedback reduction, and reverb. In some related technologies, wireless microphone systems primarily integrate a digital signal processor (DSP) or a dedicated audio processing chip within the receiver. The raw audio captured by the microphone is wirelessly transmitted to the receiver, where the built-in DSP chip performs local sound effect rendering. The processed audio stream is then output to the playback device according to standard audio protocols.
[0004] However, this approach relies on a built-in DSP chip for local computation, resulting in high hardware manufacturing costs for the receiver. Furthermore, because the audio processing algorithm is directly embedded in the receiver's firmware, the limited computing power and storage space of a single hardware chip not only prevent it from providing diverse and personalized sound effects for different users, but also make it extremely difficult to iterate and upgrade the algorithm after the product leaves the factory. Summary of the Invention
[0005] This application provides a microphone audio processing method and related equipment based on an external computing unit, which can reduce the hardware cost of wireless microphone audio processing.
[0006] In a first aspect, this application provides a wireless microphone audio processing method based on an external computing unit. The method includes: enabling a playback device to recognize a wireless microphone receiving dongle as a standard audio input device via a first link interface; receiving a raw audio frame from the wireless microphone, writing the raw audio frame into an audio buffer for output from the first link interface, and simultaneously sending the raw audio frame to an external smart terminal via a second link interface; receiving a processed audio frame returned by the external smart terminal via the second link interface, wherein the processed audio frame is obtained by the external smart terminal calling an audio processing application to perform audio effect processing on the raw audio frame; replacing the corresponding raw audio frame in the audio buffer with the processed audio frame, or mixing the processed audio frame with the corresponding raw audio frame, and outputting it as output data to the playback device via the first link interface; if the wireless microphone receiving dongle does not receive the corresponding processed audio frame within a preset processing time limit, then keeping the raw audio frame in the audio buffer as output data and outputting it directly to the playback device via the first link interface.
[0007] In the above embodiments, the system passes the original audio frame to the audio processing application of the external smart terminal via the second link interface for processing. It utilizes the general computing power and software flexibility of the external smart terminal to complete the audio effect rendering and then fills the processed audio frame back into the audio buffer for output. This enables the device to provide diverse and iteratively upgradeable sound effect processing capabilities without increasing local hardware manufacturing costs. At the same time, the timeout pass-through mechanism ensures the continuity of the audio output link when external processing is abnormal.
[0008] In conjunction with some embodiments of the first aspect, in some embodiments, the audio buffer is a circular buffer, in which the corresponding original audio frame is replaced by a processed audio frame. Specifically, this includes: establishing a first read pointer corresponding to a first link interface, a write pointer corresponding to a second link interface, and a second read pointer in the circular buffer; when the original audio frame is received, it is written sequentially into the circular buffer, and the second read pointer is updated for external smart terminals to retrieve; when the processed audio frame is received, according to the frame sequence number of the obtained original audio frame, the processed audio frame is written into the corresponding target address in the circular buffer, overwriting the original audio frame; the first read pointer is used by the playback device to read the data to be output sequentially from the circular buffer according to a preset isochronous transmission interrupt cycle.
[0009] In the above embodiments, the system constructs an independent pointer management mechanism for the dual-link interface within a circular buffer. By separating the isochronous reading actions of the playback device from the asynchronous reading and writing actions of the external smart terminal, data read / write conflicts caused by concurrent access from multiple terminals are avoided. Target address mapping is performed using the frame sequence number of the original audio frame, ensuring that the processed audio frame can correspondingly overwrite the original audio data. This achieves deterministic write-back and timing alignment of asynchronously processed data while maintaining the standard audio output cycle, thus improving the stability of dual-link data flow.
[0010] In conjunction with some embodiments of the first aspect, in some embodiments, before the playback device reads the data to be output sequentially from the circular buffer, the method further includes: real-time monitoring of the buffer clearance between the first read pointer and the target address; if the buffer clearance is lower than a set anti-overflow threshold, inserting the previous processed audio frame or a silent frame into the circular buffer for compensation; if the buffer clearance is higher than a set anti-overflow threshold, discarding the oldest processed audio frame to maintain data stream synchronization between the first link interface and the second link interface.
[0011] In the above embodiments, the system establishes bidirectional compensation to prevent underflow and overflow by real-time monitoring of the buffer margin between the read pointer and the target address. When the buffer margin is insufficient, a compensation frame is proactively inserted; when the margin is overloaded, outdated data is discarded, absorbing clock differences and processing jitter between the two links within the buffer. This mechanism maintains dynamic synchronization of the data stream between the first and second link interfaces, reducing the risk of audio stuttering caused by fluctuations in external asynchronous processing time.
[0012] In conjunction with some embodiments of the first aspect, in some embodiments, the wireless microphone receiving dongle is recognized by the playback device as a standard audio input device through the first link interface. Specifically, this includes: configuring the wireless microphone receiving dongle as a composite communication peripheral; enumerating a first audio protocol endpoint on the first link interface; enumerating a second audio protocol endpoint and a third audio protocol endpoint on the second link interface; establishing an isochronous transmission connection between the first audio protocol endpoint and the playback device as a standard audio input endpoint, and being recognized as a standard audio input device; the second audio protocol endpoint serving as an audio input endpoint for an external smart terminal to read the original audio frame; and the third audio protocol endpoint serving as an audio output endpoint for an external smart terminal to write the processed audio frame.
[0013] In the above embodiments, the system configures the wireless microphone receiver dongle as a composite communication peripheral and performs differentiated endpoint enumeration, thereby logically isolating the communication topology between the playback device and the external smart terminal at the hardware interface level. The first audio protocol endpoint maintains a standard isochronous transmission connection with the playback device to ensure plug-and-play functionality, while the second and third audio protocol endpoints open a dedicated bidirectional channel for the external smart terminal to acquire and process raw audio, enabling the receiver to transparently introduce external computing nodes without interrupting the standard audio input identity, thus improving the system architecture's compatibility and scalability.
[0014] In conjunction with some embodiments of the first aspect, in some embodiments, if the wireless microphone receiving dongle does not receive the corresponding processed audio frame within a preset processing time limit, the original audio frame in the audio buffer is kept as the data to be output. Specifically, this includes: attaching a timestamp or sequence number to each original audio frame written to the audio buffer and starting the corresponding hardware timer; when the hardware timer reaches the preset processing time limit and no processed audio frame with the same timestamp or sequence number is detected being written, a timeout interrupt is triggered; after the timeout interrupt is triggered, the original audio frame to be output in the audio buffer and the previously output processed audio frame are smoothly faded in and out and cross-stitched to prevent the audio stream output to the playback device from producing popping or discontinuity.
[0015] In the above embodiments, to address potential processing delays from external smart terminals, the system establishes a frame-level processing time limit monitoring system by attaching timestamps or sequence numbers to the original audio frames and binding them to hardware timers. Upon triggering a timeout interrupt, the system performs a smooth fade-in / fade-out cross-stitching process on the current original audio frame to be output and the previously output processed audio frame. This masks acoustic abrupt changes caused by data source switching, prevents popping sounds in the audio stream output to the playback device, and improves the smoothness of the listening experience under abnormal degradation conditions.
[0016] In conjunction with some embodiments of the first aspect, in some embodiments, after triggering a timeout interrupt, the method further includes: if a processed audio frame is received again from an external smart terminal within a subsequent preset number of audio frame periods, then the timestamp deviation between the currently received processed audio frame and the currently output original audio frame is calculated; when the timestamp deviation is within the allowable synchronization error range, the pass-through output is stopped, and the output data to be output to the playback device is smoothly switched from the original audio frame back to the processed audio frame through crossfade-in and crossfade-out processing.
[0017] In the above embodiments, the system introduces dual recovery verification logic based on continuous frame period and timestamp deviation. By confirming the stability of the data stream written back by the external smart terminal and the synchronization error, repeated switching oscillations caused by instantaneous recovery are prevented. After the synchronization condition is met, cross-fade-in and fade-out processing is used to complete the smooth switchback of the data source, enabling the system to smoothly transition the output audio back to the sound effect rendering state after the external link returns to normal, thus improving the controllability of the system during abnormal recovery.
[0018] In conjunction with some embodiments of the first aspect, in some embodiments, the original audio frame is written into an audio buffer for output by the first link interface, and simultaneously sent to an external smart terminal via a second link interface. Specifically, this includes: using a microframe transmission mechanism to divide the received original audio frame into data packets of a preset length; and asynchronously pushing the data packets to the external smart terminal through a second audio protocol endpoint at a microframe interrupt frequency higher than the polling frequency of the first audio protocol endpoint, thereby reducing the link transmission delay for the external smart terminal to obtain the original audio data.
[0019] In the above embodiments, the system employs a microframe transmission mechanism to segment the original audio frame into data packets of a preset length, and uses a second audio protocol endpoint to asynchronously push the data at a microframe interrupt frequency higher than the polling frequency of the playback device. This mechanism transforms the centralized transmission of audio data into high-frequency, fine-grained transmission, compressing the waiting period when the external smart terminal acquires data, reducing the link latency for acquiring the original audio data at the transmission protocol level, and providing time margin for audio algorithm processing.
[0020] In a second aspect, embodiments of this application provide a wireless microphone audio processing device, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the wireless microphone audio processing device to perform the method as described in the first aspect and any possible implementation thereof.
[0021] Thirdly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on a wireless microphone audio processing device, cause the wireless microphone audio processing device to perform the method described in the first aspect and any possible implementation thereof.
[0022] Fourthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a wireless microphone audio processing device, cause the wireless microphone audio processing device to perform the method described in the first aspect and any possible implementation thereof.
[0023] It is understood that the wireless microphone audio processing device provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the methods provided in the embodiments of this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here.
[0024] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0025] 1. This application delivers the original audio frames to an external smart terminal application for processing, utilizing its general computing power and software flexibility to complete the sound effect rendering, enabling the device to provide diverse and iteratively upgradeable sound effect processing capabilities without increasing local hardware manufacturing costs.
[0026] 2. This application establishes a timeout pass-through mechanism based on timestamps or sequence numbers. In the event of external processing errors or timeout failure to write back, the original audio frame is maintained and smoothly cross-stitched, thus avoiding popping or discontinuity in the output audio stream and ensuring the continuity of the audio output link.
[0027] 3. This application constructs an independent pointer management mechanism for dual-link interfaces in a circular buffer, and combines it with a two-way buffer margin compensation and microframe transmission mechanism to isolate multi-end concurrent access conflicts, absorb clock differences and processing jitter between dual links, and improve the stability of data flow. Attached Figure Description
[0028] Figure 1 This is a flowchart illustrating a wireless microphone audio processing method based on an external computing unit in an embodiment of this application.
[0029] Figure 2 This is a schematic diagram of the physical device structure of a wireless microphone audio processing device in the embodiments of this application. Detailed Implementation
[0030] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification of this application, the singular expressions “a,” “an,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.
[0031] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0032] To facilitate understanding, the application scenarios of the embodiments of this application are described below.
[0033] Taking a home TV karaoke scenario as an example: The user opens a karaoke app on their smart TV in the living room, plugs a wireless microphone receiver dongle into the TV's USB port, and the TV automatically recognizes it as a microphone input. Simultaneously, the user connects their smartphone to the dongle's second link port via an OTG cable and opens the accompanying sound effect adjustment app on their phone. Within the app, the user can adjust the reverb type (room / hall / church / stadium), reverb depth (dry / wet ratio 0%-100%), reverb time (0.5s-3.0s), and pitch shift (±12 semitones, female to male or child voice), as well as vocal EQ (boosting mid-range frequencies for fuller sound or boosting high frequencies for brighter sound), and dynamic range compression (ensuring clear sound even at low volumes without overloading loud ones). When the user sings, the original vocals are sent to the phone via the dongle. The phone app processes the vocals according to the currently configured algorithm chain and writes them back to the dongle. The TV plays the reverb-, pitch-shifted, and EQ-processed vocals, which, along with the accompaniment music, are output to the home audio system, achieving an acoustic effect comparable to a karaoke room. If a user is satisfied with a certain sound effect, they can save it as a personal preset in the app and load it with one click next time. The app also supports downloading the same sound effect presets as celebrities from the cloud, or upgrading to the latest AI voice enhancement algorithm, which are things that traditional fixed DSP chips cannot achieve.
[0034] For ease of understanding, the method provided in this implementation is described in process below. Please refer to [link / reference]. Figure 1 This is a flowchart illustrating a wireless microphone audio processing method based on an external computing unit in an embodiment of this application.
[0035] S101. Through the first link interface, the wireless microphone receiving dongle is recognized by the playback device as a standard audio input device.
[0036] In this context, a standard audio input device refers to an audio input peripheral that conforms to the USB Audio Class specification or other audio device standards, and can be automatically recognized and loaded with a general driver by the operating system, achieving plug-and-play functionality without the need for a dedicated driver. The first link interface represents the physical connection channel established between the wireless microphone receiver dongle and the playback device (such as a TV or stereo system), typically implemented as a USB interface. Playback devices refer to terminal devices with audio playback capabilities, including but not limited to smart TVs, home theater systems, and Bluetooth speakers.
[0037] In other embodiments, the first link interface can be implemented using a wireless communication protocol or an analog audio interface, in addition to a wired USB interface. For example, the first link interface can be a Bluetooth audio transmission channel (such as supporting A2DP or HFP protocols), where a wireless microphone receiving dongle pairs with the playback device as a Bluetooth audio source device, thus being recognized by the playback device as a Bluetooth audio input device; alternatively, the first link interface can also be a 3.5mm analog audio interface, where the dongle integrates a digital-to-analog converter (DAC) to convert the data to be output into an analog signal before directly inputting it to the AUX or MIC IN interface of the playback device. This application does not limit this. The above-mentioned wireless or analog transmission methods may be slightly inferior to the standard USB direct digital connection in terms of transmission latency, sampling accuracy, or plug-and-play experience, but they can still achieve the basic function of inputting audio to the playback device, thereby meeting the compatibility requirements of older playback devices or purely wireless scenarios.
[0038] During system startup, a standard audio input relationship needs to be established between the dongle and the playback device to ensure that the playback device can recognize the dongle as a regular microphone device. Specifically, when the wireless microphone dongle is plugged into the playback device via USB, the dongle's internal firmware controller enumerates the USB device descriptor to the host. The device class code (bDeviceClass) is set to 0xEF for a composite device, the interface class code is set to 0x01 for an audio device class, and the interface subclass code is set to 0x02 for an audio stream interface. Upon detecting the device insertion event, the playback device's USB host controller reads the device descriptor and matches it with the system's built-in USB Audio Class driver, completing the device enumeration process. At this point, the dongle appears as a standard microphone in the playback device's audio input device list, and applications can access the device through standard audio APIs (such as ALSA and WASAPI). The core of this design is leveraging the operating system's natively supported audio device standards, avoiding the technical hurdle of installing dedicated drivers on the playback device side, lowering the user barrier, and reserving architectural space for future external smart terminals to perform audio processing.
[0039] In some preferred embodiments, the above steps specifically include:
[0040] Configure the wireless microphone receiver Dongle as a composite communication peripheral. Enumerate the first audio protocol endpoint on the first link interface, and enumerate the second and third audio protocol endpoints on the second link interface. The first audio protocol endpoint is used as a standard audio input endpoint to establish an isochronous transmission connection with the playback device and is identified as a standard audio input device.
[0041] The second audio protocol endpoint serves as the audio input endpoint for external smart terminals to read the original audio frames, while the third audio protocol endpoint serves as the audio output endpoint for external smart terminals to write the processed audio frames.
[0042] Among them, composite communication peripherals refer to a device form that integrates multiple functional interfaces into a single USB device, each interface can communicate independently with different hosts or applications. Audio protocol endpoints represent data transmission endpoints conforming to the USB audio device class specification, used to carry audio data streams, typically including isochronous input endpoints (IN Endpoint) and isochronous output endpoints (OUT Endpoint). The second link interface represents an independent communication channel established between the Dongle and an external smart terminal (such as a smartphone), which can be implemented via USB OTG, USB Type-C, or a dedicated adapter cable. The second and third audio protocol endpoints serve as dedicated channels for reading raw audio data and writing processed audio data to the external smart terminal, respectively.
[0043] In scenarios where the Dongle is simultaneously connected to a playback device and an external smart terminal, logical isolation needs to be implemented at the hardware interface level to ensure that the two links do not interfere with each other. Specifically, the Dongle's USB controller firmware adopts a USB composite device configuration, declaring two independent interfaces in the configuration descriptor: Interface 0 is bound to the first link and contains an isochronous input endpoint (endpoint address 0x81), which serves as a standard audio input endpoint to provide an audio stream to the playback device; Interface 1 is bound to the second link and contains an isochronous input endpoint (endpoint address 0x82) for the external smart terminal to read the raw audio frame, and an isochronous output endpoint (endpoint address 0x03) for the external smart terminal to write the processed audio frame.
[0044] When the playback device enumerates the Dongle, the operating system only activates interface 0, recognizing it as a standard audio input device. When an external smart terminal connects via OTG mode, the smart terminal's USB host controller enumerates interface 1, gaining access to read the raw audio and write the processed audio. This endpoint separation design ensures that the standard audio input identity of the playback device is not interrupted by the access of an external terminal by building independent audio channels for different hosts within a single hardware device, while simultaneously opening a transparent bidirectional audio data path for the external smart terminal.
[0045] In other embodiments, the second link interface can also use wireless communication technology to replace the wired physical connection. For example, the second link interface can establish a wireless LAN or personal area network connection between the Dongle and an external smart terminal based on Wi-Fi Direct, Bluetooth Low Energy (BLE), or classic Bluetooth data channels. In this scenario, the original audio frame and the processed audio frame are transmitted bidirectionally asynchronously through a custom wireless data packet format. Although the wireless link may introduce additional transmission jitter and latency compared to a wired USB connection, and requires a certain amount of wireless bandwidth, it eliminates the physical constraints of cables, allowing the external smart terminal (such as the user's mobile phone) to move more freely when processing audio effects, while still enabling the introduction of external computing power.
[0046] S102: Receive raw audio frames from the wireless microphone, write the raw audio frames into the audio buffer for output by the first link interface, and simultaneously send the raw audio frames to the external smart terminal via the second link interface.
[0047] The raw audio frame refers to a block of PCM audio data, unprocessed, acquired from a wireless microphone and demodulated and decoded using a wireless transmission protocol. Each frame typically contains a fixed number of sampling points (e.g., 480 sampling points per 10ms at a 48kHz sampling rate), and the data format is a signed integer with 16-bit or 24-bit quantization precision. The audio buffer represents a circular buffer structure located in the shared storage area within the Dongle, used to temporarily store audio data to be output to the playback device and supporting write-back operations for processed audio frames. In this step, the second link interface serves as the channel for pushing raw audio data to the external smart terminal, forming a parallel data stream with the playback-side output channel of the first link interface.
[0048] After receiving the raw audio frame from the wireless microphone, two data flows need to be satisfied simultaneously: first, maintaining the continuity of standard audio input on the playback device side; and second, providing real-time audio data to external smart terminals for algorithm processing. Specifically, after Dongle's wireless receiving module completes RF signal demodulation and audio decoding, it writes the raw audio frame to the current write position in the shared audio buffer through the DMA controller. This position is maintained by a cyclically incrementing write pointer.
[0049] After the write operation is complete, the hardware interrupt service routine simultaneously performs two actions: First, it updates the first read pointer (Read Pointer 1) for the playback device, enabling the playback device to read audio data from the buffer via the USB isochronous transfer interrupt; second, through the second audio protocol endpoint of the second link interface, it encapsulates the mirrored data of the same original audio frame into a USB data packet and asynchronously pushes it to the audio input endpoint buffer of the external smart terminal. By triggering dual-channel data distribution within the same interrupt context where the buffer write operation is completed, it ensures that the original audio data obtained by the playback side and the processing side are strictly aligned in timing, avoiding timestamp drift caused by data copy delays. Simultaneously, since the second link interface uses an independent endpoint and buffer, its data push operation does not block the isochronous transfer cycle of the first link interface.
[0050] In some preferred embodiments, the original audio frame is written into an audio buffer for output from the first link interface, and simultaneously sent to an external smart terminal via the second link interface, specifically including:
[0051] The received raw audio frame is divided into data packets of a preset length using a microframe transmission mechanism.
[0052] Through the second audio protocol endpoint, data packets are asynchronously pushed to the external smart terminal at a microframe interrupt frequency higher than the polling frequency of the first audio protocol endpoint, thereby reducing the link transmission latency for the external smart terminal to obtain the original audio data.
[0053] The microframe transmission mechanism refers to an optimized strategy that divides standard audio frames into smaller data packets and transmits them at an interrupt frequency higher than the regular polling frequency. The aim is to shorten the latency for the receiving end to acquire the first byte of data. A preset-length data packet represents the smallest data unit transmitted each time, typically ranging from 64 to 256 bytes. Each data packet includes a 4-byte frame sequence number and a 2-byte timestamp increment. The polling frequency represents the time interval at which the USB host controller queries the endpoint for data readiness; for standard USB audio devices, this is typically 1 ms (corresponding to one frame cycle in USB full-speed mode). The microframe interrupt frequency refers to a higher frequency interrupt used by the second link interface, typically 125 μs (corresponding to 8 microframes in USB high-speed mode).
[0054] When pushing raw audio data to external smart terminals, transmission latency directly affects the available time window for algorithm processing, requiring optimization at the protocol level. Specifically, after the DMA controller completes the writing of the raw audio frame, the interrupt service routine does not commit the entire frame data (e.g., 480 sample points × 2 bytes = 960 bytes) as a single USB transaction. Instead, it divides it into several 128-byte data packets. The first 4 bytes of each data packet are filled with a globally incrementing frame sequence number for reassembly and deduplication at the receiving end; the following 124 bytes are filled with audio sample data.
[0055] The Dongle USB controller configures the bInterval field of the second audio protocol endpoint to 1 (corresponding to a 125μs microframe interval), causing the USB host controller to poll the endpoint at a frequency eight times that of the standard audio endpoint. When the audio processing application of the external smart terminal requests data via the read() system call, because the microframe transmission mechanism has pre-segmented the data and pushed it to the endpoint FIFO at a high frequency, the application can obtain the first packet of data and start algorithm processing within the first 125μs microframe cycle, without waiting for the full 1ms frame cycle. By refining the temporal dimension of the audio data stream, transforming "batch transmission post-processing" into "streaming transmission side processing," approximately 0.875ms of processing time advance is gained for the algorithm module of the external smart terminal. Under the constraint of a 10ms audio frame cycle, this optimization extends the available time window for algorithm processing from the theoretical 9ms to nearly 9.875ms, providing latency margin to support more complex audio effect algorithms (such as deep learning noise reduction).
[0056] S103. Receive the processed audio frame returned by the external smart terminal through the second link interface. The processed audio frame is obtained by the external smart terminal calling the audio processing application to perform audio effect processing on the original audio frame.
[0057] In this context, the processed audio frame refers to the PCM audio data output by an audio processing application on an external smart terminal after performing a series of sound effect algorithms on the original audio frame. Its sampling rate, frame length, and quantization accuracy remain consistent with the original audio frame, but its waveform characteristics have been altered based on the sound effect parameters selected by the user. The audio processing application refers to user-space software running on an external smart terminal (such as an Android or iOS smartphone), integrating various audio algorithm plugins and allowing users to adjust parameters or switch preset sound effect templates through a graphical interface. Audio effect processing refers to digital signal processing operations performed on the audio signal, including but not limited to cascaded combinations of algorithm modules such as noise reduction, echo cancellation, automatic gain control, equalization, reverb, compression, and pitch shifting.
[0058] In different application scenarios such as home karaoke, live streaming, and conferencing, users have significantly different needs for sound effects, and the fixed DSP chip in hardware is difficult to provide flexible algorithm configuration capabilities. Specifically, after the external smart terminal continuously reads the original audio frames through the second audio protocol endpoint of the second link interface, the audio processing application loads the corresponding algorithm processing chain according to the current scene mode: In the home karaoke scenario, the typical configuration of the processing chain is "Noise Reduction (ANS) → Automatic Gain Control (AGC) → Parametric Equalizer (PEQ, boosting the 2kHz-4kHz vocal frequency band) → Reverb (Reverb, room mode, reverb time 1.2s) → Compressor (threshold -18dB) → Pitch Shifter (supports ±12 semitone adjustment)". Users can adjust the reverb depth (dry / wet ratio 0%-100%), reverb type (room / hall / church), and number of pitch semitones in real time in the APP interface. After the algorithm parameters are changed, they take effect immediately in subsequent audio frames.
[0059] In live streaming scenarios, the processing chain prioritizes clarity and stability, configured as follows: "Noise Reduction (Deep Learning Noise Reduction Model) → De-esser → Multi-band Compressor → Exciter (Enhancing High-Frequency Clarity) → Limiter (Preventing Overload)". Users can select preset templates such as "Warm Human Voice", "Bright Human Voice", and "Radio Host". Each template corresponds to a set of pre-tuned EQ curves and dynamic processing parameters. In conferencing scenarios, the processing chain focuses on speech enhancement, configured as follows: "Echo Cancellation (AEC, Adaptive Filter Length 256ms) → Noise Suppression (NS, Based on Spectral Subtraction) → Automatic Gain Control (AGC, Target Level -16dBFS) → Voice Activity Detection (VAD, Outputting Comfortable Noise When Mute)", ensuring that distant speakers hear clear and stable speech signals.
[0060] After processing, the application writes the processed audio frames back to the Dongle via the third audio protocol endpoint of the second link interface. Each frame of data carries the same frame number as the original audio frame, used for buffer address mapping and data overwriting on the Dongle side. By transferring the audio processing computational load to the user's existing smart terminal and utilizing its general-purpose CPU, DSP, or NPU computing resources, the wireless microphone system gains freedom in sound effect processing and algorithm iteration upgrade capabilities without increasing hardware manufacturing costs. Simultaneously, the plug-in architecture supports third-party algorithm extensions and cloud-based AI model deployment, breaking through the functional boundaries of firmware-based solutions.
[0061] In other embodiments, the external smart terminal is not limited to smartphones, but can also be a tablet computer, a personal computer (PC), a smartwatch, or even a portable computing box without a display screen but with independent computing and communication capabilities. For example, a user can connect a Dongle to an idle older tablet computer and use it as a dedicated audio processing node. As long as the external device has a processor (CPU / DSP / NPU) capable of running audio processing applications and supports data transmission and reception via a second link interface, it can serve as the external computing unit described in this application.
[0062] S104. Replace the corresponding original audio frame with the processed audio frame in the audio buffer, or mix the processed audio frame with the corresponding original audio frame, and output it to the playback device as the data to be output through the first link interface.
[0063] The data to be output represents the valid audio data currently available for playback devices to read in the audio buffer, and its content is dynamically updated based on the write-back status of the processed audio frames from the external smart terminal.
[0064] In different application scenarios, users have varying requirements for the mixing ratio of the original audio and the processed audio, necessitating a flexible output strategy. Specifically, when Dongle receives a processed audio frame written by an external smart terminal through the second link interface, the hardware interrupt service routine first extracts a 4-byte frame sequence number field from the packet header and locates the target address (TargetAddress) of the original audio frame corresponding to that frame sequence number in the circular buffer using a hash table or direct addressing.
[0065] In scenarios with high clarity requirements, such as meetings and live broadcasts, the system adopts a replacement strategy: the interrupt service routine calls the DMA controller to completely copy the 960-byte sampled data of the processed audio frame to the target address, overwriting the original audio frame data. At this time, the playback device reads the pure processed audio signal through the first read pointer, thus maximizing the effect of noise reduction, dereverberation and other algorithms.
[0066] In home karaoke scenarios, in order to provide singers with a more natural listening experience, the system adopts a hybrid strategy: the interrupt service routine reads the current wet / dry ratio parameter α (range 0.0-1.0, default 0.7) from the configuration register, and performs the calculation output[i] = α × processed[i] + (1-α) × original[i] for each sampling point of the target address, where processed[i] is the i-th sampling point of the processed audio frame, and original[i] is the i-th sampling point of the original audio frame.
[0067] The calculation results are written back to the target address, resulting in an output signal containing 30% original vocals (for realism) and 70% reverberated vocals (for spatiality). The wet / dry ratio parameter can be adjusted in real-time by the user in the app. Parameter changes are sent to Dongle's configuration register via the second link interface, affecting the mixing calculation of all subsequent audio frames. By implementing real-time mixing operations at the sample point level at the hardware buffer level, the additional latency caused by software mixing on the playback device side is avoided. It also supports scene-driven output strategy switching, meeting the differentiated needs of professional audio production and home entertainment.
[0068] In some preferred embodiments, the audio buffer is a circular buffer. The original audio frame is replaced with a processed audio frame in the audio buffer. Specifically, this includes: establishing a first read pointer corresponding to a first link interface, a write pointer corresponding to a second link interface, and a second read pointer in the circular buffer; when an original audio frame is received, it is written sequentially into the circular buffer, and the second read pointer is updated for external smart terminals to retrieve; when a processed audio frame is received, the processed audio frame is written to the corresponding target address in the circular buffer according to the obtained frame sequence number of the original audio frame, overwriting the original audio frame; the first read pointer is used by the playback device to sequentially read the data to be output from the circular buffer according to a preset isochronous transmission interrupt cycle.
[0069] The circular buffer refers to a circular storage structure where the first and last elements are connected. Automatic address wrapping is achieved through modular arithmetic, avoiding the space waste and data movement overhead of linear buffers. The first read pointer indicates the current read position used by the playback device when reading audio data through the first link interface, and it is periodically incremented by the USB time-transmission interrupt. The write pointer indicates the current write position used by the wireless receiving module when writing the original audio frame, and it increments by one frame length after each frame is written. The second read pointer indicates the current read position used by the external smart terminal when reading the original audio frame through the second link interface, and it is maintained independently of the first read pointer. The target address represents the buffer overwrite position calculated based on the frame sequence number of the processed audio frame, used to achieve accurate write-back of the processed data.
[0070] In scenarios with concurrent access from two links, a fine-grained pointer management mechanism is needed to avoid data races and overwrite conflicts. Specifically, Dongle internally allocates a 40960-byte circular buffer (capable of storing approximately 42 frames of 10ms audio data) and maintains three 32-bit pointer registers: the write pointer (WP) is initialized to 0, the first read pointer (RP1) is initialized to a 10-frame offset (approximately 100ms initial buffer depth), and the second read pointer (RP2) is initialized to 0.
[0071] When the wireless receiver module writes a raw audio frame via DMA, the data is written to buffer[WP %4096]. After writing, WP += 960 is executed, and the external smart terminal is notified of data readiness via GPIO interrupt. When the external smart terminal reads data through the second audio protocol endpoint, the USB controller reads 960 bytes from buffer[RP2 % 4096] and returns. After reading, RP2 += 960 is executed.
[0072] When an external smart terminal writes a processed audio frame through the third audio protocol endpoint, the frame sequence number field in the packet header records the original audio frame sequence number N corresponding to that frame. The system calculates the target address TA = (N × 960) % 4096, writes the processed audio frame data to the buffer[TA] location, overwriting the original audio frame. When the playback device initiates an isochronous transmission request with a period of 1ms through the first link interface, the USB controller reads 960 bytes of audio data from the address buffer[RP1 % 4096] and returns it to the host. After reading, it executes RP1 += 960. Because the three pointers are maintained independently and the read and write operations are performed in different interrupt contexts, concurrent access conflicts are avoided.
[0073] By establishing independent position tracking mechanisms for three concurrent data streams—output from the playback side, reading from the external terminal, and writing back from the external terminal—and utilizing the frame sequence number field to achieve deterministic mapping between asynchronous write-back data and original data, the circular buffer can transparently support out-of-order arrival and fixed-point coverage of externally processed data while maintaining the same isochronous transmission period on the playback side. This ensures the timing alignment and output determinism of the dual-link data streams.
[0074] In some preferred embodiments, before the playback device reads the data to be output sequentially from the circular buffer, the method further includes: real-time monitoring of the buffer clearance between the first read pointer and the target address; if the buffer clearance is lower than a set anti-overflow threshold, inserting the previous processed audio frame or a silent frame into the circular buffer for compensation; if the buffer clearance is higher than a set anti-overflow threshold, discarding the oldest processed audio frame to maintain data stream synchronization between the first link interface and the second link interface.
[0075] Buffer margin refers to the amount of valid data between the current position of the first read pointer and the latest written target address, measured in bytes or frames, reflecting the data reserve depth of the output channel on the playback device side. The underflow prevention threshold represents the minimum safe value of the buffer margin. When the margin is below this threshold, it indicates that the playback speed is faster than the data write-back speed, posing a risk of output interruption. A typical value is 2 frames (20ms). The overflow prevention threshold represents the maximum allowable value of the buffer margin. When the margin exceeds this threshold, it indicates that the data write-back speed is faster than the playback speed, posing a risk of latency accumulation. A typical value is 10 frames (100ms). A silent frame refers to an audio frame where all sample points have a value of 0. It is used to fill the output when data is insufficient, preventing the playback device from producing popping sounds due to empty buffer reads.
[0076] When the processing time of external smart terminals fluctuates, a dynamic buffer adjustment mechanism is needed to maintain output stability. Specifically, Dongle's timer interrupt service routine (executed with a 1ms period) calculates the buffer margin in real time as margin = (TA - RP1 + 4096) % 4096, where TA is the target address of the latest written processed audio frame, and RP1 is the current read position of the playback device.
[0077] When a margin < 1920 (corresponding to 2 frames of data) is detected, the underflow compensation logic is triggered: the interrupt service routine reads the processed audio frame data of the previous frame from the historical frame buffer and copies it to the buffer[(RP1 + 960)% 4096] position, which is equivalent to inserting the previous frame data again once, so that the playback device can still read valid data in the next isochronous transmission cycle, avoiding audio stuttering or popping caused by empty buffer reading. The cost is that there is a 10ms waveform repetition in the audio frame, but since the human ear is not sensitive to the perception of single frame repetition, it is perceived as a slight "time stretching" rather than an obvious fault.
[0078] When a margin > 9600 (corresponding to 10 frames of data) is detected, the anti-overflow compensation logic is triggered: the interrupt service routine executes RP1 += 960, which is equivalent to discarding the oldest processed audio frame in the buffer, forcibly advancing the playback position, and preventing infinite accumulation of delay that could lead to audio-visual desynchronization. After the compensation action is executed, the system sends a buffer status notification to the external smart terminal through the second link interface, suggesting that it dynamically adjust the algorithm complexity or frame length to match the current processing capacity. By introducing a bidirectional threshold monitoring and active compensation mechanism at the buffer management level, the clock differences and latency fluctuations introduced by external asynchronous processing are absorbed within the buffer, ensuring that the playback device can always obtain valid audio data with a constant isochronous transmission period.
[0079] In other embodiments, when the buffer margin falls below a set underflow prevention threshold, compensation can be achieved through linear interpolation or comfort noise filling, in addition to directly inserting the processed audio frame or a silent frame from the previous frame. For example, the system can predict and generate a transitional audio data frame for insertion based on the audio waveform change trend of the previous two frames using a simple linear interpolation algorithm; or, when the current audio is detected to be in a non-human voice activity segment, comfort noise (CNG) matching the background noise spectrum characteristics can be inserted. Although these degraded or simplified compensation algorithms may introduce slight sound quality distortion or computational overhead in extreme cases, they can still effectively prevent the playback device from producing harsh popping sounds due to buffer empty readings, ensuring the continuity of the audio stream on the physical output link.
[0080] S105. If the wireless microphone receiver Dongle does not receive the corresponding processed audio frame within the preset processing time limit, the original audio frame in the audio buffer is kept as the data to be output and is directly output to the playback device through the first link interface.
[0081] The preset processing time limit refers to the maximum tolerable time window set by the system for external smart terminals to complete audio effect processing and write back data. It is usually determined based on the audio frame length, bidirectional link transmission delay, and buffer depth on the playback device side.
[0082] In an architecture that incorporates an external smart terminal for audio processing, factors such as system load fluctuations of the external device, application lag, or momentary communication interference at the second link interface can all cause the processed audio frame to fail to be written back to the wireless microphone receiving dongle on time. Specifically, when the system sends the original audio frame to the external smart terminal, it initiates a timeout monitoring mechanism for that frame data. When the waiting time reaches the preset processing time limit, if the corresponding position in the audio buffer is still not covered by the processed audio frame, the system state machine will trigger exception handling logic. Instead of continuing to block and wait, it will directly use the original audio frame in the buffer as the output data for the current cycle, which will be read by the first link interface and sent to the playback device.
[0083] In some preferred embodiments, the above steps specifically include: attaching a timestamp or sequence number to each original audio frame written to the audio buffer and starting the corresponding hardware timer; when the hardware timer reaches the preset processing time limit and no processed audio frame with the same timestamp or sequence number is detected being written, triggering a timeout interrupt; after triggering the timeout interrupt, performing smooth fade-in / fade-out cross-splitting processing on the original audio frame to be output in the audio buffer and the processed audio frame that has been output in the previous frame, so as to prevent the audio stream output to the playback device from producing popping or discontinuity.
[0084] The preset processing time limit refers to the maximum allowed time interval from writing the original audio frame to the expected reception of the corresponding processed audio frame. It takes into account link transmission latency, algorithm processing time, and buffer capacity, with a typical value of 30ms to 50ms. The timestamp represents a monotonically increasing time marker appended to the header of each original audio frame, in microseconds, used to identify the acquisition time of the audio frame and establish inter-frame correspondence. The sequence number represents a globally unique identifier for each original audio frame, monotonically increasing from 0, with a wraparound period typically set to 65536. The hardware timer refers to the programmable timer peripheral within the Dongle, supporting independent configuration of timeout interrupts for each audio frame, with an accuracy of at least 1ms.
[0085] In the event of an external smart terminal processing anomaly or link interruption, a rapid degradation mechanism is required to ensure output continuity. Specifically, when the DMA controller completes the writing of the original audio frame to the circular buffer, the interrupt service routine not only updates the write pointer but also performs the following timeout monitoring initialization actions: reads the current timestamp (e.g., 1672531200.123456 seconds) from the real-time clock (RTC) and writes it to the 8-byte timestamp field in the audio frame header; reads the current frame sequence number (e.g., 12345) from the global sequence number counter, writes it to the 4-byte sequence number field in the frame header, and increments the counter; configures the comparison register value of the hardware timer TIMx to the current timestamp plus a preset processing time limit (e.g., +40ms), and enables the TIMx comparison match interrupt.
[0086] When the hardware timer count reaches the set value of the compare register, a timeout interrupt is triggered. The interrupt service routine first checks whether there is a processed audio frame with the same sequence number in the circular buffer: by traversing the range of 10 frames from the current target address TA, the sequence number field of the header of each frame is read and compared with the sequence number of the original audio frame that triggered the timeout. If there is no match, it is confirmed as a true timeout. At this time, the interrupt service routine no longer waits for the processed audio frame, but instead performs fade-in and fade-out cross-stitching on the original audio frame to be output in the circular buffer: the last 128 sample points of the processed audio frame that has been output in the previous frame are read as the fade-out segment, and the first 128 sample points of the current original audio frame are read as the fade-in segment. Cross-fade-in and fade-out calculation is performed on the two: crossfade[i] = fadeout[i] × (1 - i / 128) + fadein[i] × (i / 128), where i ranges from 0 to 127. The calculation result is written back to the position of the first 128 sample points of the current original audio frame.
[0087] The original audio frames, after cross-splicing, are used as output data for the playback device. Simultaneously, the system state machine switches to "pass-through mode," allowing all subsequent original audio frames to be output directly without waiting for the processed audio frames to be written back. By binding a hardware timer to each audio frame and establishing a dual verification mechanism based on timestamps and sequence numbers, erroneous switching due to global timeout judgments is avoided. Furthermore, the cross-fade-in / fade-out algorithm masks waveform abrupt changes during data source switching, smoothing the transition from "processed audio to original audio" and preventing audible pops in the audio stream output to the playback device.
[0088] In some preferred embodiments, after triggering a timeout interrupt, the method further includes: if a processed audio frame is received again from an external smart terminal within a subsequent preset number of audio frame periods, then the timestamp deviation between the currently received processed audio frame and the currently output original audio frame is calculated; when the timestamp deviation is within the allowable synchronization error range, the pass-through output is stopped, and the output data to be output to the playback device is smoothly switched from the original audio frame back to the processed audio frame through crossfade-in and crossfade-out processing.
[0089] The preset number of consecutive audio frame periods refers to the time window used to determine the recovery of the external smart terminal's processing capability, measured in audio frames, with a typical value of 5 frames (50ms) to 10 frames (100ms). Processed audio from all frames within this window must be written back on time. The timestamp deviation represents the difference between the timestamp of the currently received processed audio frame and the timestamp of the original audio frame to be output, reflecting the total latency of the processing link, including round-trip time and algorithm processing time. The synchronization error range indicates the upper limit of the allowable timestamp deviation; exceeding this range indicates that the processed audio frame has lost synchronization with the current playback position and should not be immediately re-switched back. A typical value is ±20ms.
[0090] After the external smart terminal recovers from the abnormal state, strict verification logic is needed to avoid repeated switching oscillations. Specifically, when the system is in pass-through mode, the interrupt service routine continuously monitors the arrival of data from the third audio protocol endpoint. If a processed audio frame is detected being written during a certain isochronous transmission cycle, the system does not immediately switch back to processing mode, but instead starts a recovery verification timer and records the current frame sequence number N_start.
[0091] Within the next five consecutive audio frame cycles (corresponding to 50ms), the interrupt service routine checks whether processed audio frames with frame numbers N_start+1, N_start+2, ..., N_start+5 have been received, and the arrival time interval of each frame conforms to the pattern of 10ms ± 2ms. If all five frames arrive on time, it is considered that the processing capability of the external smart terminal has been stably restored; otherwise, it is considered that the recovery is instantaneous, and the pass-through mode continues to be maintained.
[0092] After the stability check passes, calculate the timestamp deviation: read the timestamp field T_processed from the header of the latest processed audio frame, read the timestamp field T_original from the header of the current original audio frame to be output, and calculate the deviation value delta = T_processed - T_original.
[0093] If |delta| ≤ 20ms, it indicates that the processed audio frame is basically synchronized with the playback position, satisfying the back-cut condition; otherwise, it indicates that the processing link delay is too large, and it is necessary to wait for the buffer to be naturally consumed to the synchronization range. After the back-cut condition is satisfied, the interrupt service routine performs cross-fade-in and cross-fade-out processing on the original audio frame to be output and the processed audio frame to be output: the last 128 sample points of the original audio frame are used as the fade-out segment, and the first 128 sample points of the processed audio frame are used as the fade-in segment. Cross-splicing calculation is performed, and the result is written to the position of the first 128 sample points of the processed audio frame.
[0094] After the splicing is completed, the system state machine switches back to "processing mode", and subsequent audio frames resume the normal logic of prioritizing the output of processed audio frames.
[0095] The wireless microphone audio processing device in the embodiments of this invention is described below from a hardware processing perspective. Please refer to [link / reference needed]. Figure 2 This is a schematic diagram of the physical structure of a wireless microphone audio processing device in an embodiment of this application.
[0096] It should be noted that, Figure 2 The structure of the wireless microphone audio processing device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0097] like Figure 2 As shown, the wireless microphone audio processing device includes a Central Processing Unit (CPU) 201, which can perform various appropriate actions and processes based on a program stored in Read-Only Memory (ROM) 202 or a program loaded from storage portion 208 into Random Access Memory (RAM) 203, such as performing the methods described in the above embodiments. The RAM 203 also stores various programs and data required for system operation. The CPU 201, ROM 202, and RAM 203 are interconnected via a bus 204. An Input / Output (I / O) interface 205 is also connected to the bus 204.
[0098] The following components are connected to I / O interface 205: input section 206 including audio input devices, push-button switches, etc.; output section 207 including a liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 208 including a hard disk, etc.; and communication section 209 including a network interface card such as a LAN (Local Area Network) card, modem, etc. Communication section 209 performs communication processing via a network such as the Internet. Drive 210 is also connected to I / O interface 205 as needed. Removable media 211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 210 as needed so that computer programs read from them can be installed into storage section 208 as needed.
[0099] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 209, and / or installed from removable medium 211. When the computer program is executed by central processing unit (CPU) 201, it performs the various functions defined in the present invention.
[0100] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0101] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.
[0102] Specifically, the wireless microphone audio processing device in this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, it implements the wireless microphone audio processing method based on an external computing unit provided in the above embodiment.
[0103] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the wireless microphone audio processing device described in the above embodiments; or it may exist independently and not assembled into the wireless microphone audio processing device. The storage medium carries one or more computer programs that, when executed by a processor of the wireless microphone audio processing device, cause the wireless microphone audio processing device to implement the wireless microphone audio processing method based on an external computing unit provided in the above embodiments.
[0104] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0105] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0106] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A wireless microphone audio processing method based on an external computing unit, applied to a wireless microphone audio processing system, the system comprising a wireless microphone, a wireless microphone receiving dongle, a playback device, and an external smart terminal as an external computing unit, wherein the wireless microphone is wirelessly connected to the wireless microphone receiving dongle, the wireless microphone receiving dongle is connected to the playback device via a first link interface, and the wireless microphone receiving dongle is connected to the external smart terminal via a second link interface, characterized in that... The method includes: Through the first link interface, the wireless microphone receiving dongle is recognized by the playback device as a standard audio input device; The system receives raw audio frames from the wireless microphone, writes the raw audio frames into an audio buffer for output from the first link interface, and simultaneously sends the raw audio frames to the external smart terminal via the second link interface. The system receives a processed audio frame returned by the external smart terminal via the second link interface. The processed audio frame is obtained by the external smart terminal calling an audio processing application to perform audio effect processing on the original audio frame. The processed audio frame replaces the corresponding original audio frame in the audio buffer, or the processed audio frame is mixed with the corresponding original audio frame and output as output data to the playback device via the first link interface. If the wireless microphone receiving dongle does not receive the corresponding processed audio frame within the preset processing time limit, the original audio frame in the audio buffer is retained as the data to be output and directly output to the playback device via the first link interface.
2. The method according to claim 1, characterized in that, The audio buffer is a circular buffer, and the process of replacing the corresponding original audio frame with the processed audio frame in the audio buffer specifically includes: In the circular buffer, a first read pointer corresponding to the first link interface and a second read pointer corresponding to the second link interface are established respectively. When the original audio frame is received, it is written sequentially into the circular buffer, and the second read pointer is updated for the external smart terminal to retrieve. When the processed audio frame is received, the processed audio frame is written into the corresponding target address in the circular buffer according to the obtained frame number of the original audio frame, overwriting the original audio frame; The first read pointer is used by the playback device to read the data to be output sequentially from the circular buffer according to a preset isochronous transmission interrupt cycle.
3. The method according to claim 2, characterized in that, Before the playback device reads the data to be output sequentially from the circular buffer, the method further includes: Real-time monitoring of the buffer clearance between the first read pointer and the target address; If the buffer margin is lower than the set anti-overflow threshold, the previous processed audio frame or silent frame is inserted into the circular buffer for compensation. If the buffer margin is higher than the set anti-overflow threshold, the oldest processed audio frame is discarded to maintain data stream synchronization between the first link interface and the second link interface.
4. The method according to claim 1, characterized in that, The step of enabling the wireless microphone receiving dongle to be recognized as a standard audio input device by the playback device through the first link interface specifically includes: The wireless microphone receiver Dongle is configured as a composite communication peripheral. A first audio protocol endpoint is enumerated on the first link interface, and a second and third audio protocol endpoints are enumerated on the second link interface. The first audio protocol endpoint is used as a standard audio input endpoint to establish an isochronous transmission connection with the playback device and is identified as the standard audio input device. The second audio protocol endpoint serves as an audio input endpoint for the external smart terminal to read the original audio frame, and the third audio protocol endpoint serves as an audio output endpoint for the external smart terminal to write the processed audio frame.
5. The method according to claim 1, characterized in that, If the wireless microphone receiving dongle does not receive the corresponding processed audio frame within a preset processing time limit, the original audio frame in the audio buffer is retained as data to be output, specifically including: A timestamp or sequence number is appended to each original audio frame written to the audio buffer, and the corresponding hardware timer is started. When the hardware timer reaches the preset processing time limit and no processed audio frame with the same timestamp or sequence number is detected being written, a timeout interrupt is triggered. After the timeout interrupt is triggered, the original audio frame to be output in the audio buffer and the processed audio frame that has been output in the previous frame are smoothly faded in and out and cross-stitched to prevent the audio stream output to the playback device from producing popping or discontinuity.
6. The method according to claim 5, characterized in that, After triggering the timeout interrupt, the method further includes: If the processed audio frame is received again from the external smart terminal within a subsequent preset number of audio frame periods, the timestamp deviation between the currently received processed audio frame and the currently output original audio frame is calculated. When the timestamp deviation is within the allowable synchronization error range, the pass-through output is stopped, and the data to be output to the playback device is smoothly switched from the original audio frame back to the processed audio frame through crossfade-in and crossfade-out processing.
7. The method according to claim 4, characterized in that, The original audio frame is written into the audio buffer for output from the first link interface, and simultaneously sent to the external smart terminal via the second link interface, specifically including: The received original audio frame is divided into data packets of a preset length using a microframe transmission mechanism. The data packets are asynchronously pushed to the external smart terminal via the second audio protocol endpoint at a microframe interrupt frequency higher than the polling frequency of the first audio protocol endpoint, thereby reducing the link transmission latency for the external smart terminal to obtain the original audio data.
8. A wireless microphone audio processing device, characterized in that, The wireless microphone audio processing device includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the wireless microphone audio processing device to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that, When the instruction is executed on a wireless microphone audio processing device, the wireless microphone audio processing device performs the method as described in any one of claims 1-7.
10. A computer program product, characterized in that, When the computer program product is run on a wireless microphone audio processing device, it causes the wireless microphone audio processing device to perform the method as described in any one of claims 1-7.