An echo cancellation method and system based on far-end audio processing
By using remote audio processing methods to align audio data with markers and timestamps and eliminate echoes based on reference sources, the problem of echo inconsistency caused by network latency is solved, achieving high-quality audio processing effects and user experience.
Patent Information
- Application Number
- CN202310936622.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-07-28
AI Technical Summary
Due to the miniaturization and cost constraints of audio devices, network latency, network fluctuations, and packet loss cause inconsistent tail delays in echoes between different audio devices, affecting audio processing performance and user experience.
By using remote audio processing, audio data is cached and re-marked using tags and timestamps, and echo cancellation is performed based on the reference source, thus achieving audio data alignment and echo cancellation.
It eliminates the inconsistency in the tail delay caused by echoes between different audio devices, unifies audio processing effects, improves user experience, reduces dependence on audio devices, and has strong compatibility, wide adaptability, and strong scalability.
Smart Images

Figure CN117156054B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of audio processing technology, and more specifically to an echo cancellation method and system based on remote audio processing. Background Technology
[0002] With the miniaturization of audio devices and limitations such as cost, some audio processing functions are now implemented on the server side. When audio processing is performed on the server side, network latency, fluctuations, and packet loss frequently occur, causing inconsistent echo delays between different audio devices communicating on the server side. This results in data alignment discrepancies, leading to poor audio processing quality and negatively impacting user experience. Summary of the Invention
[0003] In order to overcome the shortcomings of the prior art, the purpose of this invention is to provide an echo cancellation method and system based on remote audio processing. It can eliminate the inconsistency of tail delay caused by network reasons in the echo between different audio devices through remote audio processing, and realize audio effect processing in scenarios such as intercom, multi-party calls, and conferences.
[0004] To address the aforementioned problems, a first aspect of this invention discloses an echo cancellation method based on remote audio processing, used to achieve audio communication between at least one first terminal and at least one second terminal; it includes the following steps:
[0005] The system receives first audio data collected and sent by a first terminal. When the first terminal sends the first audio data, it carries a first tag assigned to the first audio data.
[0006] The first audio data is cached, and the second tag is reassigned to the first audio data;
[0007] The second tag and the first audio data are sent to the second terminal so that the second terminal can play the first audio data.
[0008] The second terminal receives the second audio data collected and sent by the second terminal. When the second terminal sends the second audio data, it carries a third tag assigned to the second audio data. If the second terminal plays the first audio data as a sound source, when the second terminal sends the second audio data, it also carries the second tag corresponding to the first audio data.
[0009] Based on the second tag carried when the second terminal sends the second audio data, the target first audio data corresponding to the second tag is determined. The target first audio data is used as the reference source for echo processing. Based on the second audio data and the reference source, echo cancellation is performed on the second audio data to form the third audio data.
[0010] The third audio data is cached, a fourth tag is reassigned to the third audio data, and the fourth tag and the third audio data are sent to the first terminal so that the first terminal can play the third audio data.
[0011] As a preferred embodiment, in the first aspect of the present invention, before receiving the first audio data collected and transmitted by the first terminal, the method further includes:
[0012] The time of the first terminal and the second terminal is calibrated by NTP time synchronization.
[0013] As a preferred embodiment, in the first aspect of the present invention, the naming rule for the first marker is: Xi(j), where Xi represents the i-th first terminal and Xi(j) represents the j-th first audio data sent by the i-th first terminal;
[0014] The naming rule for the second tag is: Z Xi (j), where Z Xi Z represents the i-th first terminal. Xi (j) represents renaming the j-th first audio data sent by the i-th first terminal;
[0015] The naming rule for the third marker is: Yi(j), where Yi represents the i-th second terminal and Yi(j) represents the j-th second audio data sent by the i-th second terminal;
[0016] The naming rule for the fourth marker is: Z Yi (j), where Z Yi Z represents the i-th second terminal. Xi (j) represents naming the j-th third audio data.
[0017] In a preferred embodiment, in the first aspect of the present invention, based on the second audio data and the reference source, echo cancellation is performed on the second audio data to form third audio data, and then the method further includes:
[0018] Remove the reference source from the cache queue.
[0019] In a preferred embodiment, in the first aspect of the present invention, the method further includes:
[0020] When the first terminal sends the first audio data, it also carries a sending timestamp t1;
[0021] When the second marker and the first audio data are sent to the second terminal, a sending timestamp t2 is also included.
[0022] Record the playback time t3 of the second terminal playing the first audio data and the acquisition time t4 of the second terminal collecting the second audio data;
[0023] When the second terminal sends the second audio data, it also carries a sending timestamp t5;
[0024] Record the timestamp t6 for receiving the second audio data;
[0025] The delay time is determined based on the received timestamp t6 and the sent timestamp t2, so that the second audio data is not put into the buffer queue when the delay time is greater than a preset threshold.
[0026] As a preferred embodiment, in the first aspect of the present invention, if the second terminal plays the first audio data, when the second terminal sends the second audio data, it also carries a second tag corresponding to the first audio data, including:
[0027] The second audio data, transmitted at preset intervals, carries a second marker corresponding to the first audio data.
[0028] A second aspect of this invention discloses an echo cancellation device based on remote audio processing, comprising:
[0029] The first receiving unit is configured to receive first audio data collected and sent by the first terminal, wherein when the first terminal sends the first audio data, it carries a first tag assigned to the first audio data;
[0030] A caching unit is used to cache the first audio data and reassign the second tag to the first audio data;
[0031] The first sending unit is configured to send the second tag and the first audio data to the second terminal, so that the second terminal plays the first audio data as a sound source.
[0032] The second receiving unit is used to receive the second audio data collected and sent by the second terminal. When the second terminal sends the second audio data, it carries a third tag assigned to the second audio data. If the second terminal plays the first audio data, it also carries the second tag corresponding to the first audio data when sending the second audio data.
[0033] An echo cancellation unit is used to determine the target first audio data corresponding to the second marker based on the second marker carried when the second terminal sends the second audio data, use the target first audio data as a reference source for echo processing, and perform echo cancellation on the second audio data based on the second audio data and the reference source to form third audio data;
[0034] The second sending unit is used to buffer the third audio data, reassign a fourth tag to the third audio data, and send the fourth tag and the third audio data to the first terminal so that the first terminal can play the third audio data.
[0035] A third aspect of the present invention discloses an electronic device, comprising: a memory storing executable program code; a processor coupled to the memory; the processor calling the executable program code stored in the memory to execute an echo cancellation method based on remote audio processing disclosed in the first aspect of the present invention.
[0036] A fourth aspect of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute an echo cancellation method based on remote audio processing disclosed in the first aspect of the present invention.
[0037] The fifth aspect of this invention discloses a computer program product that, when run on a computer, causes the computer to execute an echo cancellation method based on remote audio processing disclosed in the first aspect of this invention.
[0038] The sixth aspect of this invention discloses an application publishing platform for publishing computer program products. When the computer program product is run on a computer, the computer executes an echo cancellation method based on remote audio processing disclosed in the first aspect of this invention.
[0039] A seventh aspect of this invention discloses an echo cancellation system based on remote audio processing, comprising at least one first terminal, at least one second terminal, and a server; wherein:
[0040] The first terminal collects and sends the first audio data to the server. When the first terminal sends the first audio data, it carries a first tag assigned to the first audio data.
[0041] The server caches the first audio data and reassigns the second tag to the first audio data;
[0042] The server sends the second tag and the first audio data to the second terminal, so that the second terminal plays the first audio data as a sound source.
[0043] The second terminal collects and sends the second audio data to the server. When the second terminal sends the second audio data, it carries a third tag assigned to the second audio data. If the second terminal plays the first audio data, it also carries the second tag corresponding to the first audio data when sending the second audio data.
[0044] The server determines the target first audio data corresponding to the second tag based on the second tag carried when the second terminal sends the second audio data, uses the target first audio data as a reference source for echo processing, and performs echo cancellation on the second audio data based on the second audio data and the reference source to form third audio data;
[0045] The server caches the third audio data, reassigns a fourth tag to the third audio data, and sends the fourth tag and the third audio data to the first terminal so that the first terminal can play the third audio data.
[0046] The embodiments of this invention aim to optimize and implement sound effects in real-world scenarios, providing high-quality audio experiences for industries such as education, smart streetlights, prisons, transportation, banking, tourist attractions, and enterprises. Compared with existing technologies, its beneficial effects are as follows:
[0047] 1. The reference source is determined through a remote server, and the audio data containing the echo of the reference source is processed using echo cancellation technology to eliminate the inconsistency of the tail delay caused by the echo between different audio devices. Each audio device itself does not need to have audio processing function, which greatly reduces the capital investment for enterprises or individuals who produce and use audio equipment.
[0048] 2. Unified audio processing effects, maintaining consistent audio quality across various devices and improving user experience.
[0049] 3. It reduces the dependence of audio processing on audio devices, which only need to have audio sending and receiving functions.
[0050] 4. High compatibility; only minor, resource-efficient modifications are required on the audio device side.
[0051] 5. Highly scalable, based on a remote audio processing framework, allowing for easy expansion with various practical audio algorithms.
[0052] 6. It can also perform echo cancellation in scenarios with inconsistent network latency, thus expanding its applicability. Attached Figure Description
[0053] Figure 1 This is a flowchart illustrating an echo cancellation method based on remote audio processing disclosed in an embodiment of the present invention. Figure 1 ;
[0054] Figure 2 This is a flowchart illustrating an echo cancellation method based on remote audio processing disclosed in an embodiment of the present invention. Figure 2 ;
[0055] Figure 3 This is a schematic diagram of the RTP header format;
[0056] Figure 4 This is a diagram illustrating the RTP extension header format;
[0057] Figure 5 This is a schematic diagram illustrating the principle of alignment and echo cancellation disclosed in an embodiment of the present invention;
[0058] Figure 6 This is a schematic diagram of the structure of an echo cancellation device based on remote audio processing disclosed in an embodiment of the present invention;
[0059] Figure 7 This is a schematic diagram of the structure of an echo cancellation system based on remote audio processing disclosed in an embodiment of the present invention;
[0060] Figure 8 This is a schematic diagram illustrating the composition principle of the server disclosed in an embodiment of the present invention;
[0061] Figure 9 This is a schematic diagram illustrating the principle of time synchronization disclosed in an embodiment of the present invention;
[0062] Figure 10 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. Detailed Implementation
[0063] This specific embodiment is merely an explanation of the present invention and is not intended to limit the present invention. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but as long as they are within the scope of the claims of the present invention, they are protected by patent law.
[0064] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0065] The term "comprising" and any variations thereof in the specification and claims of this application are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product or device.
[0066] In embodiments of the present invention, the terms "exemplarily" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplarily" or "for example" in embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the terms "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0067] In this embodiment of the invention, after the audio device and the server establish a session channel, the server's audio processing framework performs data marking on the audio packets before remotely and centrally processing multiple audio files using audio algorithms such as AEC, AGC, and NC. Furthermore, it performs alignment processing before echo cancellation to ensure the audio application effect in real-world scenarios. The following is a detailed description in conjunction with the accompanying drawings.
[0068] Example 1
[0069] Please see Figure 1 and Figure 2 , Figure 1 and Figure 2 This is a flowchart illustrating an echo cancellation method based on remote audio processing disclosed in an embodiment of the present invention. This method is mainly applied to audio communication between two or more audio devices, including but not limited to two-way calls, multi-way calls, and conferences. The executing entity of this method is an electronic device with data receiving, sending, and processing functions, primarily implemented using a remote server. The remote server can be a cloud server or a physical server located remotely that can communicate with the first and second terminals; here, the remote server is collectively referred to as a server.
[0070] The first and second terminals are audio devices with basic audio functions, including audio acquisition and transmission. With the assistance of external or internal speakers, they can also play audio. It is understood that the designation "first terminal" and "second terminal" is merely to distinguish different audio devices; under certain conditions, they can have the same functions and their roles can be interchangeable.
[0071] For example, the first terminal A can send voice data to all the second terminals, or to other first terminals, or even to the first terminal A itself. Therefore, in this case, all terminals that can receive voice data sent by the first terminal A are considered as second terminals, and similarly, all terminals that receive voice data sent by the second terminals are also considered as first terminals.
[0072] like Figure 1 and Figure 2 As shown, the echo cancellation method based on remote audio processing includes the following steps:
[0073] S110. Receive the first audio data collected and sent by the first terminal. When the first terminal sends the first audio data, it carries a first tag assigned to the first audio data.
[0074] Before the first and second terminals engage in audio communication, the executing entity, i.e., the server, performs time calibration on all first and second terminals forming an audio communication group to ensure they are synchronized with the server's time. Alternatively, in other embodiments, the server may perform time calibration on all associated audio devices periodically or intermittently.
[0075] The server calibrates the time of the first and second terminals by sending time synchronization commands via the NTP protocol, thus ensuring that the time of the first and second terminals is consistent with the server's. The purpose of setting up time synchronization is to allow the server to accurately calculate the latency between each audio device and the server, as well as network jitter, and to adjust the buffer size in real time, making echo cancellation alignment easier.
[0076] After the first terminal receives the collected audio from the audio source, it is recorded as the first audio data. This first audio data is an audio packet, and the first terminal sends the first audio data to the server.
[0077] When the first terminal sends the first audio data to the server, it also carries the first tag. The naming rule for the first tag is Xi(j), where Xi represents the i-th first terminal and Xi(j) represents the j-th first audio data sent by the i-th first terminal to the server. Assuming that the first terminal initiates audio communication first, the first tag is X1(1).
[0078] Audio communication between audio devices and servers can be achieved via the RTP protocol. Therefore, if it is necessary to add a first marker to the first audio data, according to the RFC1889 standard protocol, the X position is set to 1 in the RTP header to add an extension header.
[0079] Figure 3 The RTP header format is shown below; please refer to it. Figure 3 As shown, the first 12 bytes are present in every RTP header, while the CSRC field is only generated when a MIXER is inserted.
[0080] Version(V): 2 bits, representing the RTP version number;
[0081] padding(P): 1 bit, when set to 1, indicates that there is a non-data padding field at the end. The last byte of all padding fields is the length of the padding field. Padding fields are often used in situations requiring encryption.
[0082] extension(X): 1 bit. If this bit is set to 1, there will be an extended field after the standard header field. Therefore, the value of X can be set to 1 to extend the RTP header.
[0083] CSRC count(CC): 4 bits, representing the number of items in the CSRC list.
[0084] marker(M): 1 bit, defined by the configuration file and used for a specific application.
[0085] Payload type (PT): 7 bits, which is the data type number of the payload. The specific format is defined in the PAYLOADFORMAT SPECIFICATION file.
[0086] Sequence number: 16 bits. This item is incremented by 1 for each RTP packet sent. Its initial value is randomly generated to prevent others from deciphering the encryption.
[0087] Timestamp: 32 bits. This item is used for time synchronization calculations and jitter control, and its accuracy must be sufficient to meet both requirements. The clock frequency is related to the load type, and both are defined in the PAYLOAD FORMAT SPECIFICATION file, with initial values that are random.
[0088] SSRC: 32 bits, which is the Synchronization Source Identifier, i.e., the sender of this RTP packet. Because there cannot be two identical SSRCs in an RTP session, this value needs to be regenerated when the sender's transport address changes to prevent a cycle.
[0089] An extension to the RTP header for audio data tagging; please refer to [link / reference]. Figure 4 As shown, the profile value is set to 0x10, the length is set to 3, and the length is 3*4=12 bytes. The header extension is as follows:
[0090] +2 bytes: Send audio packet marker value X(n);
[0091] +2 bytes: Reference audio packet marker value Y(n);
[0092] +8 bytes: Audio terminal time (milliseconds) when the audio packet is sent;
[0093] Total 12 bytes. The audio packet is marked as a 2-byte unsigned short integer, which increments sequentially with each use.
[0094] When the first terminal server sends the first audio data, it also carries the time when the first terminal sends the audio packet, which is recorded as the sending timestamp t1.
[0095] S120. Cache the first audio data and reassign the second tag to the first audio data.
[0096] The server has a set length for the cache queue as needed. When the current length of the cache queue is less than the set length, the first audio data is put into the cache queue and a second tag is assigned to the first audio data. That is, the audio data corresponding to the second tag and the first tag are the same data, only the tags are different. The second tag will be stored in the server, and the first audio data in the server's cache queue can be identified through the second tag.
[0097] The naming rule for the second tag is: Z Xi (j), where Z Xi Z represents the i-th first terminal. Xi (j) represents renaming the j-th first audio data sent by the i-th first terminal.
[0098] S130. The second tag and the first audio data are sent to the second terminal so that the second terminal can play the first audio data.
[0099] The server sends the first audio data and the re-tagged second tag to the second terminal, along with the time when the server sent the first audio data, denoted as the sending timestamp t2. After receiving the first audio data, the second terminal can output and play the audio.
[0100] S140. Receive the second audio data collected and sent by the second terminal. When the second terminal sends the second audio data, it carries a third tag assigned to the second audio data. If the second terminal plays the first audio data as a sound source, it also carries the second tag corresponding to the first audio data when sending the second audio data.
[0101] If the second terminal outputs and plays audio data, that is, whenever the first audio data is played, the second terminal will send the second audio data to the server at a preset interval T. The RTP information of the second audio data will carry the second tag corresponding to the first audio data.
[0102] The preset interval time can be set as needed. Because the time interval between the second terminal playing the first audio data and the audio acquisition is relatively stable, it can be set to t(interval). It can be dynamically adjusted according to the environment. The second terminal can calculate the acquired audio packet based on the time t4-t3=t(interval) to determine the audio data put into the speaker before time t(interval). The second terminal retrieves the audio packet marker for the time period t3 from the audio packet playback queue cached by the second terminal. The second marker is the second marker sent by the server when sending the audio packet. The second marker is added to the data attached to the second audio data as the reference audio packet marker for the server.
[0103] The second terminal can set up a playback copy cache queue to store a second tag and the current playback time. The data it sends to the server depends on whether there is data in the copy cache queue and whether the current playback time plus the preset interval time is approximately equal to the current release time. If there is data and the two are approximately equal, the second tag is carried in the second data sent.
[0104] If the second terminal does not play the first audio data, or plays the first audio data in silence, it may not carry the second tag when sending the second audio data to the server. The second terminal can determine whether it is playing the first audio data and whether it is playing the first audio data in silence by detecting the output of the speaker.
[0105] In addition to the second marker, the second terminal also carries a third marker when sending the second audio data, as well as the sending time, denoted as the sending timestamp t5. When the server receives the second audio data sent by the second terminal, it records the receiving time, denoted as the receiving data stamp t6.
[0106] The naming rule for the third marker can be Yi(j), where Yi represents the i-th second terminal and Yi(j) represents the j-th second audio data sent by the i-th second terminal.
[0107] The j value in the first, second, and third flags mentioned above can be gradually increased according to the number of transmissions, and its maximum value can be 65535. When the j value reaches 65535, it is reset to 0 and starts again.
[0108] S150: Based on the second tag carried when the second terminal sends the second audio data, determine the target first audio data corresponding to the second tag, use the target first audio data as the reference source for echo processing, and perform echo cancellation on the second audio data based on the second audio data and the reference source to form the third audio data.
[0109] The server receives the second audio data sent from the second terminal. Taking t6-t2=t(diff), we can know the delay time from when the server sends the first audio data to the device for playback and when the server receives the second audio data. Due to network latency, packet loss, out-of-order issues, multiple first audio data can be reordered according to the second marker to reduce the impact of blank audio packets or no-echo audio packets on echo processing.
[0110] The sorting method is as follows: sort the items in the cache queue according to the j value in the second tag from smallest to largest (Z). Xi (j) is a value from 0 to 65535. The terminal increments the flag by 1 for each audio packet it sends, and restarts from 0 if the value exceeds 65535. The buffer queue is set to a length of 200 (i.e., a set length that can be adjusted as needed); when the second flag Z... Xi (j) When the value is less than 200, and the maximum flag value in the cache queue is greater than 65335 but less than 65535, this indicates that the flag was recently reset to its initial value of 0, and Z should be... Xi Sort by (j)+65535.
[0111] If t(diff) is too large and exceeds the preset threshold (for example, the preset threshold can be the baseline threshold * the set length of the cache queue, such as 20ms * 200 = 4s), it will not be put into the cache queue for audio processing, but it will enter the cache queue for sorting. The server can dynamically adjust the set length of the cache queue according to the latency time. For example, when the latency time is too large, the value of the set length of the cache queue can be increased, so that the audio data that enters the cache queue at the beginning of the sorting can enter the cache queue.
[0112] In some other embodiments, the server deletes some processed audio data (which may be from the reference source or audio data with echo) from the cache queue. In this case, audio data that is ranked high in the cache queue can also enter the cache queue.
[0113] After receiving the second audio data sent by the second terminal, the server can determine the corresponding first audio data located in the server's cache queue based on the second tag, and refer to the first audio data as the reference source.
[0114] Based on the reference source and the second audio data with the reference source as the echo, echo cancellation can be performed on the second audio data. The process is as follows: first, the reference source and the second audio data are aligned, and then the aligned reference source and the second audio data are echo cancelled using the AEC algorithm. The second audio data after echo cancellation is recorded as the third audio data. The third audio data is cached, and the aforementioned reference source is deleted from the cache queue.
[0115] S160: Cache the third audio data, reassign the fourth tag to the third audio data, and send the fourth tag and the third audio data to the first terminal so that the first terminal can play the third audio data as a source.
[0116] Similar to step S120, a fourth tag is assigned to the third audio data. The naming rule for this fourth tag is: Z Yi (j), where Z Yi Z represents the i-th second terminal. Xi (j) represents naming the j-th third audio data.
[0117] The server sends the third audio data, the fourth tag, and the time when it sends the third audio data to the first terminal (denoted as the sending timestamp t7).
[0118] Subsequently, when the first terminal plays the third audio data, it will also cause echo interference to its fourth audio data during audio acquisition. Therefore, when sending the fourth audio data to the server, a method similar to step S140 is used, that is, the fourth tag is also sent to the server. The server determines the reference source based on the fourth tag, and uses the reference source to cancel the echo of the fourth audio data. Then, the echo-cancelled fourth audio data is re-tagged and sent to the second terminal. This cycle is repeated so that there is no echo during the entire audio communication process. This can solve the problems of large echo, high noise, and uneven volume that occur in server-side audio processing scenarios due to network latency fluctuations and inconsistent device echo intervals.
[0119] In some other embodiments, the server can also use additional algorithms (such as RTX retransmission for lost data, FEC forward error correction, automatic bandwidth detection, etc.) to ensure high-quality transmission of the reference source and second audio data under different network environments, thereby guaranteeing audio quality and echo cancellation effect. This can be applied in different network environments (such as packet loss, latency, jitter, etc.) and can also solve the problem that after a period of silence, sudden speaking can cause echoes that cannot be canceled for the initial period.
[0120] Figure 5 The diagram illustrates the principle of aligning audio packets and processing echoes. Figure 5 It can be seen that:
[0121] 1. The server retrieves the audio data packets sent by the terminal (first terminal or second terminal) from the cache queue and determines the reference audio packet marker (i.e., similar to the second marker mentioned above) from the audio data packet. If the reference audio packet marker is not carried, the server forwards it directly to the peer device.
[0122] 2. When the terminal sends a data packet containing a reference audio packet marker, the marker value is compared with the reference audio packet marker in the server's reference signal buffer queue. Packets with matching markers are sent to the audio processing module, where relevant echo signals are eliminated based on spectrum analysis. The processed audio packet is then forwarded to the peer device.
[0123] Example 2
[0124] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an echo cancellation device based on remote audio processing disclosed in an embodiment of the present invention. Figure 6 As shown, the echo cancellation device based on remote audio processing may include:
[0125] The first receiving unit 210 is used to receive first audio data collected and sent by the first terminal. When the first terminal sends the first audio data, it carries a first tag assigned to the first audio data.
[0126] The caching unit 220 is used to cache the first audio data and reassign the second tag to the first audio data;
[0127] The first sending unit 230 is used to send the second tag and the first audio data to the second terminal, so that the second terminal plays the first audio data as a sound source.
[0128] The second receiving unit 240 is used to receive the second audio data collected and sent by the second terminal. When the second terminal sends the second audio data, it carries a third tag assigned to the second audio data. If the second terminal plays the first audio data, it also carries the second tag corresponding to the first audio data when sending the second audio data.
[0129] The echo cancellation unit 250 is used to determine the target first audio data corresponding to the second tag based on the second tag carried when the second terminal sends the second audio data, use the target first audio data as a reference source for echo processing, and perform echo cancellation on the second audio data based on the second audio data and the reference source to form third audio data;
[0130] The second sending unit 260 is used to buffer the third audio data, reassign a fourth tag to the third audio data, and send the fourth tag and the third audio data to the first terminal so that the first terminal can play the third audio data.
[0131] Preferably, before the first receiving unit 210, a synchronization unit may be included for calibrating the time of the first terminal and the second terminal through NTP time synchronization.
[0132] Preferably, the naming rule for the first tag is: Xi(j), where Xi represents the i-th first terminal, and Xi(j) represents the j-th first audio data sent by the i-th first terminal; the naming rule for the second tag is: Z Xi (j), where Z Xi Z represents the i-th first terminal. Xi (j) represents renaming the j-th first audio data sent by the i-th first terminal; the naming rule for the third marker is: Yi(j), where Yi represents the i-th second terminal, and Yi(j) represents the j-th second audio data sent by the i-th second terminal; the naming rule for the fourth marker is: Z Yi (j), where Z Yi Z represents the i-th second terminal. Xi (j) represents naming the j-th third audio data.
[0133] Preferably, the echo cancellation unit 250 further includes a deletion unit for deleting the reference source from the cache queue.
[0134] Preferably, the device further includes a time recording unit, used to carry a transmission timestamp t1 when the first terminal sends the first audio data; to carry a transmission timestamp t2 when the second marker and the first audio data are sent to the second terminal; to record the playback time t3 when the second terminal plays the first audio data and the acquisition time t4 when the second terminal acquires the second audio data; to carry a transmission timestamp t5 when the second terminal sends the second audio data; and for the server to record the time it receives the second audio data, denoted as the reception timestamp t6.
[0135] The delay time can also be determined based on the received timestamp t6 and the sent timestamp t2, so that the second audio data is not put into the buffer queue when the delay time is greater than a preset threshold.
[0136] Preferably, when the second terminal plays the first audio data, the second audio data sent at a preset interval carries a second marker corresponding to the first audio data.
[0137] Example 3
[0138] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of an echo cancellation system based on remote audio processing disclosed in an embodiment of the present invention. Figure 7 As shown, the echo cancellation system based on remote audio processing may include at least one first terminal 10, at least one second terminal 30, and a server 20. The first and second terminals can collect audio data using a pickup such as a microphone and send the audio data to the server via a network, or receive audio data sent by the server via a network and play the audio data through a speaker or other means.
[0139] The first terminal collects and sends the first audio data to the server. When the first terminal sends the first audio data, it carries a first tag assigned to the first audio data.
[0140] The server caches the first audio data and reassigns the second tag to the first audio data;
[0141] The server sends the second tag and the first audio data to the second terminal, so that the second terminal plays the first audio data as a sound source.
[0142] The second terminal collects and sends the second audio data to the server. When the second terminal sends the second audio data, it carries a third tag assigned to the second audio data. If the second terminal plays the first audio data, it also carries the second tag corresponding to the first audio data when sending the second audio data.
[0143] The server determines the target first audio data corresponding to the second tag based on the second tag carried when the second terminal sends the second audio data, uses the target first audio data as a reference source for echo processing, and performs echo cancellation on the second audio data based on the second audio data and the reference source to form third audio data;
[0144] The server caches the third audio data, reassigns a fourth tag to the third audio data, and sends the fourth tag and the third audio data to the first terminal so that the first terminal can play the third audio data.
[0145] Please refer to Figure 8 As shown, server 20 can receive, send, and process audio data. Based on the server's audio processing procedure, it can be divided into a network latency processing module 21, a preset latency processing module 22, an automatic alignment module 23, and an audio processing module 24. Among them:
[0146] The network latency processing module 21 primarily determines the current real-time network latency based on the timestamp carried by the audio data and processes the position of the audio packet in the buffer based on this latency. The preset latency processing module 22 adjusts the position of the audio packet in the buffer according to the preset latency configuration for the application scenario. The automatic alignment module 23 aligns the audio packet, after eliminating network and preset latency, with the audio reference signal previously sent to the device, reducing errors during echo cancellation; this module is only enabled when performing AEC processing. The audio processing module 24 integrates algorithms such as AEC, AGC, and NC to perform remote audio data processing according to the application scenario or configuration.
[0147] The audio terminal collects audio data via microphone or other means and sends it to the server over the network. The server caches the audio packets sent by the audio terminal. The audio packets first enter the network latency processing module to eliminate network latency and correct their position in the cache queue. Then, the audio packets enter the preset latency processing module, where preset latency processing is applied to correct their position in the cache queue. Afterward, the audio packets enter the automatic alignment module, where spectrum analysis is performed between the audio packets sent by the device and those previously received by the device to correct the relative processing positions of the sent and received audio packets. Finally, the audio packets enter the audio processing module, where audio processing is performed according to the current task type and relevant configuration files. After the audio data processing is complete, the data is sent to the corresponding audio terminal via the network. Upon receiving the audio data, the audio terminal plays the audio data through a speaker or other means.
[0148] Please refer to Figure 9 As shown, when handling network latency, the server first sends a time synchronization command to all first and second terminals via the NTP protocol to ensure that the time of the first terminal, the second terminal, and the server are consistent.
[0149] Example 4
[0150] Please see Figure 10 , Figure 10A schematic diagram of an electronic device that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the embodiments of the invention described herein or claimed.
[0151] like Figure 10 As shown, the electronic device includes at least one processor 410 and a memory, such as a ROM (Read-Only Memory) 420 or a RAM (Random Access Memory) 430, communicatively connected to the at least one processor 410. The memory stores computer programs executable by the at least one processor. The processor 410 can perform various appropriate actions and processes based on the computer program stored in the ROM 420 or loaded into the RAM 430 from storage unit 480. The RAM 430 can also store various programs and data required for the operation of the electronic device. The processor 410, ROM 420, and RAM 430 are interconnected via a bus 440. An I / O (Input / Output) interface 450 is also connected to the bus 440.
[0152] Multiple components in the electronic device are connected to the I / O interface 450, including: input units 460, such as a keyboard, mouse, etc.; output units 470, such as various types of displays, speakers, etc.; storage units 480, such as disks, optical disks, etc.; and communication units 490, such as network interface cards, modems, wireless transceivers, etc. The communication unit 490 allows the electronic device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0153] Processor 410 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 410 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 410 performs one or more steps of an echo cancellation method based on remote audio processing described in any of the embodiments above.
[0154] In some embodiments, an echo cancellation method based on remote audio processing may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 480. In some embodiments, part or all of the computer program may be loaded into or / and installed on an electronic device via ROM 420 and / or communication unit 490. When the computer program is loaded into RAM 430 and executed by processor 410, one or more steps of the echo cancellation method based on remote audio processing described in Embodiment 1 above may be performed. Alternatively, in other embodiments, processor 410 may be configured to perform an echo cancellation method based on remote audio processing by any other suitable means (e.g., by means of firmware).
[0155] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0156] Computer programs for implementing the methods of embodiments of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0157] In the context of embodiments of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0158] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0159] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0160] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0161] The above provides a detailed description of an echo cancellation method and system based on remote audio processing disclosed in this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. An echo cancellation method based on remote audio processing, used to achieve audio communication between at least one first terminal and at least one second terminal; characterized in that, The method is executed by the server and includes the following steps: The server receives the first audio data collected and sent by the first terminal. When the first terminal sends the first audio data, it carries a first tag assigned to the first audio data. The server caches the first audio data and reassigns the second tag to the first audio data; The server sends the second tag and the first audio data to the second terminal, so that the second terminal can play the first audio data as a sound source. The server receives the second audio data collected and sent by the second terminal. When the second terminal sends the second audio data, it carries a third tag assigned to the second audio data. If the second terminal plays the first audio data, it also carries the second tag corresponding to the first audio data when sending the second audio data. The server determines the target first audio data corresponding to the second tag based on the second tag carried when the second terminal sends the second audio data, uses the target first audio data as a reference source for echo processing, and performs echo cancellation on the second audio data based on the second audio data and the reference source to form the third audio data; The server caches the third audio data, reassigns a fourth tag to the third audio data, and sends the fourth tag and the third audio data to the first terminal so that the first terminal can play the third audio data.
2. The echo cancellation method based on remote audio processing according to claim 1, characterized in that, Before receiving the first audio data collected and sent by the first terminal, the process also includes: The time of the first terminal and the second terminal is calibrated by NTP time synchronization.
3. The echo cancellation method based on remote audio processing according to claim 1, characterized in that, The naming rule for the first marker is: Xi(j), where Xi represents the i-th first terminal and Xi(j) represents the j-th first audio data sent by the i-th first terminal; The naming rule for the second tag is: Z Xi (j), where Z Xi Z represents the i-th first terminal. Xi (j) represents renaming the j-th first audio data sent by the i-th first terminal; The naming rule for the third marker is: Yi(j), where Yi represents the i-th second terminal and Yi(j) represents the j-th second audio data sent by the i-th second terminal; The naming rule for the fourth marker is: Z Yi (j), where Z Yi Z represents the i-th second terminal. Xi (j) represents naming the j-th third audio data.
4. The echo cancellation method based on remote audio processing according to claim 1, characterized in that, Based on the second audio data and the reference source, echo cancellation is performed on the second audio data to form third audio data. Then, the process further includes: Remove the reference source from the cache queue.
5. The echo cancellation method based on remote audio processing according to claim 1, characterized in that, The method further includes: When the first terminal sends the first audio data, it also carries a sending timestamp t1; When the second marker and the first audio data are sent to the second terminal, a sending timestamp t2 is also included. Record the playback time t3 of the second terminal playing the first audio data and the acquisition time t4 of the second terminal collecting the second audio data; When the second terminal sends the second audio data, it also carries a sending timestamp t5; Record the timestamp t6 for receiving the second audio data; The delay time is determined based on the received timestamp t6 and the sent timestamp t2, so that the second audio data is not put into the buffer queue when the delay time is greater than a preset threshold.
6. The echo cancellation method based on remote audio processing according to claim 1, characterized in that, If the second terminal plays the first audio data, when sending the second audio data, it also carries a second marker corresponding to the first audio data, including: The second audio data, transmitted at preset intervals, carries a second marker corresponding to the first audio data.
7. An echo cancellation device based on remote audio processing, characterized in that, It includes: The first receiving unit is configured to receive first audio data collected and sent by the first terminal, wherein when the first terminal sends the first audio data, it carries a first tag assigned to the first audio data; A caching unit is used to cache the first audio data and reassign the second tag to the first audio data; The first sending unit is configured to send the second tag and the first audio data to the second terminal, so that the second terminal can play the first audio data as a sound source. The second receiving unit is used to receive the second audio data collected and sent by the second terminal. When the second terminal sends the second audio data, it carries a third tag assigned to the second audio data. If the second terminal plays the first audio data, it also carries the second tag corresponding to the first audio data when sending the second audio data. An echo cancellation unit is used to determine the target first audio data corresponding to the second marker based on the second marker carried when the second terminal sends the second audio data, use the target first audio data as a reference source for echo processing, and perform echo cancellation on the second audio data based on the second audio data and the reference source to form third audio data; The second sending unit is used to buffer the third audio data, reassign a fourth tag to the third audio data, and send the fourth tag and the third audio data to the first terminal so that the first terminal can play the third audio data.
8. An electronic device, characterized in that, It includes: a memory storing executable program code; a processor coupled to the memory; the processor calling the executable program code stored in the memory to execute the echo cancellation method based on remote audio processing as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, It stores a computer program, wherein the computer program causes a computer to perform the echo cancellation method based on remote audio processing as described in any one of claims 1-6.
10. An echo cancellation system based on remote audio processing, characterized in that, It includes at least one first terminal, at least one second terminal, and a server; wherein: The first terminal collects and sends the first audio data to the server. When the first terminal sends the first audio data, it carries a first tag assigned to the first audio data. The server caches the first audio data and reassigns the second tag to the first audio data; The server sends the second tag and the first audio data to the second terminal, so that the second terminal plays the first audio data as a sound source. The second terminal collects and sends the second audio data to the server. When the second terminal sends the second audio data, it carries a third tag assigned to the second audio data. If the second terminal plays the first audio data, it also carries the second tag corresponding to the first audio data when sending the second audio data. The server determines the target first audio data corresponding to the second tag based on the second tag carried when the second terminal sends the second audio data, uses the target first audio data as a reference source for echo processing, and performs echo cancellation on the second audio data based on the second audio data and the reference source to form third audio data; The server caches the third audio data, reassigns a fourth tag to the third audio data, and sends the fourth tag and the third audio data to the first terminal so that the first terminal can play the third audio data.
Citation Information
Patent Citations
Acoustic echo cancellation system
CN103856648A
Audio data processing method, device and system
CN110473562A
