Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
b72b70e5
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看板
提交
b72b70e5
编写于
7月 28, 2017
作者:
L
Luo Tao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add soundfile read/write unitest
上级
7d7984b8
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
26 addition
and
14 deletion
+26
-14
.gitignore
.gitignore
+0
-1
setup.sh
setup.sh
+13
-11
tests/test_setup.py
tests/test_setup.py
+13
-2
未找到文件。
.gitignore
已删除
100644 → 0
浏览文件 @
7d7984b8
thirdparty
setup.sh
浏览文件 @
b72b70e5
...
@@ -10,19 +10,21 @@ if [ $? != 0 ]; then
...
@@ -10,19 +10,21 @@ if [ $? != 0 ]; then
fi
fi
# install package libsndfile
# install package libsndfile
DIR
=
"
$(
cd
"
$(
dirname
"
$0
"
)
"
;
pwd
-P
)
"
python
-c
"import soundfile"
mkdir
thirdparty
curl
-O
"http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz"
if
[
$?
!=
0
]
;
then
if
[
$?
!=
0
]
;
then
echo
"Install package libsndfile into default system path."
curl
-O
"http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz"
if
[
$?
!=
0
]
;
then
echo
"Download libsndfile-1.0.28.tar.gz failed !!!"
echo
"Download libsndfile-1.0.28.tar.gz failed !!!"
exit
1
exit
1
fi
tar
-zxvf
libsndfile-1.0.28.tar.gz
cd
libsndfile-1.0.28
./configure
&&
make
&&
make
install
cd
..
rm
-rf
libsndfile-1.0.28
rm
libsndfile-1.0.28.tar.gz
fi
fi
tar
-zxvf
libsndfile-1.0.28.tar.gz
cd
libsndfile-1.0.28
./configure
--prefix
=
$DIR
/thirdparty/libsndfile
&&
make
&&
make
install
cd
..
rm
-rf
libsndfile-1.0.28
rm
libsndfile-1.0.28.tar.gz
# prepare ./checkpoints
# prepare ./checkpoints
mkdir
checkpoints
mkdir
checkpoints
...
...
tests/test_setup.py
浏览文件 @
b72b70e5
"""Test Setup."""
"""Test Setup."""
import
unittest
import
unittest
import
numpy
as
np
import
os
class
TestSetup
(
unittest
.
TestCase
):
class
TestSetup
(
unittest
.
TestCase
):
# test the installation of libsndfile library
def
test_soundfile
(
self
):
def
test_soundfile
(
self
):
import
soundfile
import
soundfile
as
sf
# floating point data is typically limited to the interval [-1.0, 1.0],
# but smaller/larger values are supported as well
data
=
np
.
array
([[
1.75
,
-
1.75
],
[
1.0
,
-
1.0
],
[
0.5
,
-
0.5
],
[
0.25
,
-
0.25
]])
file
=
'test.wav'
sf
.
write
(
file
,
data
,
44100
,
format
=
'WAV'
,
subtype
=
'FLOAT'
)
read
,
fs
=
sf
.
read
(
file
)
assert
np
.
all
(
read
==
data
)
assert
fs
==
44100
os
.
remove
(
file
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录