Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
e52e061e
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 2 年 前同步成功
通知
210
Star
8425
Fork
1598
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
245
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DeepSpeech
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
245
Issue
245
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e52e061e
编写于
7月 07, 2022
作者:
Y
Yang Zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add unittest
上级
7ae36b21
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
1931 addition
and
5 deletion
+1931
-5
paddlespeech/audio/src/pybind/pybind.cpp
paddlespeech/audio/src/pybind/pybind.cpp
+0
-5
tests/unit/audio/features/fbank_feat.ark
tests/unit/audio/features/fbank_feat.ark
+942
-0
tests/unit/audio/features/pitch_feat.ark
tests/unit/audio/features/pitch_feat.ark
+942
-0
tests/unit/audio/features/test_kaldi_feat.py
tests/unit/audio/features/test_kaldi_feat.py
+46
-0
tests/unit/audio/features/wav.ark
tests/unit/audio/features/wav.ark
+1
-0
未找到文件。
paddlespeech/audio/src/pybind/pybind.cpp
浏览文件 @
e52e061e
...
@@ -13,11 +13,6 @@ PYBIND11_MODULE(_paddleaudio, m) {
...
@@ -13,11 +13,6 @@ PYBIND11_MODULE(_paddleaudio, m) {
&
paddleaudio
::
sox_io
::
get_info_fileobj
,
&
paddleaudio
::
sox_io
::
get_info_fileobj
,
"Get metadata of audio in file object."
);
"Get metadata of audio in file object."
);
// kaldi feat
// kaldi feat
m
.
def
(
"InitFbank"
,
&
paddleaudio
::
kaldi
::
InitFbank
,
"init fbank"
);
m
.
def
(
"ResetFbank"
,
&
paddleaudio
::
kaldi
::
ResetFbank
,
"reset fbank"
);
m
.
def
(
"ComputeFbank"
,
&
paddleaudio
::
kaldi
::
ComputeFbank
,
"compute fbank"
);
m
.
def
(
"ComputeFbank"
,
&
paddleaudio
::
kaldi
::
ComputeFbank
,
"compute fbank"
);
m
.
def
(
"ComputeFbankStreaming"
,
&
paddleaudio
::
kaldi
::
ComputeFbankStreaming
,
"compute fbank streaming"
);
m
.
def
(
"ComputeKaldiPitch"
,
&
paddleaudio
::
kaldi
::
ComputeKaldiPitch
,
"compute kaldi pitch"
);
m
.
def
(
"ComputeKaldiPitch"
,
&
paddleaudio
::
kaldi
::
ComputeKaldiPitch
,
"compute kaldi pitch"
);
}
}
tests/unit/audio/features/fbank_feat.ark
0 → 100644
浏览文件 @
e52e061e
此差异已折叠。
点击以展开。
tests/unit/audio/features/pitch_feat.ark
0 → 100644
浏览文件 @
e52e061e
此差异已折叠。
点击以展开。
tests/unit/audio/features/test_kaldi_feat.py
0 → 100644
浏览文件 @
e52e061e
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
unittest
import
numpy
as
np
import
paddle
import
paddlespeech.audio.kaldi.kaldi.fbank
as
fbank
import
paddlespeech.audio.kaldi.kaldi.pitch
as
pitch
import
kaldiio
import
ReadHelper
class
TestKaldiFbank
(
unittest
.
TestCase
):
def
test_fbank_pitch
(
self
):
fbank_groundtruth
=
None
pitch_groundtruth
=
None
with
ReadHelper
(
'ark:fbank_feat.ark'
)
as
reader
:
for
key
,
feat
in
reader
:
fbank_groundtruth
=
feat
with
ReadHelper
(
'ark:pitch_feat.ark'
)
as
reader
:
for
key
,
feat
in
reader
:
pitch_groundtruth
=
feat
with
ReadHelper
(
'ark:wav.ark'
)
as
reader
:
for
key
,
wav
in
reader
:
fbank_feat
=
fbank
(
wav
)
pitch_feat
=
pitch
(
wav
)
np
.
testing
.
assert_array_almost_equal
(
fbank_feat
,
fbank_groundtruth
,
decimal
=
4
)
np
.
testing
.
assert_array_almost_equal
(
pitch_feat
,
pitch_groundtruth
,
decimal
=
4
)
if
__name__
==
'__main__'
:
unittest
.
main
()
tests/unit/audio/features/wav.ark
0 → 100644
浏览文件 @
e52e061e
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录