Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
76b7616f
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看板
提交
76b7616f
编写于
7月 19, 2022
作者:
Y
YangZhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix _paddleaudio import
上级
38c55e44
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
16 deletion
+10
-16
paddlespeech/audio/_extension.py
paddlespeech/audio/_extension.py
+4
-4
paddlespeech/audio/kaldi/kaldi.py
paddlespeech/audio/kaldi/kaldi.py
+6
-12
未找到文件。
paddlespeech/audio/_extension.py
浏览文件 @
76b7616f
...
@@ -120,7 +120,7 @@ def _init_ffmpeg():
...
@@ -120,7 +120,7 @@ def _init_ffmpeg():
if
_FFMPEG_INITIALIZED
:
if
_FFMPEG_INITIALIZED
:
return
return
if
not
paddlespeech
.
audio
.
paddlleaudio
.
is_ffmpeg_available
():
if
not
paddlespeech
.
audio
.
_
paddlleaudio
.
is_ffmpeg_available
():
raise
RuntimeError
(
raise
RuntimeError
(
"paddlleaudio is not compiled with FFmpeg integration. Please set USE_FFMPEG=1 when compiling paddlleaudio."
"paddlleaudio is not compiled with FFmpeg integration. Please set USE_FFMPEG=1 when compiling paddlleaudio."
)
)
...
@@ -133,9 +133,9 @@ def _init_ffmpeg():
...
@@ -133,9 +133,9 @@ def _init_ffmpeg():
import
paddllespeech
.
audio
.
_paddlleaudio_ffmpeg
# noqa
import
paddllespeech
.
audio
.
_paddlleaudio_ffmpeg
# noqa
paddlespeech
.
audio
.
paddlleaudio
.
ffmpeg_init
()
paddlespeech
.
audio
.
_
paddlleaudio
.
ffmpeg_init
()
if
paddlespeech
.
audio
.
paddlleaudio
.
ffmpeg_get_log_level
()
>
8
:
if
paddlespeech
.
audio
.
_
paddlleaudio
.
ffmpeg_get_log_level
()
>
8
:
paddlespeech
.
audio
.
paddlleaudio
.
ffmpeg_set_log_level
(
8
)
paddlespeech
.
audio
.
_
paddlleaudio
.
ffmpeg_set_log_level
(
8
)
_FFMPEG_INITIALIZED
=
True
_FFMPEG_INITIALIZED
=
True
...
...
paddlespeech/audio/kaldi/kaldi.py
浏览文件 @
76b7616f
...
@@ -13,12 +13,6 @@
...
@@ -13,12 +13,6 @@
# limitations under the License.
# limitations under the License.
from
paddlespeech.audio._internal
import
module_utils
from
paddlespeech.audio._internal
import
module_utils
from
paddlespeech.audio._paddleaudio
import
ComputeFbank
as
ComputeFbank
from
paddlespeech.audio._paddleaudio
import
PitchExtractionOptions
as
PitchExtractionOptions
from
paddlespeech.audio._paddleaudio
import
FrameExtractionOptions
as
FrameExtractionOptions
from
paddlespeech.audio._paddleaudio
import
MelBanksOptions
as
MelBanksOptions
from
paddlespeech.audio._paddleaudio
import
FbankOptions
as
FbankOptions
from
paddlespeech.audio._paddleaudio
import
ComputeKaldiPitch
as
ComputeKaldiPitch
__all__
=
[
__all__
=
[
'fbank'
,
'fbank'
,
...
@@ -55,9 +49,9 @@ def fbank(
...
@@ -55,9 +49,9 @@ def fbank(
htk_compat
:
bool
=
False
,
htk_compat
:
bool
=
False
,
use_log_fbank
:
bool
=
True
,
use_log_fbank
:
bool
=
True
,
use_power
:
bool
=
True
):
use_power
:
bool
=
True
):
frame_opts
=
FrameExtractionOptions
()
frame_opts
=
paddlespeech
.
audio
.
_paddleaudio
.
FrameExtractionOptions
()
mel_opts
=
MelBanksOptions
()
mel_opts
=
paddlespeech
.
audio
.
_paddleaudio
.
MelBanksOptions
()
fbank_opts
=
FbankOptions
()
fbank_opts
=
paddlespeech
.
audio
.
_paddleaudio
.
FbankOptions
()
frame_opts
.
samp_freq
=
samp_freq
frame_opts
.
samp_freq
=
samp_freq
frame_opts
.
frame_shift_ms
=
frame_shift_ms
frame_opts
.
frame_shift_ms
=
frame_shift_ms
frame_opts
.
frame_length_ms
=
frame_length_ms
frame_opts
.
frame_length_ms
=
frame_length_ms
...
@@ -86,7 +80,7 @@ def fbank(
...
@@ -86,7 +80,7 @@ def fbank(
fbank_opts
.
htk_compat
=
htk_compat
fbank_opts
.
htk_compat
=
htk_compat
fbank_opts
.
use_log_fbank
=
use_log_fbank
fbank_opts
.
use_log_fbank
=
use_log_fbank
fbank_opts
.
use_power
=
use_power
fbank_opts
.
use_power
=
use_power
feat
=
Co
mputeFbank
(
frame_opts
,
mel_opts
,
fbank_opts
,
wav
)
feat
=
paddlespeech
.
audio
.
_paddleaudio
.
Cop
mputeFbank
(
frame_opts
,
mel_opts
,
fbank_opts
,
wav
)
return
feat
return
feat
...
@@ -112,7 +106,7 @@ def pitch(wav,
...
@@ -112,7 +106,7 @@ def pitch(wav,
recompute_frame
:
int
=
500
,
recompute_frame
:
int
=
500
,
nccf_ballast_online
:
bool
=
False
,
nccf_ballast_online
:
bool
=
False
,
snip_edges
:
bool
=
True
):
snip_edges
:
bool
=
True
):
pitch_opts
=
PitchExtractionOptions
()
pitch_opts
=
paddlespeech
.
audio
.
_paddleaudio
.
PitchExtractionOptions
()
pitch_opts
.
samp_freq
=
samp_freq
pitch_opts
.
samp_freq
=
samp_freq
pitch_opts
.
frame_shift_ms
=
frame_shift_ms
pitch_opts
.
frame_shift_ms
=
frame_shift_ms
pitch_opts
.
frame_length_ms
=
frame_length_ms
pitch_opts
.
frame_length_ms
=
frame_length_ms
...
@@ -133,5 +127,5 @@ def pitch(wav,
...
@@ -133,5 +127,5 @@ def pitch(wav,
pitch_opts
.
recompute_frame
=
recompute_frame
pitch_opts
.
recompute_frame
=
recompute_frame
pitch_opts
.
nccf_ballast_online
=
nccf_ballast_online
pitch_opts
.
nccf_ballast_online
=
nccf_ballast_online
pitch_opts
.
snip_edges
=
snip_edges
pitch_opts
.
snip_edges
=
snip_edges
pitch
=
ComputeKaldiPitch
(
pitch_opts
,
wav
)
pitch
=
paddlespeech
.
audio
.
_paddleaudio
.
ComputeKaldiPitch
(
pitch_opts
,
wav
)
return
pitch
return
pitch
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录