Audio data processing method and device, electronic equipment and storage medium

By aligning the microphone data and the reference audio data processing method, the problem of poor echo cancellation in the vehicle system is solved, and better voice call quality is achieved.

CN114420146BActive Publication Date: 2025-10-21THUNDERSOFT (NANJING) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111631201.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2025-10-21
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

In the car system, the microphone data and reference sound data cannot be transmitted to the ECNR algorithm for processing at the same time, resulting in poor echo cancellation effect.

Method used

By obtaining the first audio data collected by the microphone and the second audio data played inside the terminal device, the audio data size is calculated according to the delay time of the microphone, and the second audio data is aligned with the first audio data, and echo cancellation processing is performed with the aligned second audio data as a reference.

Benefits of technology

Improves the effect of echo cancellation, allowing microphone data and reference audio data to be processed at the same time, improving voice call quality and experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114420146B_ABST
    Figure CN114420146B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an audio data processing method and device, electronic equipment and storage medium, the method comprising: acquiring first audio data collected by a microphone, the microphone having a delay time; the first audio data including echo data of background audio produced after the background audio played inside a terminal is diffused through a loudspeaker; acquiring second audio data; the second audio data being original data of the background audio played inside the terminal device; acquiring the size of audio data collected by the microphone within the delay time; aligning the second audio data with the first audio data according to the size of the audio data; and performing echo cancellation processing on the first audio data with the aligned second audio data as reference audio data. The microphone data and the reference audio data can be aligned to the same time point for echo cancellation processing, improving the effect of echo cancellation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of audio data processing, and in particular to an audio data processing method, an audio data processing device, an electronic device, and a storage medium. Background Art

[0002] In the car system, functions such as voice wake-up and hands-free calling generally use software echo cancellation (ECNR) solutions. This solution requires that the microphone data collected by the microphone at the same time point and the reference sound data played inside the car system be passed to the ECNR algorithm for processing at the same time. After processing, the microphone data that has undergone echo cancellation and noise reduction processing is output.

[0003] The reference sound data played back inside the vehicle system is typically transmitted directly from the back-end DSP (Digital Signal Processor) to the SOC (System on Chip) through circuitry. Most vehicles currently use microphones with noise reduction capabilities, which perform noise reduction processing after recording the data. This processing is subject to a certain delay. Consequently, the microphone data and the reference sound data played back inside the vehicle system cannot be simultaneously transmitted to the ECNR algorithm for processing, affecting the effectiveness of echo cancellation. Summary of the Invention

[0004] The embodiment of the present invention provides an audio data processing method to solve the problem in the prior art that microphone data and reference sound data are not aligned when performing echo cancellation, thereby affecting the effect of echo cancellation.

[0005] Correspondingly, an embodiment of the present invention further provides an audio data processing device to ensure the implementation and application of the above method.

[0006] In order to solve the above problems, an embodiment of the present invention discloses an audio data processing method, which includes:

[0007] Acquiring first audio data collected by a microphone, wherein the microphone has a delay time; the first audio data includes echo data of the background audio generated after the background audio played inside the terminal is diffused by the speaker;

[0008] Acquire second audio data; the second audio data is the original data of the background audio played inside the terminal device;

[0009] Obtaining the size of audio data collected by the microphone within the delay time;

[0010] aligning the second audio data with the first audio data according to the size of the audio data;

[0011] The aligned second audio data is used as reference audio data to perform echo cancellation processing on the first audio data.

[0012] Optionally, obtaining the size of audio data collected by the microphone within the delay time includes:

[0013] Obtaining specifications of the microphone;

[0014] The size of the audio data collected by the microphone within the delay time is calculated according to the specification parameters.

[0015] Optionally, the specification parameters include sampling rate, sampling depth and number of acquisition channels.

[0016] Optionally, aligning the second audio data with the first audio data according to the size of the audio data includes:

[0017] Setting a first buffer zone and a second buffer zone;

[0018] caching the first audio data in the first buffer;

[0019] Filling the second buffer with invalid data having a size equal to that of the audio data;

[0020] The second audio data is cached in the second buffer after the invalid data is filled in, so that the second audio data is aligned with the first audio data.

[0021] Optionally, performing echo cancellation processing on the first audio data using the aligned second audio data as reference audio data includes:

[0022] Simultaneously, obtaining the first audio data and the second audio data from the first buffer and the second buffer respectively;

[0023] The aligned second audio data is used as reference audio data to perform echo cancellation processing on the first audio data.

[0024] Optionally, the method is applied to a vehicle system.

[0025] An embodiment of the present invention further discloses an audio data processing device, comprising:

[0026] A first audio data acquisition module is configured to acquire first audio data collected by a microphone having a delay time; the first audio data includes echo data of the background audio played inside the terminal after being diffused by the speaker;

[0027] A second audio data acquisition module is used to acquire second audio data; the second audio data is the original data of the background audio played inside the terminal device;

[0028] An audio data size acquisition module, configured to acquire the size of the audio data collected by the microphone within the delay time;

[0029] an audio data alignment module, configured to align the second audio data with the first audio data according to the size of the audio data;

[0030] The echo cancellation processing module is configured to perform echo cancellation processing on the first audio data by using the aligned second audio data as reference audio data.

[0031] Optionally, the audio data size acquisition module is configured to acquire specification parameters of the microphone; and calculate the size of the audio data collected by the microphone within the delay time according to the specification parameters.

[0032] Optionally, the specification parameters include sampling rate, sampling depth and number of acquisition channels.

[0033] Optionally, the audio data alignment module is used to set a first buffer and a second buffer; cache the first audio data in the first buffer; fill the second buffer with invalid data equal to the size of the audio data; and cache the second audio data in the second buffer after filling the invalid data, so that the second audio data is aligned with the first audio data.

[0034] Optionally, the echo cancellation processing module is used to simultaneously obtain the first audio data and the second audio data from the first buffer and the second buffer respectively; and perform echo cancellation processing on the first audio data using the aligned second audio data as reference audio data.

[0035] Optionally, the device is applied to a vehicle system.

[0036] An embodiment of the present invention discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the steps of the audio data processing method described above are implemented.

[0037] An embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the audio data processing method described above are implemented.

[0038] The embodiments of the present invention include the following advantages:

[0039] In an embodiment of the present invention, microphone data collected by a microphone is obtained as first audio data, and the original data of the background audio played inside the terminal device is obtained as second audio data. The size of the audio data collected by the microphone during the delay time is calculated based on the delay time of the microphone. Then, the second audio data is aligned with the first audio data based on the audio data size, and the first audio data is echo-cancelled using the aligned second audio data as reference audio data. This embodiment of the present invention can align the microphone data and the reference audio data to the same time point based on the size of the audio data collected during the delay time before performing echo cancellation processing, thereby improving the effect of echo cancellation. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 is a flowchart of the steps of an embodiment of an audio data processing method of the present invention;

[0041] Figure 2 It is a flowchart of an embodiment of audio data processing of the present invention;

[0042] Figure 3a This is a schematic diagram of a case where MIC data and reference sound data are not aligned with each other according to the present invention;

[0043] Figure 3b is a schematic diagram of echo cancellation for misaligned audio data according to the present invention;

[0044] Figure 4a This is a schematic diagram of the alignment of MIC data and reference sound data according to the present invention;

[0045] Figure 4b It is a schematic diagram of echo cancellation of aligned audio data according to the present invention;

[0046] Figure 5 It is a structural block diagram of an embodiment of an audio data processing device of the present invention. DETAILED DESCRIPTION

[0047] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0048] Currently, in-vehicle systems offer a variety of voice functions, such as voice wake-up and hands-free calling. However, while the car is in motion, in-vehicle voice recognition and call quality are severely impacted by in-vehicle noise, including the engine, air conditioning, human voices, and multimedia. For example, when the driver is on a voice call, the music playing in the car or the call audio playing through the speakers can cause the voice to be unclear or the speaker to hear their own voice, affecting the call quality and experience. Therefore, in-vehicle systems, voice functions are typically processed with echo cancellation and noise reduction.

[0049] Therefore, software echo cancellation and noise reduction (ECNR) solutions are generally used at present. This solution requires that the microphone data collected by the microphone at the same time point and the reference sound data played inside the vehicle system are simultaneously passed to the ECNR algorithm for processing. After processing, the microphone data that has undergone echo cancellation and noise reduction processing is output. Since most vehicles currently use microphones with noise reduction functions, such microphones will first perform noise reduction processing after recording the data, which will have a certain delay time. The reference sound data played inside the vehicle system can be directly transmitted from the DSP chip to the sound card. The SOC chip then obtains the data from the sound card for processing without going through the microphone processing, and the delay time is very small. Therefore, there will be a large delay time between the microphone data and the reference sound data, and they cannot be transmitted to ECNR for processing at the same time, affecting the effect of echo cancellation.

[0050] In this regard, one of the core inventive points of an embodiment of the present invention is to obtain first audio data collected by a microphone and the original data of the background audio played inside the terminal device as second audio data, calculate the size of the audio data collected by the microphone during the delay time based on the microphone delay time, and then align the second audio data with the first audio data based on the audio data size, and use the aligned second audio data as the reference audio data to perform echo cancellation processing on the first audio data. The microphone data and the reference audio data can be aligned to the same time point before performing echo cancellation processing, thereby improving the echo cancellation effect.

[0051] To help those skilled in the art better understand the embodiments of the present invention, the technical terms involved in the embodiments of the present invention are further explained as follows:

[0052] ECNR (Echo Cancellation & Noise Reduction) is used in voice recognition and hands-free calling to eliminate near-end stereo echo from media, enabling full-duplex, real-time, two-way voice interaction. In a vehicle, music (reference audio data) and the source signal (microphone data) coexist. During voice recognition, the music needs to be blocked out, which is known as echo cancellation. Echo cancellation uses the music signal as a reference signal, suppressing ambient noise and enhancing the effective voice signal.

[0053] Microphone, translated from the English word microphone, is also called microphone or micro-phone. A microphone is an energy conversion device that converts sound signals into electrical signals.

[0054] DSP (Digital Signal Processor) is a microprocessor that is particularly suitable for performing digital signal processing operations. Its main application is to implement various digital signal processing algorithms in real time and quickly.

[0055] SOC (System on Chip) is a chip integration at the core of an information system, integrating key system components on a single chip. The system-level chip can be composed of a system-level chip control logic module, a microprocessor / microcontroller CPU core module, a digital signal processor DSP module, an embedded memory module, an interface module for communicating with the outside world, and a power supply and power consumption management module.

[0056] Microphone data, that is, audio data collected by the microphone.

[0057] Reference audio data is typically transmitted directly from the DSP to the sound card via circuitry. The SOC then processes the reference data from the sound card node. (This can be transmitted directly to the SOC via circuitry, without requiring microphone acquisition.)

[0058] The car-machine system, that is, the vehicle-mounted human-computer interaction system, has devices such as microphones, DSPs and SOCs, which can realize the interaction function between people and cars. Through this system, voice wake-up of the vehicle, voice calls, switching functions and settings can be realized.

[0059] The sampling rate (frequency of sample) defines the number of samples extracted from a continuous signal and composed of a discrete signal per unit time.

[0060] Sampling depth refers to the degree of detail with which sound intensity is recorded in the sample.

[0061] Specifically, refer to Figure 1, shows a flowchart of an audio data processing embodiment of the present invention, which may specifically include the following steps:

[0062] Step 101: Acquire first audio data collected by a microphone, wherein the microphone has a delay time; the first audio data includes echo data of the background audio generated by background audio played inside the terminal after being diffused by a speaker;

[0063] In a specific implementation, an embodiment of the present invention can be applied to a vehicle-mounted system, and the speaker's voice audio data can be collected through a microphone in the vehicle-mounted system. The voice audio data can be a call voice during a voice call, a wake-up voice for waking up the vehicle-mounted system, or other voice audio data for voice interaction with the vehicle-mounted system. After the microphone collects the voice audio data, the voice audio data is used as the first audio data.

[0064] Specifically, the microphone used to collect the first audio data is a microphone with a noise reduction function. After collecting the audio data, the microphone needs to perform noise reduction processing, which takes a certain amount of time. The time consumed during the noise reduction process is the microphone's delay time. The delay time of a microphone is fixed, unless affected by other factors, and is typically in the millisecond (ms) range. For example, a noise reduction microphone with an 18ms delay time requires 18ms for noise reduction processing.

[0065] In a real-world vehicle environment, when a person in the vehicle is making a voice call through the vehicle's head unit system, the first audio data collected by the microphone includes not only the voice data but also background audio played through the vehicle's speakers. This background audio can include the voice of the person speaking with the vehicle, background music, operation prompts, and voice prompts from the head unit system. Echo data is generated when the background audio is played back through the speakers and then transmitted back through the microphone to the other party in the voice call.

[0066] Step 102: Acquire second audio data; the second audio data is the original data of the background audio played inside the terminal device;

[0067] The second audio data is original data of the background audio played inside the vehicle system, that is, original audio data of the background audio played inside the vehicle system before being played and diffused through the speakers.

[0068] In a specific implementation, the SOC of the vehicle system can obtain the second audio data from the sound card. Specifically, the DSP chip transmits the original data of the background audio to the sound card, and the SOC directly obtains the original data of the background audio from the sound card as the second audio data.

[0069] Step 103: Obtain the size of the audio data collected by the microphone within the delay time;

[0070] In a specific implementation, the microphone will not capture audio data during the delay period. Therefore, the vehicle-mounted system will not receive the first audio data captured by the microphone during the delay period. Therefore, the size of the audio data captured by the microphone during the delay period can be obtained. In practice, the hardware specifications and delay period of a microphone are fixed, and the size of the audio data captured by the microphone during the delay period can be calculated based on the hardware specifications and delay period of the microphone.

[0071] Step 104: Align the second audio data with the first audio data according to the size of the audio data;

[0072] The second audio data is aligned with the first audio data, specifically, the second audio data and the first audio data can be simultaneously transmitted to the SOC for echo cancellation processing after being aligned.

[0073] In a specific implementation, since the first audio data collected through the microphone has a delay, and the delay of the second audio data obtained through the internal chip and circuit of the vehicle system is very small, there will be a difference in delay time between the first audio data and the second audio data, and the ECNR algorithm requires the first audio data and the second audio data to be transmitted at the same time for echo cancellation processing. Therefore, in an embodiment of the present invention, the first audio data and the second audio data can be aligned according to the size of the audio data obtained above, so that the first audio data and the second audio data can be transmitted to the SOC at the same time for echo cancellation processing.

[0074] Step 105: Use the aligned second audio data as reference audio data to perform echo cancellation processing on the first audio data.

[0075] Specifically, after the first audio data and the second audio data are aligned, the first audio data and the second audio data can be simultaneously transmitted to the SOC, and the SOC uses the aligned second audio data as reference audio data to perform echo cancellation processing on the first audio data.

[0076] In order to enable those skilled in the art to better understand the technical solution of the embodiment of the present invention, the following example is given with reference to Figure 2 The flowchart of an audio data processing embodiment of the present invention is shown to illustrate the embodiment of the present invention.

[0077] This example is the audio data processing flow of a car system. Figure 2As shown in , ref is the background audio within the vehicle system. In this embodiment of the present invention, it is the second audio data directly acquired by the vehicle system's SOC from within the system. SOURCE is the source audio data emitted by the speaker. When the vehicle system's MIC (Microphone) collects SOURCE, it also collects the background audio broadcast by the speaker. In this embodiment of the present invention, it is the first audio data.

[0078] Specifically, after acquiring the first and second audio data, the size of the audio data collected by the MIC during the delay time can be calculated based on the MIC's specifications and delay time. The second audio data can then be aligned with the first audio data based on the audio data size. The aligned first and second audio data are simultaneously transmitted to the SOC for echo cancellation processing, and the SOURCE signal after the echo cancellation processing is completed is used to wake up the vehicle system.

[0079] In an embodiment of the present invention, first audio data collected by a microphone is obtained, and the original data of the background audio played within the terminal device is obtained as second audio data. The size of the audio data collected by the microphone during the delay time is calculated based on the delay time of the microphone. Then, the second audio data is aligned with the first audio data based on the audio data size, and the first audio data is echo-cancelled using the aligned second audio data as reference audio data. This embodiment of the present invention can align the microphone data and the reference audio data to the same time point based on the size of the audio data collected during the delay time before performing echo cancellation processing, thereby improving the effect of echo cancellation.

[0080] Based on the above embodiment, a modified embodiment of the above embodiment is proposed. It should be noted that, in order to simplify the description, only the differences from the above embodiment are described in the modified embodiment.

[0081] In an exemplary embodiment, step 103, obtaining the size of the audio data collected by the microphone within the delay time, includes:

[0082] Obtaining specifications of the microphone;

[0083] The size of the audio data collected by the microphone within the delay time is calculated according to the specification parameters.

[0084] The specifications include sampling rate, sampling depth, and number of acquisition channels. Audio data size is usually measured in bytes, a unit used in computer information technology to measure storage capacity. Sampling depth is measured in bits.

[0085] Specifically, the microphone is a noise-canceling microphone. A microphone's specifications reflect its hardware performance, and its delay reflects the time it takes to perform noise reduction processing. The specifications and delay are fixed. In a specific implementation, the size of the audio data collected by a microphone during the delay can be calculated based on the microphone's specifications and delay. One calculation method is as follows:

[0086] Audio data size = (sampling frequency × number of sampling bits × number of channels × time (delay time))

[0087] In one example, assuming that the sampling rate of a noise-canceling microphone is 16 kHz, the sampling depth is 16 bits, the number of channels is 2, and the delay is 18 ms, the size of the audio data collected by the noise-canceling microphone during the delay time can be calculated according to the above calculation method, specifically: audio data size = 16 kHz × 16 bits × 2 × 18 ms = 1152 bytes.

[0088] In the above exemplary embodiment, after obtaining the specification parameters and delay time of the microphone, the size of the audio data collected by this microphone during the delay time can be calculated based on the specification parameters and delay time, and then the second audio data can be aligned with the first audio data based on the audio data size to improve the echo cancellation effect.

[0089] In an exemplary embodiment, step 104, aligning the second audio data with the first audio data according to the size of the audio data, includes:

[0090] Setting a first buffer zone and a second buffer zone;

[0091] caching the first audio data in the first buffer;

[0092] Filling the second buffer with invalid data having a size equal to that of the audio data;

[0093] The second audio data is cached in the second buffer after the invalid data is filled in, so that the second audio data is aligned with the first audio data.

[0094] The first buffer and the second buffer may be storage spaces pre-set or temporarily set on a storage medium for storing data. The first buffer and the second buffer may be two independent storage spaces with completely identical storage space, storage format, and storage method.

[0095] The audio data may be cached in the buffer in sequence, that is, the audio data cached in the buffer still maintains the original sequence.

[0096] The second buffer may be filled with invalid data having a size equal to that of the audio data by sequentially filling the invalid data having a size equal to that of the audio data starting from the start position of the second buffer.

[0097] In order to enable those skilled in the art to better understand the technical solutions of the embodiments of the present invention, the following Figure 3a and Figure 4a The alignment of the second audio data with the first audio data is introduced in detail.

[0098] In one example, the Android AudioHAL (Audio Hardware Abstraction Layer) can be used to obtain the first audio data and the second audio data from the system and perform data alignment. Specifically, two sufficiently large and identical buffers can be allocated in the AudioHAL: a MIC data buffer (first buffer) for storing the MIC data (first audio data) and a reference audio data buffer (second buffer) for storing the reference audio data (second audio data).

[0099] Reference Figure 3a , shows a schematic diagram of a case where MIC data and reference sound data are not aligned with each other according to the present invention, as shown in FIG. Figure 3a As shown, due to the microphone's delay, valid data cannot be collected during the delay. Based on the above method of calculating the size of the audio data collected by the microphone during the delay, assuming the calculated audio data size is 1152 bytes, when the MIC data is cached in the MIC data buffer, the first 1152 bytes in the MIC data buffer are invalid data, and only after 1152 bytes are valid data. However, there is almost no delay when obtaining the reference sound data, so when the reference sound data is cached in the reference sound data buffer, the reference sound buffer contains valid data. At this point, the MIC data and the reference sound data are not aligned.

[0100] Reference Figure 4a , showing a schematic diagram of the present invention after MIC data and reference sound data are aligned,

[0101] Similarly, the MIC data collected by the microphone is cached in the MIC data buffer. At this time, the first 1152 bytes in the MIC data buffer are invalid data, and valid data is obtained after 1152 bytes. Before caching the reference sound data in the reference sound data buffer, first fill the reference sound buffer with invalid data equal to the size of the audio data calculated above, that is, first fill the reference sound buffer with 1152 bytes of invalid data; then, cache the reference sound data in the reference sound data buffer. Figure 4aAs shown, the first 1152 bytes in the MIC data buffer and the reference audio data buffer are invalid data, and valid data is obtained after 1152 bytes, thereby achieving the effect of aligning the reference audio data with the MIC data.

[0102] In the above exemplary embodiment, the second audio data is aligned with the first audio data in the buffer by caching the first audio data in the first buffer, filling the second buffer with invalid data of the same size as the audio data collected within the microphone delay time, and then caching the second audio data in the second buffer.

[0103] In an exemplary embodiment, step 105, performing echo cancellation processing on the first audio data using the aligned second audio data as reference audio data, includes:

[0104] Simultaneously, obtaining the first audio data and the second audio data from the first buffer and the second buffer respectively;

[0105] The aligned second audio data is used as reference audio data to perform echo cancellation processing on the first audio data.

[0106] After aligning the second audio data with the first audio data in the above example, the first audio data and the second audio data can be obtained from the first buffer and the second buffer respectively and transmitted to the SOC to perform echo cancellation processing using the ECNR algorithm. Specifically, the aligned second audio data can be used as the reference audio data to perform echo cancellation processing on the first audio data.

[0107] In order to enable those skilled in the art to better understand the technical solutions of the embodiments of the present invention, the following Figure 3b and Figure 4b The echo cancellation processing performed after the second audio data is aligned with the first audio data is introduced in detail.

[0108] Reference Figure 3b , shows a schematic diagram of echo cancellation of unaligned audio data of the present invention, as shown in Figure 3b As shown in the figure, the first 1152 bytes of the MIC data buffer are invalid data, while the reference audio data buffer contains valid data. The MIC data and the reference audio data are not aligned. In this case, if the MIC data and the reference audio data are obtained from the MIC data buffer and the reference audio data buffer respectively and transmitted to the SOC for echo cancellation using the ECNR algorithm, the echo cancellation effect will be affected.

[0109] Reference Figure 4b , shows a schematic diagram of echo cancellation of aligned audio data according to the present invention, as shown in FIG. Figure 4bAs shown, the first 1152 bytes of the MIC data buffer and the reference audio data buffer are all invalid data, which means that the MIC data and reference audio data are aligned in the buffers. Therefore, the MIC data and reference audio data can be obtained from the MIC data buffer and the reference audio data buffer respectively at the same time and transmitted to the SOC for echo cancellation using the ECNR algorithm.

[0110] In the above exemplary embodiment, the first audio data and the second audio data can be obtained from the first buffer and the second buffer respectively and transmitted to the ECNR algorithm of the SOC at the same time, and the aligned second audio data is used as the reference audio data to perform echo cancellation processing on the first audio data to improve the effect of echo cancellation.

[0111] It should be noted that for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0112] Reference Figure 5 , shows a structural block diagram of an audio data processing device of the present invention, which may specifically include the following modules:

[0113] A first audio data acquisition module 501 is configured to acquire first audio data collected by a microphone having a delay time; the first audio data includes echo data of the background audio played inside the terminal after being diffused by the speaker;

[0114] The second audio data acquisition module 502 is used to acquire second audio data; the second audio data is the original data of the background audio played inside the terminal device;

[0115] The audio data size acquisition module 503 is used to acquire the size of the audio data collected by the microphone within the delay time;

[0116] an audio data alignment module 504, configured to align the second audio data with the first audio data according to the size of the audio data;

[0117] The echo cancellation processing module 505 is configured to perform echo cancellation processing on the first audio data by using the aligned second audio data as reference audio data.

[0118] In an exemplary embodiment, the audio data size acquisition module 503 is configured to acquire specification parameters of the microphone; and calculate the size of the audio data collected by the microphone within the delay time according to the specification parameters.

[0119] In an exemplary embodiment, the specification parameters include sampling rate, sampling depth, and number of acquisition channels.

[0120] In an exemplary embodiment, the audio data alignment module 504 is used to set a first buffer and a second buffer; cache the first audio data in the first buffer; fill the second buffer with invalid data equal to the size of the audio data; and cache the second audio data in the second buffer after filling the invalid data, so that the second audio data is aligned with the first audio data.

[0121] In an exemplary embodiment, the echo cancellation processing module 505 is used to simultaneously obtain the first audio data and the second audio data from the first buffer and the second buffer, respectively; and perform echo cancellation processing on the first audio data using the aligned second audio data as reference audio data.

[0122] In an exemplary embodiment, the device is applied to a vehicle system.

[0123] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0124] An embodiment of the present invention discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the steps described in the above embodiment of the audio data processing method are implemented.

[0125] An embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps described in the above embodiment of the audio data processing method are implemented.

[0126] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0127] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatus, or computer program products. Thus, embodiments of the present invention may take the form of a fully hardware embodiment, a fully software embodiment, or an embodiment combining software and hardware. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0128] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the process in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0129] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0130] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0131] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0132] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.

[0133] The above is a detailed introduction to an audio data processing method, an audio data processing device, an electronic device and a storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.

Claims

1. A method for processing audio data, characterized in that: The method comprises: Acquiring first audio data collected by a microphone, wherein the microphone has a delay time; the first audio data includes echo data of the background audio generated after the background audio played inside the terminal is diffused by the speaker; Acquire second audio data; the second audio data is the original data of the background audio played inside the terminal; Obtaining the size of the audio data collected by the microphone during the delay time, comprising: obtaining specification parameters of the microphone; and calculating the size of the audio data collected by the microphone during the delay time according to the specification parameters; Aligning the second audio data with the first audio data according to the size of the audio data, including: setting a first buffer and a second buffer; caching the first audio data in the first buffer; filling the second buffer with invalid data equal to the size of the audio data; and caching the second audio data in the second buffer after filling with the invalid data, so that the second audio data is aligned with the first audio data; The aligned second audio data is used as reference audio data to perform echo cancellation processing on the first audio data.

2. The method according to claim 1, characterized in that The specifications include sampling rate, sampling depth and number of acquisition channels.

3. The method according to claim 1, characterized in that The step of performing echo cancellation processing on the first audio data by using the aligned second audio data as reference audio data includes: Simultaneously, obtaining the first audio data and the second audio data from the first buffer and the second buffer respectively; The aligned second audio data is used as reference audio data to perform echo cancellation processing on the first audio data.

4. The method according to claim 1, wherein The method is applied to a vehicle computer system.

5. An audio data processing device, characterized in that: The device comprises: A first audio data acquisition module is configured to acquire first audio data collected by a microphone having a delay time; the first audio data includes echo data of the background audio played inside the terminal after being diffused by the speaker; A second audio data acquisition module is used to acquire second audio data; the second audio data is the original data of the background audio played inside the terminal; An audio data size acquisition module is used to acquire the size of the audio data collected by the microphone during the delay time, including: acquiring specification parameters of the microphone; and calculating the size of the audio data collected by the microphone during the delay time according to the specification parameters; an audio data alignment module, configured to align the second audio data with the first audio data according to the size of the audio data, comprising: setting a first buffer and a second buffer; caching the first audio data in the first buffer; filling the second buffer with invalid data of the same size as the audio data; and caching the second audio data in the second buffer after filling with the invalid data, so that the second audio data is aligned with the first audio data; The echo cancellation processing module is configured to perform echo cancellation processing on the first audio data by using the aligned second audio data as reference audio data.

6. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the audio data processing method according to any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the audio data processing method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Echo cancellation method, device, equipment and storage medium

    CN109979479A

  • Echo cancellation method, electronic equipment and storage device

    CN110992923A

  • Echo cancellation method and device

    CN113689871A