Low-delay real-time speech transcription method and system

Through a low-latency real-time speech transcription method that works collaboratively on the client and server side, the speech activity detection algorithm and error correction mechanism are used to solve the problems of high latency and data transmission instability in the existing technology, and efficient and reliable real-time speech transcription and translation are achieved.

CN119811372AActive Publication Date: 2025-04-11SICHUAN YIXUN INFORMATION TECH CO LTD

Patent Information

Application Number
CN202510295239.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-04-11
Estimated Expiration
2045-03-13

AI Technical Summary

Technical Problem

Existing speech transcription methods have problems of high latency and unstable data transmission, which cannot meet the needs of real-time interaction, especially in areas such as cross-language communication, conference record and online education.

Method used

The low-latency real-time voice transcription method is adopted to encode and compress the audio data through the client and transmit it in real time to the server, introducing error correction and packet loss and retransmission mechanisms to increase the reliability of transmission. The server uses a voice activity detection algorithm to detect voice in audio data, divide it into independent parts and add a timestamp to conduct real-time transcription.

Benefits of technology

Real-time speech transcription with low latency and high efficiency is achieved, which significantly reduces processing delays, improves user experience, and ensures audio quality and transcription accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119811372A_ABST
    Figure CN119811372A_ABST
Patent Text Reader

Abstract

The invention provides a low-delay real-time voice transcription method and system, and the method comprises the following steps: A, carrying out the coding compression of original audio data collected by a client, transmitting the obtained audio coding data to a server through a real-time transmission protocol, introducing an error correction and packet loss retransmission mechanism, and improving the transmission reliability; b, detecting voice in the audio data by a voice activity detection algorithm at the server side, dividing the audio data judged as the voice into a plurality of independent parts, and adding a time sequence identifier for each part; and C, performing real-time transcription on the segmented audio data according to a time sequence to generate corresponding text content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of speech recognition, and in particular relates to a low-delay real-time speech transcription method and a system thereof. Background Art

[0002] With the rapid development of information technology, the demand for real-time speech transcription and translation is growing, especially in the fields of cross-language communication, meeting records, online education, etc. However, existing speech processing technologies face several challenges. First, traditional speech transcription methods often rely on high-latency batch processing modes and cannot meet the needs of real-time interaction. Secondly, when processing continuous audio streams, existing technologies often cause data loss or increased latency due to network fluctuations, affecting user experience. Therefore, it is particularly important to develop a real-time speech transcription system that can achieve low latency and high efficiency.

[0003] CN117640976A provides a low-delay speech recognition method in a live broadcast environment, including the following steps: receiving audio data and preprocessing, performing preliminary processing on the unpacked audio data, audio segmentation, speech-to-text conversion, text translation, and text display. The audio segmentation step of the patent is to segment according to the time segment length set between 200ms and 500ms. Although the Hamming window and other methods are used to reduce the distortion caused by the segmentation, this method only reduces the distortion but cannot avoid it, and may segment the sentence, resulting in incomplete speech segments and affecting the transcription effect. Summary of the invention

[0004] In order to solve the delay problem of existing speech transcription methods, the present invention provides a low-delay real-time speech transcription method, which is a reliable and smooth real-time speech transcription and translation solution.

[0005] In order to achieve the purpose of the present invention, the technical solution adopted by the present invention is: A low-latency real-time speech transcription method comprises the following steps: A. Encode and compress the original audio data collected by the client, and then transmit the obtained audio encoding data to the server through the real-time transport protocol, introduce error correction and packet loss retransmission mechanism to increase the reliability of transmission; B. The server uses a voice activity detection algorithm to detect speech in the audio data, splits the audio data judged to be speech into multiple independent parts, and adds a timestamp to each part; C. The segmented audio data is transcribed in real time in chronological order to generate corresponding text content.

[0006] The step A of the present invention comprises: A1. Create an array A to store the audio to be detected for voice activity; A2. Each time, 256ms-512ms of audio data is taken from the collected audio and appended to array A. If the current accumulated audio segment duration L reaches more than 4 times the duration of the single appended audio, voice activity detection is performed, and a timestamp is added to each voice segment. The audio consists of several voice segments containing voice and silent segments without voice. The segment between two adjacent voice segments is a silent segment. A3, the difference between the duration L of the audio segment and the end time of the last voice segment is diff, If diff<1s, the audio data before the last voice segment is uploaded to the server, and the uploaded audio data in array A is deleted; If diff>=1s, all the audio segment data are uploaded to the server and array A is cleared; The Opus coding transmission bit rate of the silence segment is lower than that of the speech segment; A4. If the client has not finished the collection work, continue to execute the loop from step A2.

[0007] In step A of the present invention, based on the UDP transmission protocol, the UDP protocol data packet is encoded based on the forward error correction mechanism to obtain the encoded data block, and the encoded data block is interleaved to combat burst packet loss.

[0008] Step A of the present invention adopts key frame retransmission, and triple redundancy is implemented for the key frames of the audio during retransmission: Original frame F_t; Differential frame ΔF_t = F_t ⊕ F_{t-1}; Check frame C_t = CRC32(F_t) || (F_t >> 8); A sliding window mechanism is used with a window size of W∈[2,5] and a redundancy insertion period of T∈[10ms,50ms], satisfying:

[0009]

[0010] Where t is the serial number of the audio frame, F_t is the audio data of the current frame, and F_{t-1} is the audio data of the previous frame. CRC refers to cyclic redundancy check, ⊕ represents Galois field addition, is the packet loss rate threshold, is the weight coefficient.

[0011] In step A of the present invention, spiral check is used to detect residual errors during audio decoding: in audio data transmission, the sending end generates spiral check bytes for the data block and appends them to the end of the data block; the receiving end extracts the data block and recalculates the check bytes to detect whether there is an error; when the receiving end detects a data error through spiral check, it first attempts to locate and correct the error through a spiral check polynomial. If the spiral check cannot correct the error, the receiving end will mark the frame as a residual error and notify the sending end to transmit triple redundant information to recover the lost or damaged data.

[0012] Preferably, a spiral check polynomial is defined:

[0013]

[0014] in, :Indicates the first A value of bytes, each byte is treated as a Galois field The elements in :Position weight of the polynomial, corresponding to the position of the byte in the data stream, : A reduced polynomial defined on GF(2) used to construct a 16-dimensional spiral space; mod means modular operation; is a prime number permutation table, ⊕ represents Galois Field addition, represents Galois Field multiplication, Indicates the first j + 1 byte (the byte following the current byte), Indicates circular left shift Bit operations.

[0015] The server side of the present invention configures an array as an audio buffer, and fills the array each time an audio data block is received and placed after the previous data block; when the audio data accumulated in the buffer reaches a preset threshold, voice activity detection is performed on the audio stream to distinguish between voice segments and silent segments, and the audio stream is segmented into independent voice segments based on timestamps, and the segmented voice segments are transcribed in real time in chronological order.

[0016] Preferably, when segmenting, two adjacent voice segments of a silent segment with a duration of less than 1 second are regarded as a continuous voice segment, and the last voice segment after the audio stream is segmented is regarded as incomplete audio, and the voice segment and the subsequent audio data are temporarily retained in the buffer and merged and processed after subsequent data arrives.

[0017] A system for implementing the low-latency real-time speech transcription method of the present invention comprises: The client obtains the audio data, encodes and compresses the original audio data, and transmits it to the server in real time through the data transmission module; The server receives the audio data, detects the voice in the audio using the voice activity detection module, segments the audio data judged to be voice, and transcribes the segmented audio data in real time in chronological order.

[0018] Preferably, the server side calls the translation model or transmits it to a third-party translation software to translate the text information.

[0019] The beneficial effects of the present invention are: 1. The present invention ensures the accuracy of speech transcription and the immediacy of translation through the collaborative work of the client and the server, providing users with an efficient and reliable real-time speech processing solution, significantly reducing processing delays and improving user experience.

[0020] 2. The present invention introduces a voice activity detection (VAD) algorithm to optimize the audio data transmission protocol, uses voice detection to distinguish between voice segments and silent segments in the audio, and dynamically encodes the voice segments and silent segments to reduce the amount of data transmission. Then, by limiting the audio acquisition duration and the detection duration, the audio segment is transmitted every 256ms-512ms. The single transmission amount is small and the transmission is faster. The integrity of the voice is judged according to the duration of the last audio segment during the transmission process. While solving the problems of unstable audio data transmission and high processing delay in the prior art, the audio quality is also guaranteed.

[0021] 3. UDP protocol data packets are encoded based on the forward error correction mechanism, and the data blocks are interleaved. The improved spiral check is used to detect residual errors. The perfect error correction mechanism can detect packet loss or redundancy in time, and then implement triple redundancy for the audio key frames to request the client to retransmit or delete redundancy, thereby ensuring the stability of audio data transmission.

[0022] 4. After the present invention transmits the audio data to the server, the voice activity detection (VAD) algorithm is used to segment the audio again, where the silence begins, and the silence segments less than 1 second are considered as incomplete voice segments, which can ensure that the segmented voice segments are complete sentences, and the semantics will not be destroyed or distorted due to the segmentation of complete sentences. The accuracy and semantic integrity of the transcribed results are guaranteed, which is more friendly to the translation engine. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1The figure is a flow chart of the low-latency real-time speech transcription method of the present invention. DETAILED DESCRIPTION

[0024] In order to more clearly and in detail illustrate the technical solution of the present invention, the present invention is further described below through relevant embodiments. The following embodiments are only for specific explanation of the implementation method of the present invention, and do not limit the protection scope of the present invention.

[0025] Embodiment 1:

[0026] A low-latency real-time speech transcription method comprises the following steps: A. Encode and compress the original audio data collected by the client, and then transmit the obtained audio encoding data to the server through the real-time transport protocol, introduce error correction and packet loss retransmission mechanism to increase the reliability of transmission; B. The server uses a voice activity detection algorithm to detect speech in the audio data, splits the audio data judged to be speech into multiple independent parts, and adds a timestamp to each part; C. The segmented audio data is transcribed in real time in chronological order to generate corresponding text content.

[0027] Embodiment 2:

[0028] This embodiment is based on embodiment 1: The step A comprises: A1. Create an array A to store the audio to be detected for voice activity; A2, each time 256ms of audio data is taken from the collected audio and appended to array A. When the current accumulated audio segment duration L reaches more than 4 times the single appended audio duration, that is, 1024 s, voice activity detection is performed, and a timestamp is added to each voice segment. The audio consists of several voice segments containing voice and silent segments without voice. The segment between two adjacent voice segments is a silent segment. A3, the difference between the duration L of the audio segment and the end time of the last voice segment is diff, If diff<1s, the audio data before the last voice segment is uploaded to the server, and the uploaded audio data in array A is deleted; If diff>=1s, all the audio segment data are uploaded to the server and array A is cleared; The Opus coding transmission bit rate of the silence segment is lower than that of the speech segment; A4. If the client has not finished the collection work, continue to execute the loop from step A2.

[0029] Voice activity detection considers the last silent segment of the audio segment less than 1s as a continuous voice segment. Therefore, only when the last silent segment is greater than 1s will the entire audio segment be considered complete. The entire audio segment is uploaded to the server and array A is cleared, which is conducive to improving the integrity of the uploaded voice.

[0030] Embodiment 3:

[0031] This embodiment is based on embodiment 1: Each time, 512ms of audio data is taken from the collected audio and appended to array A.

[0032] The silence segment is transmitted by Opus encoding at a bit rate of 8Khz; the voice segment is transmitted by Opus encoding at a bit rate of 16Khz.

[0033] Embodiment 4:

[0034] This embodiment is based on embodiment 1: In the step A, based on the UDP transmission protocol, the UDP protocol data packet is encoded based on the forward error correction mechanism to obtain the encoded data block, and the encoded data block is interleaved to combat burst packet loss.

[0035] Forward Error Correction (FEC) Matrix Coding A hybrid mode of Reed-Solomon (RS) coding and XOR check is used, and the coding parameters are defined as RS(n,k), where: k = number of original packets n = k + m (m is the number of redundant packets) The generator matrix G is a Vandermonde matrix:

[0036] Among them, α_i∈GF(2^8) Galois Field elements. The encoding process is:

[0037] D is the original data matrix, and C is the set of encoded data packets.

[0038] Dynamic block interleaving: Define the interleaving depth L = 2^t (t∈[3,5]), and the data packets are arranged in the following matrix:

[0039] The packets are sent in row order during transmission and reassembled in column order at the receiving end. The relationship between the packet loss rate δ and the recovery probability P is:

[0040] Where m is the number of redundant packets.

[0041] Embodiment 5: This embodiment is based on embodiment 1: The A step described above uses key frame retransmission. Implement triple redundancy for audio keyframes during retransmission: Original frame F_t; Differential frame ΔF_t = F_t ⊕ F_{t-1}; Check frame C_t = CRC32(F_t) || (F_t >> 8); Here, || is a byte-level concatenation operation, CRC32(F_t) || (F_t >> 8) = [CRC32 checksum] + [original frame data after right shifting 8 bits].

[0042] The sliding window mechanism is adopted, the window size W=3, and the redundancy insertion period T=20ms, which satisfies:

[0043]

[0044] Where t is the serial number of the audio frame, F_t is the audio data of the current frame, F_{t-1} is the audio data of the previous frame, and each t corresponds to a 20ms audio data block. For example, t=5 represents the audio frames from 100ms to 120ms. W∈[2,5] can be adjusted as needed, and the redundancy insertion period T∈[10ms,50ms].

[0045] CRC refers to cyclic redundancy check, ⊕ represents Galois field addition, is the packet loss rate threshold, is the weight coefficient, the empirical value is [0.5, 0.3, 0.2].

[0046] Triple redundancy is implemented in the following situations: 1. When the server requests the client to retransmit; 2. The client detects that the weighted packet loss rate exceeds the threshold, and monitors the historical packet loss rate through the sliding window (reference formula). When the weighted packet loss rate exceeds the threshold When , redundancy insertion is performed on the current frame and unconfirmed frames in the window.

[0047] The traditional triple redundancy formula only determines whether to trigger redundancy insertion based on the packet loss rate at the current moment, which is too simple. The present invention improves it by using a sliding window and weighted evaluation. The advantages of the improvement are as follows: 1. More accurate network status assessment: Through sliding windows and weighted assessment, the network status can be more comprehensively reflected, avoiding misjudgment caused by instantaneous fluctuations.

[0048] 2. Adaptive to complex network environments: When network conditions fluctuate greatly, the improved formula can more stably evaluate the overall network quality and reduce the frequency of redundant insertion.

[0049] 3. Improve system reliability: When redundant insertion is really needed (for example, when there is a continuous high packet loss rate), the redundant mechanism can be triggered in time to improve the reliability of data transmission.

[0050] Embodiment 6: This embodiment is based on Embodiment 5: In the step A, spiral check is used to detect residual errors during audio decoding: in audio data transmission, the sending end generates a spiral check byte for the data block and appends it to the end of the data block; the receiving end extracts the data block and recalculates the check byte to detect whether there is an error; when the receiving end detects a data error through the spiral check, it first attempts to locate and correct the error through the spiral check polynomial. If the spiral check cannot correct the error, the receiving end will mark the frame as a residual error and notify the sending end to transmit triple redundant information to recover the lost or damaged data and continue normal transmission.

[0051] Define the spiral check polynomial:

[0052] in, :Indicates the first A value of bytes, each byte is treated as a Galois field The elements in :Position weight of the polynomial, corresponding to the position of the byte in the data stream, : A reduced polynomial defined on GF(2) used to construct a 16-dimensional spiral space; mod means modular operation; Check byte generation algorithm:

[0053] in, is a prime number permutation table, ⊕ represents Galois Field addition, represents Galois Field multiplication, Indicates the first j + 1 byte (the byte following the current byte), Indicates circular left shift Bit operations.

[0054] The improved spiral check polynomial of the present invention is improved by adding modular operation , significantly reducing the computational complexity and improving real-time performance. By introducing prime number permutation tables and Galois field multiplication, the randomness and anti-interference ability of the check bytes are improved, and the error correction capability is enhanced.

[0055] The results show that an effective recovery rate of 99.2% can be achieved at a packet loss rate of 15%.

[0056] Embodiment 7: This embodiment is based on embodiment 1: The server configures an array as an audio buffer. Each time an audio data block is received, the array is filled and placed after the previous data block. When the accumulated audio data in the buffer reaches a preset threshold, voice activity detection is performed on the audio stream to distinguish between voice segments and silent segments, and the audio stream is segmented into independent voice segments based on timestamps. The segmented voice segments are transcribed in real time in chronological order.

[0057] When segmenting, two adjacent voice segments of a silent segment with a duration of less than 1 second are regarded as a continuous voice segment, and the last voice segment after the audio stream is segmented is regarded as incomplete audio. The voice segment and the subsequent audio data are temporarily retained in the buffer and merged and processed after subsequent data arrives.

[0058] The present invention uses the silero_vad library to quickly call the silero_vad speech detection model to detect speech activity on the audio. In the speech transcription and translation process, the Whisper speech transcription model is used. In addition, a hybrid model can also be used to combine traditional statistical models (such as hidden Markov models HMM) and modern deep learning models (such as recurrent neural networks RNN or Transformer models) to improve the accuracy and robustness of transcription and translation.

[0059] Embodiment 8: A system for implementing the low-latency real-time speech transcription method of the present invention comprises: The client obtains the audio data, encodes and compresses the original audio data, and transmits it to the server in real time through the data transmission module; The server receives the audio data, detects the voice in the audio using the voice activity detection module, segments the audio data judged to be voice, and transcribes the segmented audio data in real time in chronological order.

[0060] The server side calls the translation model or transmits it to a third-party translation software to translate the text information.

[0061] The above-mentioned embodiments only express the specific implementation of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A low-latency real-time speech transcription method, characterized in that , including the following steps: A. Encode and compress the original audio data collected by the client, and then transmit the obtained audio encoding data to the server through the real-time transport protocol, introduce error correction and packet loss retransmission mechanism to increase the reliability of transmission; B. The server uses a voice activity detection algorithm to detect speech in the audio data, splits the audio data judged to be speech into multiple independent parts, and adds a timestamp to each part; C. The segmented audio data is transcribed in real time in chronological order to generate corresponding text content.

2. The low-latency real-time speech transcription method according to claim 1, characterized in that , the step A comprises: A1. Create an array A to store the audio to be detected for voice activity; A2. Each time, 256ms-512ms of audio data is taken from the collected audio and appended to array A. If the current accumulated audio segment duration L reaches more than 4 times the duration of the single appended audio, voice activity detection is performed, and a timestamp is added to each voice segment. The audio consists of several voice segments containing voice and silent segments without voice. The segment between two adjacent voice segments is a silent segment. A3, the difference between the duration L of the audio segment and the end time of the last voice segment is diff, If diff<1s, the audio data before the last voice segment is uploaded to the server, and the uploaded audio data in array A is deleted; If diff>=1s, all the audio segment data are uploaded to the server and array A is cleared; The Opus coding transmission bit rate of the silence segment is lower than that of the speech segment; A4. If the client has not finished the collection work, continue to execute the loop from step A2.

3. The low-delay real-time speech transcription method according to claim 1, characterized in that In step A, based on the UDP transmission protocol, the UDP protocol data packet is encoded based on the forward error correction mechanism to obtain the encoded data block, and the encoded data block is interleaved to combat burst packet loss.

4. The low-latency real-time speech transcription method according to claim 1, characterized in that , Step A described above adopts key frame retransmission, and triple redundancy is implemented for the key frames of the audio during retransmission: Original frame F_t; Differential frame ΔF_t = F_t ⊕ F_{t-1}; Check frame C_t = CRC32(F_t) || (F_t >> 8); A sliding window mechanism is used with a window size of W∈[2,5] and a redundancy insertion period of T∈[10ms,50ms], satisfying: , , where t is the serial number of the audio frame, F_t is the audio data of the current frame, F_{t-1} is the audio data of the previous frame, CRC refers to cyclic redundancy check, ⊕ represents Galois Field addition, is the packet loss rate threshold, is the weight coefficient.

5. The low-delay real-time speech transcription method according to claim 4, characterized in that , In step A, spiral check is used to detect residual errors during audio decoding: in audio data transmission, the sending end generates spiral check bytes for the data block and appends them to the end of the data block; the receiving end extracts the data block and recalculates the check bytes to detect whether there is an error; when the receiving end detects a data error through spiral check, it first attempts to locate and correct the error through the spiral check polynomial. If the spiral check cannot correct the error, the receiving end will mark the frame as a residual error and notify the sending end to transmit triple redundant information to recover the lost or damaged data.

6. The low-latency real-time speech transcription method according to claim 5, characterized in that , define the spiral check polynomial: ,in, :Indicates the first A value of bytes, each byte is treated as a Galois field The elements in :Position weight of the polynomial, corresponding to the position of the byte in the data stream, : A reduced polynomial defined on GF(2) used to construct a 16-dimensional spiral space. mod means modular operation; Check byte generation algorithm: ,in, is a prime number permutation table, ⊕ represents Galois Field addition, represents Galois Field multiplication, Indicates the first j + 1 byte (the byte following the current byte), Indicates circular left shift Bit operations.

7. The low-latency real-time speech transcription method according to claim 1, characterized in that , the server configures an array as an audio buffer. Every time an audio data block is received, the array is filled and placed after the previous data block. When the audio data accumulated in the buffer reaches the preset threshold, voice activity detection is performed on the audio stream to distinguish between voice segments and silent segments, and the audio segments are segmented into independent voice segments based on timestamps. The segmented voice segments are transcribed in real time in chronological order.

8. The low-delay real-time speech transcription method according to claim 7, characterized in that When segmenting, two adjacent voice segments of a silent segment with a duration of less than 1s are regarded as a continuous voice segment, and the last voice segment after the audio stream is segmented is regarded as an incomplete audio. The voice segment and the subsequent audio data are temporarily retained in the buffer and merged and processed after the subsequent data arrives.

9. A system for implementing the low-delay real-time speech transcription method according to any one of claims 1 to 8, characterized in that: include: The client obtains the audio data, encodes and compresses the original audio data, and transmits it to the server in real time through the data transmission module; The server receives the audio data, detects the voice in the audio using the voice activity detection module, segments the audio data judged to be voice, and transcribes the segmented audio data in real time in chronological order.

10. The system of the low-latency real-time speech transcription method according to claim 9, characterized in that: The server side calls the translation model or transmits it to a third-party translation software to translate the text information.

Citation Information

Patent Citations

  • Method realizing fast voice and text recording

    CN110265000A

  • CRC (cyclic redundancy check)-based error correction coding method, device and terminal

    CN115037415A

  • Voice wake-up method and device, storage medium and electronic equipment

    CN115831109A

  • Speech recognition method and device, equipment and storage medium

    CN115938397A

  • Audio processing method and device, computer equipment and storage medium

    CN117079671A

Cited By

  • Low-delay real-time voice conversion method and system

    CN120544584A

  • Audio stream processing method and device

    CN121122284A