Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mrywhh
Real-Time-Voice-Cloning
提交
62a887f7
R
Real-Time-Voice-Cloning
项目概览
mrywhh
/
Real-Time-Voice-Cloning
落后 Fork 源项目 12 个版本
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Real-Time-Voice-Cloning
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
62a887f7
编写于
5月 21, 2019
作者:
C
Corentin Jemine
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Backup of the encoder (1M steps)
上级
9692bea9
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
17 deletion
+18
-17
sv2tts/demo_sv2tts.py
sv2tts/demo_sv2tts.py
+1
-1
sv2tts/encoder/audio.py
sv2tts/encoder/audio.py
+14
-14
sv2tts/encoder/inference.py
sv2tts/encoder/inference.py
+1
-0
sv2tts/encoder/saved_models/pretrained.pt
sv2tts/encoder/saved_models/pretrained.pt
+0
-0
sv2tts/synthesizer/audio.py
sv2tts/synthesizer/audio.py
+0
-0
sv2tts/synthesizer/preprocess.py
sv2tts/synthesizer/preprocess.py
+2
-2
未找到文件。
sv2tts/demo_sv2tts.py
浏览文件 @
62a887f7
from
synthesizer.
datasets.
audio
import
inv_mel_spectrogram
from
synthesizer.audio
import
inv_mel_spectrogram
from
synthesizer.hparams
import
hparams
from
synthesizer
import
synthesizer
import
sounddevice
as
sd
...
...
sv2tts/encoder/audio.py
浏览文件 @
62a887f7
...
...
@@ -3,11 +3,11 @@ import matplotlib.pyplot as plt
import
librosa.display
import
librosa
import
numpy
as
np
import
sounddevice
import
webrtcvad
import
struct
from
encoder.params_data
import
*
int16_max
=
(
2
**
15
)
-
1
def
load
(
fpath
):
...
...
@@ -121,16 +121,16 @@ def plot_mel_filterbank(frames):
plt
.
tight_layout
()
plt
.
show
()
def
play_wave
(
wav
,
blocking
=
False
):
sounddevice
.
stop
()
sounddevice
.
play
(
wav
,
sampling_rate
,
blocking
=
blocking
)
def
rec_wave
(
duration
,
blocking
=
True
,
verbose
=
True
):
if
verbose
:
print
(
"Recording %d seconds of audio"
%
duration
)
wav
=
sounddevice
.
rec
(
duration
*
sampling_rate
,
sampling_rate
,
1
)
if
blocking
:
sounddevice
.
wait
()
if
verbose
:
print
(
"Done recording!"
)
return
wav
.
squeeze
()
#
def play_wave(wav, blocking=False):
#
sounddevice.stop()
#
sounddevice.play(wav, sampling_rate, blocking=blocking)
#
#
def rec_wave(duration, blocking=True, verbose=True):
#
if verbose:
#
print("Recording %d seconds of audio" % duration)
#
wav = sounddevice.rec(duration * sampling_rate, sampling_rate, 1)
#
if blocking:
#
sounddevice.wait()
#
if verbose:
#
print("Done recording!")
#
return wav.squeeze()
sv2tts/encoder/inference.py
浏览文件 @
62a887f7
...
...
@@ -9,6 +9,7 @@ from matplotlib import cm
_model
=
None
# type: SpeakerEncoder
_device
=
None
# type: torch.device
def
load_model
(
weights_fpath
,
device
=
None
):
"""
Loads the model in memory. If this function is not explicitely called, it will be run on the
...
...
sv2tts/encoder/saved_models/pretrained.pt
浏览文件 @
62a887f7
无法预览此类型文件
sv2tts/synthesizer/
datasets/
audio.py
→
sv2tts/synthesizer/audio.py
浏览文件 @
62a887f7
文件已移动
sv2tts/synthesizer/
datasets/preprocessor
.py
→
sv2tts/synthesizer/
preprocess
.py
浏览文件 @
62a887f7
...
...
@@ -2,7 +2,7 @@ from synthesizer.datasets import audio
from
multiprocessing.pool
import
Pool
from
functools
import
partial
from
itertools
import
chain
from
encoder
import
inference
as
speaker_encoder
#
from encoder import inference as speaker_encoder
from
pathlib
import
Path
from
tqdm
import
tqdm
import
numpy
as
np
...
...
@@ -32,7 +32,7 @@ def preprocess_librispeech(datasets_root: Path, out_dir: Path, wav_out_dir: Path
speaker_dirs
=
list
(
chain
.
from_iterable
(
input_dir
.
glob
(
"*"
)
for
input_dir
in
input_dirs
))
func
=
partial
(
preprocess_speaker
,
mel_out_dir
=
mel_out_dir
,
wav_out_dir
=
wav_out_dir
,
skip_existing
=
skip_existing
,
hparams
=
hparams
)
job
=
Pool
().
imap
(
func
,
speaker_dirs
)
job
=
Pool
(
1
).
imap
(
func
,
speaker_dirs
)
for
speaker_metadata
in
tqdm
(
job
,
"LibriSpeech"
,
len
(
speaker_dirs
),
unit
=
"speakers"
):
for
metadatum
in
speaker_metadata
:
metadata_file
.
write
(
"|"
.
join
(
str
(
x
)
for
x
in
metadatum
)
+
"
\n
"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录