SOX library-based audio noise elimination method, audio playing terminal and storage medium
Through the generation and application of noise reduction model files based on the SOX library, the problem of significant audio noise in smart hardware devices is solved, and the effect of reducing device-side noise is achieved, saving costs and improving audio call experience.
Patent Information
- Application Number
- CN202411576064.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-03-14
AI Technical Summary
The audio signals collected by smart hardware devices in remote smart cameras are significant due to the noise problems of the device itself and the environment, and the prior art is difficult to effectively reduce noise and is costly.
The noise reduction model file is generated based on the SOX library, and the received audio files are denoised through these models to remove the audio noise.
There is no need to make complex process improvements to smart hardware. Relying on the performance of mobile phones significantly reduces the environmental noise on the device side, saves hardware process costs, and improves the experience of real-time audio calls.
Smart Images

Figure CN119626239A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of real-time communication audio transmission, and in particular to a method for eliminating audio noise based on a SOX library, an audio playback terminal and a storage medium. Background Art
[0002] When a remote smart camera collects audio through a microphone, it transmits the background noise of the environment and the device itself to the mobile phone app. Due to the differences in cost and manufacturing process between smart hardware and mobile phones, the background noise is more significant than that of mobile phones.
[0003] The technical defects of the prior art are as follows: 1. Use physical noise reduction on the device side: By introducing a dust cover on the microphone, the input end of the device can be made purer to achieve the purpose of noise reduction. The main problem is that the dust cover will be blocked by dust over time.
[0004] 2. Refer to the mobile phone to improve the device-side process to achieve noise reduction. The biggest problem here is that smart hardware is highly homogeneous. If the noise problem is improved according to the precision requirements of the mobile phone, the cost will be too high.
[0005] 3. Introduce the noise reduction solution of WebRTC. WebRTC is an open source library for audio and video ecology. The library is particularly complete and huge. If you want to extract a specific noise reduction solution, the R&D investment and time cost will be huge.
[0006] 4. The device uses the noise reduction algorithm of the original hardware. The original hardware is considered to be standard functional support. The reality is that the product forms and processes of various manufacturers are different. There is no unified solution to solve all noise problems. Even if the current noise problem can be solved, new environmental noise problems will arise as the equipment ages and the environmental noise changes. Summary of the invention
[0007] The present invention provides a method for eliminating audio noise based on a SOX library, comprising a noise reduction model file generation step and an audio noise reduction step. The step of generating a noise reduction model file comprises the following steps: Step 1: Receive the audio file sent by the audio acquisition end; Step 2: Input the audio file into the SOX library to obtain the noise reduction model file; Step 3: Save the denoising model file; The audio noise reduction steps: Receiving step: receiving the audio file sent by the audio acquisition end; Denoising step: Denoising the received audio file using the denoising model file to obtain denoised audio content for subsequent playback; Playback steps: Send the noise-reduced audio content to the speaker for playback.
[0008] As a further improvement of the present invention, in step 1, a PCM audio file sent by an audio acquisition terminal is received; in step 2, the PCM audio file is input into a SOX library to obtain a noise reduction model file.
[0009] As a further improvement of the present invention, in step 2, the received audio file is converted into a PCM audio file, and the PCM audio file is input into the SOX library to obtain a noise reduction model file.
[0010] As a further improvement of the present invention, in the receiving step, a PCM audio file sent by the audio acquisition end is received; in the noise reduction step: the received PCM audio file is denoised by a noise reduction model file to obtain the denoised audio content for subsequent playback.
[0011] As a further improvement of the present invention, the audio noise reduction step further includes an audio decoding step, which is performed after the receiving step; In the receiving step, receiving the encoded audio file sent by the audio acquisition terminal; Audio decoding step: decode the encoded audio file to obtain a PCM audio file, and then perform the noise reduction step; In the noise reduction step, the PCM audio file is denoised using a noise reduction model file to obtain the denoised audio content for subsequent playback.
[0012] As a further improvement of the present invention, in the audio decoding step, the encoded audio file is an ACC format file, and a PCM audio file is obtained by decoding the ACC format file.
[0013] As a further improvement of the present invention, the audio noise reduction step further includes an audio caching step, which is performed after the receiving step; Audio caching step: storing the received audio file into the audio buffer area, and then performing the noise reduction step; In the noise reduction step, the audio file in the audio buffer is denoised using the noise reduction model file to obtain the denoised audio content, and then the playing step is performed.
[0014] As a further improvement of the present invention, in the receiving step, a PCM audio file sent by the audio acquisition end is received; In the audio buffering step, the received PCM audio file is stored in the audio buffer area, and then the noise reduction step is performed; In the noise reduction step, the PCM audio file in the audio buffer is denoised by using the noise reduction model file to obtain the denoised audio content, and then the playing step is performed.
[0015] As a further improvement of the present invention, the audio noise reduction step further includes an audio decoding step and An audio buffering step, performing an audio decoding step after the receiving step; In the receiving step, receiving the encoded audio file sent by the audio acquisition terminal; Audio decoding step: decode the encoded audio file to obtain a PCM audio file, and then perform the audio caching step; Audio caching step: storing the PCM audio file obtained in the audio decoding step into the audio buffer area, and then performing the noise reduction step; In the noise reduction step, the PCM audio file in the audio buffer is denoised by using the noise reduction model file to obtain the denoised audio content, and then the playing step is performed.
[0016] As a further improvement of the present invention, in step 2, a real discrete Fourier transform is performed on the received audio file to generate a noise power spectrum, and the generated noise power spectrum is the noise reduction model file.
[0017] As a further improvement of the present invention, in the noise reduction step, the received audio file is windowed and sampled using a Haining window, and then a fast Fourier transform is performed to generate a power spectrum. The noise power spectrum is referenced within the sampling spectrum range to perform algorithm elimination and smoothing filtering. The filtered spectrum is then converted from the frequency domain to the time domain through a fast Fourier transform, and then filtered through a Haining window to obtain the denoised audio content.
[0018] As a further improvement of the present invention, the audio noise reduction step includes the following steps: Determining step: determining whether to regenerate the denoising model file, if so, executing the regenerating step, otherwise, executing the receiving step; Regeneration step: executing the noise reduction model file generation step, replacing the original noise reduction model file with the newly generated noise reduction model file; and then executing the receiving step.
[0019] As a further improvement of the present invention, in the judging step, an option of regenerating the noise reduction model file is provided to the user to judge whether to regenerate the noise reduction model file.
[0020] The present invention also discloses an audio playback terminal, a memory, a processor and a computer program stored in the memory, wherein the computer program is configured to implement the steps of the method of the present invention when called by the processor.
[0021] The present invention also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is configured to implement the steps of the method of the present invention when called by a processor.
[0022] The beneficial effects of the present invention are: the present invention does not require further process improvements to the intelligent hardware, relies on the performance of the mobile phone to significantly reduce the environmental noise on the device side, saves hardware process costs, and improves the experience of the real-time audio call process. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 This is a schematic diagram of the first embodiment of audio from acquisition to playback; Figure 2 is a schematic diagram of a second embodiment of audio from acquisition to playback; Figure 3 is a schematic diagram of a third embodiment of audio from acquisition to playback; Figure 4 is a schematic diagram of a fourth embodiment of audio from acquisition to playback; Figure 5 is a flow chart of the fifth embodiment of the present invention. DETAILED DESCRIPTION
[0024] The present invention discloses a method for eliminating audio noise based on a SOX library, comprising a noise reduction model file generation step and an audio noise reduction step. The step of generating a noise reduction model file comprises the following steps: Step 1: Receive the audio file sent by the audio acquisition end, which carries environmental noise; Step 2: Input the audio file into the SOX library to obtain a noise reduction model file, which is a floating point prof noise reduction model file; Step 3: Save the denoising model file, for example, save the denoising model file to a specified directory for subsequent dynamic denoising.
[0025] The audio noise reduction steps: Receiving step: receiving the audio file sent by the audio acquisition end; Denoising step: Denoising the received audio file using the denoising model file to obtain denoised audio content for subsequent playback; Playback steps: Send the noise-reduced audio content to the speaker for playback.
[0026] In step 2, a real discrete Fourier transform is performed on the audio file received in step 1 to generate a noise power spectrum, and the generated noise power spectrum is the noise reduction model file.
[0027] In the noise reduction step, the audio file received in the receiving step is sampled by windowing using a Haining window, and then a fast Fourier transform is performed to generate a power spectrum. The noise power spectrum is referenced within the sampling spectrum range to perform algorithm elimination and smooth filtering. The filtered spectrum is then transformed from the frequency domain to the time domain through a fast Fourier transform, and then filtered through a Haining window to obtain the denoised audio content.
[0028] As a first embodiment of the present invention, Figure 1 As shown, the audio acquisition end performs the acquisition step, the DEVICE ANS step and the transmission step.
[0029] Collection steps: The audio collection end collects the original PCM audio through a microphone.
[0030] DEVICE ANS step: Use the ANS technology on the audio acquisition end to improve the quality of the audio signal, the core of which is to eliminate background noise.
[0031] Transmission steps: Transmit the audio content via UDP protocol.
[0032] In the step 1, a PCM audio file sent by an audio acquisition terminal is received; in the step 2, the PCM audio file is input into a SOX library to obtain a noise reduction model file.
[0033] In the receiving step, a PCM audio file sent by an audio acquisition terminal is received; in the denoising step: the received PCM audio file is denoised by a denoising model file to obtain denoised audio content for subsequent playback.
[0034] As a second embodiment of the present invention, Figure 2 As shown, the audio acquisition end also includes executing the encoding step, the encoding step: performing ACC encoding on the audio file, mainly to control the size of the transmission data volume.
[0035] In the second embodiment, in step 2, the received audio file is converted into a PCM audio file, and the PCM audio file is input into the SOX library to obtain a noise reduction model file.
[0036] In the second embodiment, the audio noise reduction step also includes an audio decoding step, which is performed after the receiving step; in the receiving step, the encoded audio file sent by the audio acquisition end is received; the audio decoding step: the encoded audio file is decoded to obtain a PCM audio file, and then the noise reduction step is performed; in the noise reduction step, the PCM audio file is denoised by a noise reduction model file to obtain the noise-reduced audio content for subsequent playback.
[0037] As a third embodiment of the present invention, Figure 3 As shown, based on the first embodiment, the audio noise reduction step also includes an audio caching (JitterBuffer) step, which is performed after the receiving step; in the receiving step, the PCM audio file sent by the audio acquisition end is received; in the audio caching step, the received PCM audio file is stored in the audio buffer area, and then the noise reduction step is performed; in the noise reduction step, the PCM audio file in the audio buffer area is denoised by the noise reduction model file to obtain the audio content after noise reduction, and then the playing step is performed. The audio caching (JitterBuffer) step is a commonly used technique for real-time communication. When the network quality is poor, the audio content can be played smoothly. The present invention can obtain the PCM audio clip in this buffer area.
[0038] As a fourth embodiment of the present invention, Figure 4 As shown, based on the second embodiment, the audio noise reduction step also includes an audio decoding step and an audio caching step, and the audio decoding step is performed after the receiving step; in the receiving step, the encoded audio file sent by the audio acquisition end is received; audio decoding step: decoding the encoded audio file to obtain a PCM audio file, and then performing the audio caching step; audio caching step: storing the PCM audio file obtained in the audio decoding step into an audio cache area, and then performing the noise reduction step; in the noise reduction step, the PCM audio file in the audio cache area is denoised by a noise reduction model file to obtain the audio content after noise reduction, and then performing the playing step.
[0039] The present invention will save a standard noise reduction model file. If the standard noise reduction model file does not have an ideal noise reduction effect on the audio of the user device, the present invention provides a function of regenerating the noise reduction model file.
[0040] As a fifth embodiment of the present invention, Figure 5 As shown, based on the first to fourth embodiments, the audio noise reduction step includes the following steps: Judgment step: determine whether to regenerate the noise reduction model file, if so, execute the regeneration step, otherwise, execute the receiving step; in the judgment step, provide the user with the option of regenerating the noise reduction model file to determine whether to regenerate the noise reduction model file.
[0041] Regeneration step: executing the noise reduction model file generation step, replacing the original noise reduction model file with the newly generated noise reduction model file; and then executing the receiving step.
[0042] In the fifth embodiment, if the regeneration step is performed, the denoising model file used in the denoising step is the newly generated denoising model file.
[0043] The present invention also discloses an audio playback terminal, comprising: a memory, a processor and a computer program stored in the memory, wherein the computer program is configured to implement the steps of the method of the present invention when called by the processor.
[0044] The audio playback terminal includes a smart phone and a tablet computer.
[0045] SOX excels in noise reduction processing of non-real-time audio files. The present invention combines the JitterBuffer anti-shake technology of real-time audio and video calls, and can dynamically perform real-time noise reduction on the audio data in the cache. Firstly, it has less impact on the real-time performance of the call; secondly, there is no need to make more process improvements to the smart hardware. Relying on the performance of the mobile phone, it greatly reduces the environmental noise on the device side, saves hardware process costs, and improves the experience of the real-time audio call process.
[0046] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A method for eliminating audio noise based on SOX library, characterized in that: Including the steps of generating the noise reduction model file and the audio noise reduction step, The step of generating a noise reduction model file comprises the following steps: Step 1: Receive the audio file sent by the audio acquisition end; Step 2: Input the audio file into the SOX library to obtain the noise reduction model file; Step 3: Save the denoising model file; The audio noise reduction steps: Receiving step: receiving the audio file sent by the audio acquisition end; Denoising step: Denoising the received audio file using the denoising model file to obtain denoised audio content for subsequent playback; Playback steps: Send the noise-reduced audio content to the speaker for playback.
2. The method according to claim 1, characterized in that In the step 1, a PCM audio file sent by an audio acquisition terminal is received; in the step 2, the PCM audio file is input into a SOX library to obtain a noise reduction model file.
3. The method according to claim 1, characterized in that In the step 2, the received audio file is converted into a PCM audio file, and the PCM audio file is input into the SOX library to obtain a noise reduction model file.
4. The method according to claim 1, characterized in that: In the receiving step, a PCM audio file sent by an audio acquisition terminal is received; in the denoising step: the received PCM audio file is denoised by a denoising model file to obtain denoised audio content for subsequent playback.
5. The method according to claim 1, characterized in that The audio noise reduction step further comprises an audio decoding step, which is performed after the receiving step; In the receiving step, receiving the encoded audio file sent by the audio acquisition terminal; Audio decoding step: decode the encoded audio file to obtain a PCM audio file, and then perform the noise reduction step; In the noise reduction step, the PCM audio file is denoised using a noise reduction model file to obtain the denoised audio content for subsequent playback.
6. The method according to claim 5, characterized in that In the audio decoding step, the encoded audio file is an ACC format file, and a PCM audio file is obtained by decoding the ACC format file.
7. The method according to claim 1, characterized in that The audio noise reduction step further includes an audio caching step, which is performed after the receiving step; Audio caching step: storing the received audio file into the audio buffer area, and then performing the noise reduction step; In the noise reduction step, the audio file in the audio buffer is denoised using the noise reduction model file to obtain the denoised audio content, and then the playing step is performed.
8. The method according to claim 1, characterized in that In the receiving step, a PCM audio file sent by an audio acquisition terminal is received; In the audio buffering step, the received PCM audio file is stored in the audio buffer area, and then the noise reduction step is performed; In the noise reduction step, the PCM audio file in the audio buffer is denoised by using the noise reduction model file to obtain the denoised audio content, and then the playing step is performed.
9. The method according to claim 1, characterized in that: The audio noise reduction step further includes an audio decoding step and an audio buffering step, and the audio decoding step is performed after the receiving step; In the receiving step, receiving the encoded audio file sent by the audio acquisition terminal; Audio decoding step: decode the encoded audio file to obtain a PCM audio file, and then perform the audio caching step; Audio caching step: storing the PCM audio file obtained in the audio decoding step into the audio buffer area, and then performing the noise reduction step; In the noise reduction step, the PCM audio file in the audio buffer is denoised by using the noise reduction model file to obtain the denoised audio content, and then the playing step is performed.
10. The method according to claim 1, characterized in that In step 2, a real discrete Fourier transform is performed on the received audio file to generate a noise power spectrum, and the generated noise power spectrum is the noise reduction model file.
11. The method according to claim 10, characterized in that In the noise reduction step, the received audio file is sampled by windowing using a Haining window, and then a fast Fourier transform is performed to generate a power spectrum. The noise power spectrum is referenced within the sampling spectrum range to perform algorithm elimination and smooth filtering. The filtered spectrum is then transformed from the frequency domain to the time domain through a fast Fourier transform, and then filtered through a Haining window to obtain the denoised audio content.
12. The method according to any one of claims 2 to 11, characterized in that The audio noise reduction step comprises the following steps: Determining step: determining whether to regenerate the denoising model file, if so, executing the regenerating step, otherwise, executing the receiving step; Regeneration step: executing the noise reduction model file generation step, replacing the original noise reduction model file with the newly generated noise reduction model file; and then executing the receiving step.
13. The method according to claim 12, characterized in that: In the judging step, an option of regenerating the noise reduction model file is provided to the user to judge whether to regenerate the noise reduction model file.
14. An audio playback terminal, characterized in that: include: A memory, a processor, and a computer program stored in the memory, wherein the computer program is configured to implement the steps of the method according to any one of claims 1 to 13 when called by the processor.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is configured to implement the steps of the method according to any one of claims 1 to 13 when called by a processor.