From 6f11dd9302e7017b4f54706bc92cc952e53dda7f Mon Sep 17 00:00:00 2001 From: from-north-to-north <2692032597@qq.com> Date: Thu, 13 Oct 2022 21:53:46 +0800 Subject: [PATCH] fix speexdsp Signed-off-by: from-north-to-north <2692032597@qq.com> --- .../speexdsp/README_zh.md | 0 .../speexdsp_Functional test documentation.md | 43 +++++++++---------- 2 files changed, 20 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..2679b920 100755 --- a/2022_OpenHarmony_thirdparty/speexdsp/speexdsp_Functional test documentation.md +++ b/2022_OpenHarmony_thirdparty/speexdsp/speexdsp_Functional test documentation.md @@ -77,43 +77,33 @@ ## 测试逻辑 -在speexdsp原生库的libspeexdsp目录下有原生的测试源文件testresample.c、testresample2.c、testecho.c、testdenoise.c、testjitter.c。分别测试的是如下四个功能: +在speexdsp原生库的libspeexdsp目录下有原生的测试源文件testresample.c、testresample2.c、testecho.c、testdenoise.c、testjitter.c -### 重采样功能 - -1.重采样器能将一个音频从一个采样率转换到另一个采样率。 - -2.运行测试重采样率的可执行文件时,输入一份音频文件的同时需要指定处理后输出的音频文件。 +### 重采样功能测试逻辑 -3.测试重采样功能的源文件为testresample.c和testresample2.c。 +1.测试重采样功能的源文件为testresample.c和testresample2.c。 -### 回声消除功能 - -1.回声消除器设计用于在声学回声发送到远端之前消除它。 +2.运行测试重采样率的可执行文件时,输入一份音频文件的同时需要指定处理后输出的音频文件。 -2.运行测试回声消除的可执行文件时,需要输入两段音频文件,分别为一份麦克风的音频、一份speaker的音频。另外需要指定一份处理后输出的音频文件。 +### 回声消除功能测试逻辑 -3.测试回声消除功能的源文件为testecho.c。 +1.运行测试回声消除的可执行文件时,需要输入两段音频文件,分别为一份麦克风的音频、一份speaker的音频。另外需要指定一份处理后输出的音频文件。 -### 预处理功能 +### 预处理功能测试逻辑 + +1.测试源文件testdenoise.c测试的是预处理功能中的噪声抑制。 -1.预处理包括噪声抑制、自动增益控制(AGC)、语音活动检测(VAD)等功能。 - 2.运行测试预处理功能的可执行文件时,输入一份音频文件的同时需要指定处理后输出的音频文件。 -3.测试源文件testdenoise.c测试的是预处理功能中的噪声抑制。 - -### 抖动缓冲功能 -当通过UDP或RTP传输语音(或任何相关内容)时,包可能会丢失,以不同的延迟到达,甚至乱序。 - -1.抖动缓冲区的目的是重新排序数据包,并缓冲足够长的时间,以便它们可以被发送以进行解码。 +### 抖动缓冲功能测试逻辑 -2.测试源文件testjitter.c,这个去抖动测试需要接收来自udp/rtp的网络语音数据,原生测试程序没有做到真正意义上的测试,从程序上看是告诉用户如何使用接口。 +1.测试源文件testjitter.c,这个去抖动测试需要接收来自udp/rtp的网络语音数据,原生测试程序没有做到真正意义上的测试,从程序上看是告诉用户如何使用接口。 ## 测试步骤 1.通过与ohos版本匹配的hdc_std工具,将编译生成的库以及测试用的可执行文件推送到开发板上 + ``` hdc_std shell mount -o remount,rw / ## 重新加载系统为可读写 @@ -123,12 +113,14 @@ exit ## 退出开发板系统 2.将压缩包push到开发板 + ``` hdc_std file speexdsp.tar /speexdsp ``` 3.解压压缩包并将库文件拷贝到对应的目录 + ``` hdc_std shell ## 进入开发板系统 cd speexdsp @@ -145,6 +137,7 @@ cp libspeexdsp_share.z.so /system/lib64/ 这里测试testresample时,将一份录好的96000Hz单声道音频文件input.pcm和空白的单声道音频文件output.pcm拷贝至开发板speexdsp目录。 执行语句如下 + ``` chmod 777 testresample ## 添加可执行权限 ./testresample < input.pcm > output.pcm @@ -159,6 +152,7 @@ chmod 777 testresample ## 添加可执行权限 测试testresample2时,需要把空白的单声道音频文件output.pcm拷贝至开发板speexdsp目录。 执行语句如下: + ``` ./testresample2 > output.pcm ``` @@ -191,6 +185,7 @@ chmod 777 testresample ## 添加可执行权限 同时需要指定一份output.pcm输出文件。 执行语句如下: + ``` ./testecho mic1.pcm mic2.pcm output.pcm ``` @@ -214,11 +209,13 @@ chmod 777 testresample ## 添加可执行权限 通过分析testjitter.c源码,测试需要接收来自udp/rtp的网络语音数据,原生测试程序没有做到真正意义上的测试,从程序上看是告诉用户如何使用接口。 执行语句如下 + ``` ./testjitter ``` **测试结果**:终端打印出语句 + ``` Frozen sender: Jitter 0 ``` @@ -231,4 +228,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