Audio processing method for law enforcement recorder based on speech analysis and law enforcement recorder
Optimizing audio signal transmission through Huffman coding and supplementary coding solves the problems of delay and bandwidth consumption caused by traditional transmission error detection technology, achieves more efficient audio transmission, and ensures the stability and clarity of real-time calls between law enforcement recorders. .
Patent Information
- Application Number
- CN202411070370.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-08-06
AI Technical Summary
Traditional transmission error detection technology will increase the amount of data transmitted, resulting in increased transmission delays and increased network bandwidth consumption, affecting the real-time nature of calls between law enforcement recorders.
Use a method based on speech analysis to process the audio signal through Huffman coding and supplementary coding, optimize the division method and coding results, ensure that the final coding result length of the subsequence is equal to the target coding length, reduce the amount of transmitted data, and receive End-validate the incorrect subsequence for retransmission.
It reduces transmission delays and network bandwidth consumption, ensures the integrity and accuracy of audio transmission, and improves the stability and clarity of real-time calls between law enforcement recorders.
Smart Images

Figure CN118588094B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of audio transmission, and more specifically, to a law enforcement recorder audio processing method based on speech analysis and a law enforcement recorder. Background Art
[0002] The law enforcement recorder is a portable evidence-collecting technology device that integrates real-time audio and video recording, photography and video recording. It can digitally record dynamic and static on-site situations during the law enforcement process. At the same time, the law enforcement recorder can also be used to complete real-time calls, making it convenient for law enforcement in various environments.
[0003] Real-time calls are achieved through real-time transmission of audio. During the audio transmission process, many factors such as signal interference, communication distance, equipment performance, frequency selection and environmental conditions will affect the stability and clarity of real-time calls between law enforcement recorders. Therefore, it is necessary to ensure the integrity of the transmitted audio.
[0004] In order to ensure the integrity and accuracy of the audio, the transmitted audio needs to be checked by a technology that detects transmission errors. CRC (Cyclic Redundancy Check) is a technology that detects transmission errors by performing polynomial division operations on the audio. At the sending end of the audio transmission, a CRC calculation is performed on the audio to be transmitted, and the CRC value is appended to the end of the audio packet. After receiving the audio, the receiving end will perform a CRC calculation on the received audio again and compare the calculated CRC value with the received CRC value. If the two are consistent, it indicates that there was no error in the audio transmission process. If the two are inconsistent, it indicates that an error occurred during the audio transmission process and error handling is required, such as requesting the audio to be retransmitted.
[0005] CRC calculates the CRC of the audio to be transmitted and appends the CRC value to the end of the audio packet, which will increase the amount of audio transmitted. More audio takes longer to transmit, resulting in increased transmission delay. At the same time, the transmission of a large amount of audio will consume more network bandwidth, affecting the real-time nature of calls between law enforcement recorders. Summary of the invention
[0006] In order to solve the technical problem that the above-mentioned traditional technology for detecting transmission errors will increase the amount of transmitted data, resulting in increased transmission delay and increased network bandwidth consumption, and affecting the real-time nature of calls between law enforcement recorders, the present invention provides solutions in the following multiple aspects.
[0007] In the first aspect, the present invention provides an audio processing method for a law enforcement recorder based on speech analysis, comprising: collecting an audio signal through a law enforcement recorder; using the result of predictive coding of the audio signal as the audio signal to be transmitted; constructing a Huffman coding table and a supplementary coding according to the audio signal to be transmitted; dividing the audio signal to be transmitted according to each division length in a preset range, obtaining each division method and all subsequences contained in each division method; encoding all subsequences contained in the division method according to the Huffman coding table, and obtaining the coding results of all subsequences; calculating the preference of the ath division method , Indicates the maximum length of the encoding results of all subsequences contained in the a-th division method, Indicates the length of the encoding result of the ith subsequence contained in the ath division method, Indicates the number of all subsequences included in the a-th division method; takes the division method with the highest degree of preference as the final division method; records the maximum length of the encoding results of all subsequences included in the final division method as the target encoding length; supplements the encoding results of each subsequence included in the final division method according to the supplementary coding to obtain the final encoding results of each subsequence included in the final division method, and the length of the final encoding results of each subsequence is equal to the target encoding length; the final encoding results of all subsequences included in the final division method are combined into the final encoding results of the audio signal to be transmitted and transmitted, so that the receiving end can verify the received final encoding result of the audio signal to be transmitted according to the target encoding length and the preset range.
[0008] Preferably, constructing a Huffman coding table and a supplementary coding according to the audio signal to be transmitted includes: constructing a Huffman tree according to the frequencies of all coding objects in the audio signal to be transmitted; obtaining a Huffman coding table according to the code words corresponding to the leaf nodes in the Huffman tree; and using the code words corresponding to all branch nodes in the Huffman tree as supplementary coding.
[0009] Preferably, the step of dividing the audio signal to be transmitted according to each division length in the preset range to obtain each division method and all subsequences contained in each division method includes: taking each integer in the preset range as a division length; then dividing the audio signal to be transmitted according to the a-th division length to obtain all subsequences corresponding to the a-th division method, including ... Divide a subsequence from the audio signal to be transmitted, and record it as the first subsequence corresponding to the a-th division method; record the remaining audio signal to be transmitted as ; According to the length From the remaining audio signal to be transmitted Divide a subsequence on ; If the subsequence satisfies: the length of the subsequence Within the preset range, the length of the encoding result of the subsequence is The length of the encoding result of this subsequence is closest to , then the subsequence is recorded as the t-th subsequence corresponding to the a-th division method, and the remaining audio signal to be transmitted is recorded as ; If the subsequence does not meet the above conditions, stop dividing the audio signal to be transmitted according to the a-th division method; , , They represent the length of the encoding results of the 1st, 2nd, and t-1th subsequences respectively, and S represents the depth of the Huffman tree.
[0010] Preferably, it further comprises: when the length of the remaining audio signal to be transmitted is less than K1, stopping the division, and taking the remaining audio signal to be transmitted whose length is less than K1 as the remaining subsequence; wherein K1 represents the left boundary of the preset range.
[0011] Preferably, the final encoding result of the audio signal to be transmitted also includes encoding results of the remaining subsequences.
[0012] Preferably, the method of supplementing the coding results of each subsequence included in the final division method according to the supplementary coding to obtain the final coding results of each subsequence included in the final division method includes: Any one of the supplementary codes of all the supplementary codes is added to the end of the encoding result of the i-th subsequence to obtain the final encoding result of the i-th subsequence, where represents the length of the encoding result of the i-th subsequence, Indicates the target encoding length.
[0013] Preferably, the transmission further comprises: transmitting the target coding length as supplementary information.
[0014] Preferably, the final encoding result of the received audio signal to be transmitted is verified, including: at the receiving end, the final encoding result of the received audio signal to be transmitted is firstly verified according to the target encoding length The final encoding result is divided to obtain multiple lengths equal to sub-coding sequence; decoding each sub-coding sequence according to the Huffman coding table to obtain a decoding result of each sub-coding sequence, and deleting the supplementary code in the decoding result; in response to the data amount of the decoding result of the sub-coding sequence not being within a preset range, requesting the sending end to retransmit the sub-sequence corresponding to the sub-coding sequence.
[0015] In a second aspect, the present invention provides a law enforcement recorder, which adopts the following technical solution:
[0016] A law enforcement recorder includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the steps of the law enforcement recorder audio processing method based on speech analysis are implemented.
[0017] By adopting the above technical solution, the above-mentioned law enforcement recorder audio processing method based on speech analysis is generated into a computer program and stored in a memory to be loaded and executed by a processor, so that a terminal device is made according to the memory and the processor for easy use.
[0018] The beneficial effects of the present invention are:
[0019] The present invention supplements the coding results of all subsequences included in the final division method of the audio signal to be transmitted through supplementary coding, so that the length of the final coding result of each subsequence is equal to the target coding length, and then the final coding result of the audio signal to be transmitted is obtained, so that the receiving end can verify the final coding result of the received audio signal to be transmitted according to the target coding length and the preset range, determine the subsequence in which an error occurs during the transmission process, and re-transmit it; compared with the traditional technology for detecting transmission errors, the amount of data transmitted is less, the transmission delay and network bandwidth consumption are reduced, and at the same time the integrity and accuracy of the transmitted audio are ensured, thereby ensuring the stability and clarity of real-time calls between law enforcement recorders.
[0020] Furthermore, the present invention obtains various division methods of the audio signal to be transmitted according to each division length in a preset range, and calculates the priority of each division method of the audio signal to be transmitted according to the length of the encoding results of all subsequences contained in each division method of the audio signal to be transmitted, that is, the data supplement amount of the encoding results of each subsequence, and uses the division method with the greatest priority as the final division method of the audio signal to be transmitted, so that the final amount of data to be transmitted is minimized, thereby reducing transmission delay and network bandwidth consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0022] Figure 1 is a flow chart schematically illustrating an audio processing method of a law enforcement recorder based on speech analysis in the present invention;
[0023] Figure 2 is a flow chart schematically showing step S2 in the present invention. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0025] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0026] The embodiment of the present invention discloses a method for processing audio of a law enforcement recorder based on speech analysis, referring to Figure 1 , including steps S1 to S4:
[0027] S1. Collect audio signals through the microphone of the law enforcement recorder.
[0028] It should be noted that the law enforcement recorder can digitally record dynamic and static on-site situations during the law enforcement process. At the same time, the law enforcement recorder can also be used to complete real-time calls, making it convenient for public security officers to use it in law enforcement in various environments.
[0029] Specifically, the law enforcement recorder uses components such as a microphone, a speaker, a codec, an audio processing unit, and a network connection to work together, so that the law enforcement recorder can make real-time calls when needed, such as communicating and collaborating with a command center or other law enforcement personnel; therefore, audio signals are collected through the microphone of the law enforcement recorder.
[0030] Among them, the microphone is used to collect environmental sounds and the sounds of law enforcement officers speaking, and convert the sounds into audio signals; the audio signals are processed by the audio processing unit, such as noise reduction and echo cancellation, to improve the quality and clarity of the audio; the audio signals are compressed (encoded) and decompressed (decoded) by the codec, which can reduce the bandwidth occupied during transmission while maintaining the sound quality; the network connection refers to a wireless network or a mobile data network, and the network connection is usually used to transmit audio signals; the speaker can convert the received audio signals into sound output, so that the command center or other law enforcement officers can hear what the other party is saying.
[0031] S2. Obtain a final division method of the audio signal to be transmitted.
[0032] Compressing audio signals through codecs usually refers to reducing the amount of data of transmitted audio signals through audio coding technology while retaining the quality of the audio signals as much as possible. Lossless compression technology can reduce the amount of data of transmitted audio signals without affecting the quality of the audio. Common lossless compression formats include FLAC (Free Lossless Audio Codec, lossless audio compression coding, abbreviated as FLAC), ALAC (Apple Lossless Audio Codec, lossless audio codec, abbreviated as ALAC), etc.
[0033] The process of lossless compression consists of the following steps:
[0034] 1. Perform predictive coding on the collected audio signal and use the result of the predictive coding as the audio signal to be transmitted, including: predicting the value of future samples by analyzing the characteristics of the audio signal and only storing the prediction error, thereby reducing the amount of data.
[0035] 2. Perform entropy coding on the audio signal to be transmitted, including: using an entropy coding algorithm to further compress the audio signal, the entropy coding algorithm includes Huffman coding, and the coding object at this time is the prediction error.
[0036] 3. Encapsulate the compressed audio signal to be transmitted into an appropriate format (such as FLAC, ALAC, etc.) for playback and storage.
[0037] It should be noted that in order to ensure the integrity and accuracy of the audio, the transmitted audio needs to be detected through the technology of detecting transmission errors. CRC is a technology that detects transmission errors by performing polynomial division operations on data. At the sending end of data transmission, CRC calculation is performed on the data to be transmitted, and the CRC value is appended to the end of the data packet. However, this will lead to an increase in the amount of data transmitted. More data takes longer to transmit, resulting in increased transmission delays. At the same time, the transmission of large amounts of data will consume more network bandwidth.
[0038] In summary, traditional technologies for detecting transmission errors will increase the amount of data transmitted, leading to increased transmission delays and increased network bandwidth consumption, affecting the real-time nature of calls between law enforcement recorders.
[0039] It should be further explained that in order to ensure the integrity and accuracy of the audio signal without increasing the amount of data transmitted, the present invention uses Huffman coding to further compress the audio signal, that is, in step 2 of the lossless compression process, the audio signal to be transmitted is divided according to each division length in a preset range, and each division method and all subsequences contained in each division method are obtained. The priority of each division method is calculated, and the division method with the largest priority is used as the final division method of the audio signal to be transmitted. The encoding results of all subsequences contained in the final division method of the audio signal to be transmitted are supplemented, and the final encoding result of the audio signal to be transmitted is obtained and transmitted, so that the receiving end can verify the received final encoding result of the audio signal to be transmitted.
[0040] Specific process reference Figure 2 , including steps S201 to S204:
[0041] S201. Construct a Huffman coding table for the audio signal to be transmitted.
[0042] Specifically, a Huffman tree is constructed according to the frequencies of all coding objects in the audio signal to be transmitted, and the Huffman tree is a binary tree; in the Huffman tree, the node of the first layer is the root node, and the other layers include leaf nodes and branch nodes. The nodes corresponding to the coding objects are all leaf nodes, and the branch nodes are nodes where there are no coding objects.
[0043] Furthermore, a Huffman coding table is obtained according to the code words corresponding to the leaf nodes in the Huffman tree; the code words corresponding to all branch nodes in the Huffman tree are used as supplementary codes, and the maximum length of the supplementary codes is S-2, where S represents the layer depth of the Huffman tree.
[0044] It should be noted that Huffman coding is a well-known technology, and constructing a Huffman tree and obtaining a Huffman coding table according to the Huffman tree are both well-known steps in Huffman coding, which will not be described in detail here.
[0045] It should be noted that Huffman coding is an algorithm for lossless data compression. By encoding the audio signal to be transmitted through Huffman coding, the data volume of the encoding result of the audio signal to be transmitted can be reduced, and the transmission delay and network bandwidth consumption can be reduced.
[0046] S202. Divide the audio signal to be transmitted according to each division length in a preset range, and obtain each division method and all subsequences included in each division method.
[0047] It should be noted that when different division methods are used to divide the audio signal to be transmitted, the lengths of the encoding results of each subsequence obtained are different, and the amount of data that needs to be supplemented is also different. The less data that needs to be supplemented, the less data that ultimately needs to be transmitted, thereby reducing transmission delays and network bandwidth consumption.
[0048] Specifically, each integer in the preset range [K1, K2] is used as a partition length, K1 represents the left boundary of the preset range, and K1 is equal to the first preset number, K2 represents the right boundary of the preset range, and K2 is equal to the second preset number, then K2-K1+1 represents the number of all types of partition lengths, and the ath type of partition length is recorded as .
[0049] When the preset range is set to be larger, when the error code detection is performed subsequently, the allowable error preset range of the subsequence length is larger, resulting in less accurate error code detection; and when the preset range is set to be smaller, when the integers within the preset range are used as the division length for subsequence division, the possible division results are fewer, resulting in the possibility of not being able to find a division method that meets the conditions; therefore, it is more appropriate for the first preset number to be within the preset range of [5,15] and the second preset number to be within the preset range of [20,30]. The present invention sets the first preset number to 10 and the second preset number to 20.
[0050] Further, the audio signal to be transmitted is divided according to each division length to obtain each division mode and all subsequences contained in each division mode; wherein, the audio signal to be transmitted is divided according to the a-th division length to obtain the a-th division mode and all subsequences contained in the a-th division mode, including:
[0051] (1) Divide the length according to the ath type Divide a subsequence from the audio signal to be transmitted, and record it as the first subsequence corresponding to the a-th division method; Dividing a subsequence from the audio signal to be transmitted means: The sequence of data is taken as the first subsequence of the a-th division method; the length of the encoding result of the first subsequence is recorded as , at this time, the remaining audio signal to be transmitted is recorded as ;
[0052] (2) According to length From the remaining audio signal to be transmitted Divide a subsequence on the top if the subsequence satisfies: the length of the subsequence Within the preset range, the length of the encoding result of the subsequence is The length of the encoding result of this subsequence is closest to , then the subsequence is recorded as the second subsequence corresponding to the a-th division method, and the length of the encoding result of the second subsequence is recorded as , at this time, the remaining audio signal to be transmitted is recorded as ; If the subsequence does not meet the above conditions, stop dividing the audio signal to be transmitted according to the a-th division method;
[0053] Among them, S-2 represents the maximum length of the supplementary code, S represents the depth of the Huffman tree; the length of the encoding result is closest to The subsequence is the length of the encoding result and The subsequence with the smallest absolute value of the difference;
[0054] It is particularly important to note that when there are multiple encoding results with the length closest to When a subsequence is selected, any one of the subsequences is selected as the second subsequence;
[0055] (3) According to length From the remaining audio signal to be transmitted Divide a subsequence on the top if the subsequence satisfies: the length of the subsequence Within the preset range, the length of the encoding result of the subsequence is The length of the encoding result of this subsequence is closest to , then the subsequence is recorded as the third subsequence corresponding to the a-th division method, and the length of the encoding result of the third subsequence is recorded as , at this time, the remaining audio signal to be transmitted is recorded as ; If the subsequence does not meet the above conditions, stop dividing the audio signal to be transmitted according to the a-th division method;
[0056] in, Indicates taking the maximum value; the length of the encoded result is closest to The subsequence is the length of the encoding result and The subsequence with the smallest absolute value of the difference;
[0057] It is particularly important to note that when there are multiple encoding results with the length closest to When a subsequence is selected, any of the subsequences is selected as the third subsequence;
[0058] (4) According to length From the remaining audio signal to be transmitted Divide a subsequence on the top if the subsequence satisfies: the length of the subsequence Within the preset range, the length of the encoding result of the subsequence is The length of the encoding result of this subsequence is closest to , then the subsequence is recorded as the 4th subsequence of the ath division method, the sequence composed of the remaining data is used as the new audio signal to be transmitted, and the length of the encoding result of the 4th subsequence is recorded as , at this time, the remaining audio signal to be transmitted is recorded as ; If the subsequence does not meet the above conditions, stop dividing the audio signal to be transmitted according to the a-th division method;
[0059] in, Indicates taking the maximum value; the length of the encoded result is closest to The subsequence is the length of the encoding result and The subsequence with the smallest absolute value of the difference;
[0060] It is particularly important to note that when there are multiple encoding results with the length closest to When a subsequence is selected, any one of the subsequences is selected as the fourth subsequence;
[0061] (5) According to length From the remaining audio signal to be transmitted Divide a subsequence on: If the subsequence satisfies: The length of the subsequence Within the preset range, the length of the encoding result of the subsequence exist The length of the encoding result of this subsequence is closest to , then the subsequence is recorded as the t-th subsequence corresponding to the a-th division method, and the length of the encoding result of the t-th subsequence is recorded as , at this time, the remaining audio signal to be transmitted is recorded as ; If the subsequence does not meet the above conditions, stop dividing the audio signal to be transmitted according to the a-th division method;
[0062] in, Indicates taking the maximum value; the length of the encoded result is closest to The subsequence is the length of the encoding result and The subsequence with the smallest absolute value of the difference;
[0063] It is particularly important to note that when there are multiple encoding results with the length closest to When there are subsequences of , one of the subsequences is selected as the t-th subsequence;
[0064] (6) This process is repeated in this way until the length of the remaining audio signal to be transmitted is less than K1, at which time the division is stopped and the remaining audio signal to be transmitted whose length is less than K1 is taken as the remaining subsequence; wherein K1 represents the left boundary of the preset range.
[0065] In summary, if the audio signal to be transmitted can be divided into multiple subsequences and one remaining subsequence according to the ath division method, then the ath division method exists; if during the division process, the audio signal to be transmitted is stopped from being divided according to the ath division method, then the ath division method does not exist.
[0066] S203. Calculate the priority of each partitioning method.
[0067] Specifically, the preference of each division method is calculated according to the distribution of the lengths of the encoding results of all subsequences included in each division method, and the preference of each division method satisfies the expression:
[0068] ;
[0069] In the formula, represents the preference of the a-th partitioning method, a represents the serial number of the partitioning method, a takes all integers in the range [1, K2-K1+1], K1 represents the left boundary of the preset range, K2 represents the right boundary of the preset range, Indicates the maximum length of the encoding results of all subsequences contained in the a-th division method, Indicates the length of the encoding result of the i-th subsequence contained in the a-th division method, i represents the sequence number of the subsequence, and i is taken over All integers in the range, represents the number of all subsequences contained in the a-th partitioning method, represents an exponential function with a natural constant as the base. It should be noted that The amount of data supplementation for the encoding result of the ith subsequence contained in the ath division method is: Represents the amount of data supplement for the encoding result of the a-th division method. The smaller the value is, the less data needs to be supplemented, and the less data needs to be transmitted in the end, thereby reducing transmission delay and network bandwidth consumption. Therefore, the smaller the value is, the more the a-th division method of the audio signal to be transmitted should be used as the final division method of the audio signal to be transmitted, and the greater the preference of the a-th division method of the audio signal to be transmitted.
[0070] In special cases, if the a-th partitioning method does not exist, the preference of the a-th partitioning method is 0.
[0071] S204. The division method with the highest preference is used as the final division method.
[0072] It should be further explained that the present invention obtains various division methods of the audio signal to be transmitted according to the division lengths in a preset range, and calculates the priority of each division method of the audio signal to be transmitted according to the length of the encoding results of all subsequences contained in each division method of the audio signal to be transmitted, that is, the data supplement amount of the encoding results of each subsequence, and uses the division method with the highest priority as the final division method of the audio signal to be transmitted, so that the final amount of data to be transmitted is minimized, thereby reducing transmission delay and network bandwidth consumption.
[0073] S3. Supplement the encoding results of all subsequences included in the final division method to obtain the final encoding result of the audio signal to be transmitted and transmit it.
[0074] Specifically, the maximum length of the encoding results of all subsequences included in the final division method is used as the target encoding length ; Supplement the coding results of each subsequence included in the final division method according to the supplementary coding to obtain the final coding results of each subsequence, requiring that the length of the final coding result of each subsequence is equal to the target coding length; The final coding results of all subsequences included in the final division method and the coding results of the remaining subsequences constitute the final coding result of the audio signal to be transmitted.
[0075] Among them, when the encoding results of each subsequence included in the final division method are supplemented according to the supplementary coding, the length is equal to Any one of the supplementary codes of all the supplementary codes is added to the end of the encoding result of the i-th subsequence to obtain the final encoding result of the i-th subsequence, where represents the length of the encoding result of the i-th subsequence, Indicates the target encoding length.
[0076] Furthermore, the target coding length is used as supplementary information; and the final coding result of the audio signal to be transmitted and the supplementary information are transmitted.
[0077] It should also be noted that the preset range [K1, K2] is agreed upon in advance by the sender and the receiver and does not need to be transmitted; the Huffman coding table and the supplementary coding can be obtained by the sender and the receiver on the Huffman tree constructed according to the sample data set and do not need to be transmitted.
[0078] It should be noted that, compared with the traditional technology for detecting transmission errors, the method of the present invention transmits less data, reduces transmission delay and network bandwidth consumption, and ensures the integrity and accuracy of data transmission in the computer user data management system.
[0079] S4. The receiving end verifies the final encoding result of the received audio signal to be transmitted according to the target encoding length and the preset range.
[0080] Specifically, for the final encoding result of the audio signal to be transmitted received by the receiving end, the final encoding result is first divided according to the target encoding length to obtain multiple lengths equal to sub-coding sequence; decoding each sub-coding sequence according to the Huffman coding table to obtain a decoding result of each sub-coding sequence, deleting the supplementary code contained in the decoding result, and in response to the data amount of the decoding result of the sub-coding sequence not being within a preset range [K1, K2], indicating that an error has occurred in the transmission process of the sub-coding sequence, and requesting the sending end to retransmit the sub-sequence corresponding to the sub-coding sequence.
[0081] It should be noted that the present invention supplements the encoding results of all subsequences contained in the final division method of the audio signal to be transmitted through supplementary coding, so that the length of the final encoding result of each subsequence is equal to the target encoding length, and then obtains the final encoding result of the audio signal to be transmitted, so that the receiving end can verify the final encoding result of the received audio signal to be transmitted according to the target encoding length and the preset range, determine the subsequence in which errors occur during the transmission process, and re-transmit it; compared with traditional technologies for detecting transmission errors, the amount of data transmitted is less, reducing transmission delays and network bandwidth consumption, while ensuring the integrity and accuracy of the transmitted audio, thereby ensuring the stability and clarity of real-time calls between law enforcement recorders.
[0082] An embodiment of the present invention further discloses a law enforcement recorder, comprising: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the steps of the above-mentioned law enforcement recorder audio processing method based on speech analysis are implemented.
[0083] The above-mentioned law enforcement recorder also includes other components familiar to those skilled in the art, such as a communication bus and a communication interface. Their settings and functions are known in the art, so they will not be described in detail here.
[0084] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0085] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. Audio processing method of law enforcement recorder based on speech analysis, It is characterized in that include: Collect audio signals through law enforcement recorders; Using the result of predictive coding of the audio signal as the audio signal to be transmitted; According to the audio signal to be transmitted, a Huffman coding table and a supplementary coding are constructed, including: constructing a Huffman tree according to the frequencies of all coding objects in the audio signal to be transmitted; obtaining a Huffman coding table according to the code words corresponding to the leaf nodes in the Huffman tree; using the code words corresponding to all branch nodes in the Huffman tree as supplementary coding; Divide the audio signal to be transmitted according to each division length in a preset range, and obtain each division mode and all subsequences included in each division mode; Encode all subsequences contained in the partitioning method according to the Huffman coding table to obtain the encoding results of all subsequences; calculate the preference of the a-th partitioning method , Indicates the maximum length of the encoding results of all subsequences contained in the a-th division method, Indicates the length of the encoding result of the i-th subsequence contained in the a-th division method, Indicates the number of all subsequences contained in the a-th partitioning method; The partitioning method with the highest preference is taken as the final partitioning method; the maximum length of the encoding results of all subsequences included in the final partitioning method is recorded as the target encoding length; Supplementing the encoding results of each subsequence included in the final division method according to the supplementary coding to obtain the final encoding results of each subsequence included in the final division method, wherein the length of the final encoding result of each subsequence is equal to the target encoding length, including: Any one of the supplementary codes of all the supplementary codes is added to the end of the encoding result of the i-th subsequence to obtain the final encoding result of the i-th subsequence, where represents the length of the encoding result of the i-th subsequence, Indicates the target encoding length; The final encoding results of all subsequences included in the final division method are combined into the final encoding result of the audio signal to be transmitted and transmitted, so that the receiving end can verify the received final encoding result of the audio signal to be transmitted according to the target encoding length and the preset range.
2. The audio processing method of the law enforcement recorder based on speech analysis according to claim 1, It is characterized in that The step of dividing the audio signal to be transmitted according to each division length in a preset range to obtain each division method and all subsequences included in each division method includes: Each integer within the preset range is used as a partition length; The audio signal to be transmitted is divided according to the a-th division length to obtain all subsequences corresponding to the a-th division method, including: According to the length of the a-th division Divide a subsequence from the audio signal to be transmitted, and record it as the first subsequence corresponding to the a-th division method; record the remaining audio signal to be transmitted as ; According to length From the remaining audio signal to be transmitted Divide a subsequence on ; If the subsequence satisfies: the length of the subsequence Within the preset range, the length of the encoding result of the subsequence is The length of the subsequence encoding result is within the range of The absolute value of the difference between is the smallest, then the subsequence is recorded as the t-th subsequence corresponding to the a-th division method, and the remaining audio signal to be transmitted is recorded as ; Otherwise, stop dividing the audio signal to be transmitted according to the a-th division method; , , They represent the length of the encoding results of the 1st, 2nd, and t-1th subsequences respectively, and S represents the depth of the Huffman tree.
3. The audio processing method of the law enforcement recorder based on speech analysis according to claim 1, It is characterized in that Also includes: When the length of the remaining audio signal to be transmitted is less than K1, the division is stopped, and the remaining audio signal to be transmitted whose length is less than K1 is taken as the remaining subsequence; wherein K1 represents the left boundary of the preset range.
4. The audio processing method of the law enforcement recorder based on speech analysis according to claim 1, It is characterized in that The final encoding result of the audio signal to be transmitted also includes the encoding results of the remaining subsequences.
5. The audio processing method of the law enforcement recorder based on speech analysis according to claim 1, It is characterized in that The transmission further includes: The target code length is transmitted as supplementary information.
6. The audio processing method of the law enforcement recorder based on speech analysis according to claim 1, It is characterized in that The verifying of the final encoding result of the received audio signal to be transmitted includes: At the receiving end, the final encoding result of the received audio signal to be transmitted is first calculated based on the target encoding length. The final encoding result is divided to obtain multiple lengths equal to The subcoding sequence of Decoding each sub-coding sequence according to the Huffman coding table to obtain a decoding result of each sub-coding sequence, and deleting the supplementary code in the decoding result; In response to the data amount of the decoding result of the sub-coding sequence being not within a preset range, the sending end is requested to retransmit the sub-sequence corresponding to the sub-coding sequence.
7. A law enforcement recorder, It is characterized in that include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the steps of the law enforcement recorder audio processing method based on speech analysis according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Law enforcement behavior intelligent supervision system and method based on edge calculation
CN120071224A
Intelligent Supervision System and Method for Law Enforcement Behavior Based on Edge Computing
CN120071224B
