Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
bc21a584
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
接近 1 年 前同步成功
通知
205
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bc21a584
编写于
5月 05, 2022
作者:
Y
Yang Zhou
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of github.com:SmileGoat/PaddleSpeech into add_fbank
上级
0d4018c2
a0308992
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
18 deletion
+18
-18
examples/other/mfa/local/reorganize_aishell3.py
examples/other/mfa/local/reorganize_aishell3.py
+16
-16
paddlespeech/t2s/exps/voice_cloning.py
paddlespeech/t2s/exps/voice_cloning.py
+2
-2
未找到文件。
examples/other/mfa/local/reorganize_aishell3.py
浏览文件 @
bc21a584
...
...
@@ -46,22 +46,22 @@ def write_lab(root_dir: Union[str, Path],
text_path
=
root_dir
/
sub_set
/
'content.txt'
new_dir
=
output_dir
/
sub_set
with
open
(
text_path
,
'r'
)
as
rf
:
for
line
in
rf
:
wav_id
,
context
=
line
.
strip
().
split
(
'
\t
'
)
spk_id
=
wav_id
[:
7
]
transcript_name
=
wav_id
.
split
(
'.'
)[
0
]
+
'.lab'
transcript_path
=
new_dir
/
spk_id
/
transcript_name
context_list
=
context
.
split
()
word_list
=
context_list
[
0
:
-
1
:
2
]
pinyin_list
=
context_list
[
1
::
2
]
wf
=
open
(
transcript_path
,
'w'
)
if
script_type
==
'word'
:
# add space between chinese char
new_context
=
' '
.
join
(
word_list
)
elif
script_type
==
'pinyin'
:
new_context
=
' '
.
join
(
pinyin_list
)
wf
.
write
(
new_context
+
'
\n
'
)
with
open
(
text_path
,
'r'
)
as
rf
:
for
line
in
rf
:
wav_id
,
context
=
line
.
strip
().
split
(
'
\t
'
)
spk_id
=
wav_id
[:
7
]
transcript_name
=
wav_id
.
split
(
'.'
)[
0
]
+
'.lab'
transcript_path
=
new_dir
/
spk_id
/
transcript_name
context_list
=
context
.
split
()
word_list
=
context_list
[
0
:
-
1
:
2
]
pinyin_list
=
context_list
[
1
::
2
]
wf
=
open
(
transcript_path
,
'w'
)
if
script_type
==
'word'
:
# add space between chinese char
new_context
=
' '
.
join
(
word_list
)
elif
script_type
==
'pinyin'
:
new_context
=
' '
.
join
(
pinyin_list
)
wf
.
write
(
new_context
+
'
\n
'
)
def
reorganize_aishell3
(
root_dir
:
Union
[
str
,
Path
],
...
...
paddlespeech/t2s/exps/voice_cloning.py
浏览文件 @
bc21a584
...
...
@@ -110,10 +110,10 @@ def voice_cloning(args):
print
(
f
"
{
utt_id
}
done!"
)
# Randomly generate numbers of 0 ~ 0.2, 256 is the dim of spk_emb
random_spk_emb
=
np
.
random
.
rand
(
256
)
*
0.2
random_spk_emb
=
paddle
.
to_tensor
(
random_spk_emb
)
random_spk_emb
=
paddle
.
to_tensor
(
random_spk_emb
,
dtype
=
'float32'
)
utt_id
=
"random_spk_emb"
with
paddle
.
no_grad
():
wav
=
voc_inference
(
am_inference
(
phone_ids
,
spk_emb
=
spk_emb
))
wav
=
voc_inference
(
am_inference
(
phone_ids
,
spk_emb
=
random_
spk_emb
))
sf
.
write
(
str
(
output_dir
/
(
utt_id
+
".wav"
)),
wav
.
numpy
(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录