From 3c0ae770495db3c0d3970b10309c721c6f8d5c53 Mon Sep 17 00:00:00 2001 From: from-north-to-north <2692032597@qq.com> Date: Fri, 14 Oct 2022 00:16:38 +0800 Subject: [PATCH] Modify the readme --- .../speexdsp/README_zh.md | 0 .../speexdsp_Functional test documentation.md | 42 +++++++++---------- 2 files changed, 19 insertions(+), 23 deletions(-) delete mode 100644 2022_OpenHarmony_thirdparty/speexdsp/README_zh.md diff --git a/2022_OpenHarmony_thirdparty/speexdsp/README_zh.md b/2022_OpenHarmony_thirdparty/speexdsp/README_zh.md deleted file mode 100644 index e69de29b..00000000 diff --git a/2022_OpenHarmony_thirdparty/speexdsp/speexdsp_Functional test documentation.md b/2022_OpenHarmony_thirdparty/speexdsp/speexdsp_Functional test documentation.md index 57c573a1..9c7a6c26 100755 --- a/2022_OpenHarmony_thirdparty/speexdsp/speexdsp_Functional test documentation.md +++ b/2022_OpenHarmony_thirdparty/speexdsp/speexdsp_Functional test documentation.md @@ -1,6 +1,6 @@ # Speexdsp测试说明 -## 主要功能 +## 已测试功能 重采样、预处理、回声消除、抖动缓冲。 @@ -77,38 +77,31 @@ ## 测试逻辑 -在speexdsp原生库的libspeexdsp目录下有原生的测试源文件testresample.c、testresample2.c、testecho.c、testdenoise.c、testjitter.c。分别测试的是如下四个功能: +### 通过原生库示例程序测试 -### 重采样功能 - -1.重采样器能将一个音频从一个采样率转换到另一个采样率。 - -2.运行测试重采样率的可执行文件时,输入一份音频文件的同时需要指定处理后输出的音频文件。 +在speexdsp原生库的libspeexdsp目录下有原生的测试示例程序,在rk3568开发板上运行均成功,运行结果均符合示例程序要求,且运行效果与pc端运行效果一致。speexdsp原生库的libspeexdsp目录下有原生的测试源文件testresample.c、testresample2.c、testecho.c、testdenoise.c、testjitter.c。分别测试的是如下四个功能: -3.测试重采样功能的源文件为testresample.c和testresample2.c。 +### 重采样测试 -### 回声消除功能 +- 测试重采样功能的源文件为testresample.c和testresample2.c运行测试重采样率的可执行文件时,输入一份音频文件的同时需要指定处理后输出的音频文件。 -1.回声消除器设计用于在声学回声发送到远端之前消除它。 +- testresample.c程序调用speexdsp提供的speex_resampler_set_rate(SpeexResamplerState *st, spx_uint32_t in_rate, spx_uint32_t out_rate)方法,testresample.c中指定96000是输入音频的采样率,44100是输出音频的采样率(单位为Hz) -2.运行测试回声消除的可执行文件时,需要输入两段音频文件,分别为一份麦克风的音频、一份speaker的音频。另外需要指定一份处理后输出的音频文件。 +### 回声消除测试 -3.测试回声消除功能的源文件为testecho.c。 - -### 预处理功能 - -1.预处理包括噪声抑制、自动增益控制(AGC)、语音活动检测(VAD)等功能。 +- 测试回声消除的源程序为testecho.c。运行测试回声消除的可执行文件时,需要输入两段音频文件,分别为一份麦克风的音频、一份speaker的音频。另外需要指定一份处理后输出的音频文件。 -2.运行测试预处理功能的可执行文件时,输入一份音频文件的同时需要指定处理后输出的音频文件。 +- testecho.c中调用speex_echo_cancellation(echo_state, input_frame, echo_frame, output_frame)方法进行回声消除。 -3.测试源文件testdenoise.c测试的是预处理功能中的噪声抑制。 +### 预处理测试 + +- 测试源文件testdenoise.c测试的是预处理功能中的噪声抑制。运行测试预处理功能的可执行文件时,输入一份音频文件的同时需要指定处理后输出的音频文件。 -### 抖动缓冲功能 -当通过UDP或RTP传输语音(或任何相关内容)时,包可能会丢失,以不同的延迟到达,甚至乱序。 +- testdenoise.c中调用speex_preprocess_ctl(preprocess_state, request, ptr)方法控制预处理器的行为,从而达到噪声消除的目的。 -1.抖动缓冲区的目的是重新排序数据包,并缓冲足够长的时间,以便它们可以被发送以进行解码。 +### 抖动缓冲测试 -2.测试源文件testjitter.c,这个去抖动测试需要接收来自udp/rtp的网络语音数据,原生测试程序没有做到真正意义上的测试,从程序上看是告诉用户如何使用接口。 +- 测试源文件testjitter.c,这个去抖动测试需要接收来自udp/rtp的网络语音数据,原生测试程序没有做到真正意义上的测试,从程序上看是告诉用户如何使用接口。 ## 测试步骤 @@ -145,6 +138,7 @@ cp libspeexdsp_share.z.so /system/lib64/ 这里测试testresample时,将一份录好的96000Hz单声道音频文件input.pcm和空白的单声道音频文件output.pcm拷贝至开发板speexdsp目录。 执行语句如下 + ``` chmod 777 testresample ## 添加可执行权限 ./testresample < input.pcm > output.pcm @@ -159,11 +153,13 @@ chmod 777 testresample ## 添加可执行权限 测试testresample2时,需要把空白的单声道音频文件output.pcm拷贝至开发板speexdsp目录。 执行语句如下: + ``` ./testresample2 > output.pcm ``` **测试结果**:输出一份不为空的output.pcm音频文件,并且在终端输出文本如下: + ``` 1000 0 1024 22 -> 1024 0 1100 0 1024 24 -> 1024 15 @@ -231,4 +227,4 @@ Frozen sender: Jitter 0 2. 测试接口: - 参考[speexdsp_tested_api.txt](./speexdsp_tested_api.txt) \ No newline at end of file + 参考[speexdsp_tested_api.txt](./speexdsp_tested_api.txt) -- Gitee