Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[audio] fix load paddleaudio fail #2815

Merged
merged 6 commits into from
Jan 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions audio/paddleaudio/_internal/module_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ def wrapped(*args, **kwargs):


def is_kaldi_available():
return is_module_available("paddleaudio._paddleaudio")

try:
from paddleaudio import _paddleaudio
return True
except Exception:
return False

def requires_kaldi():
if is_kaldi_available():
Expand Down Expand Up @@ -128,9 +131,11 @@ def wrapped(*args, **kwargs):


def is_sox_available():
if platform.system() == "Windows": # not support sox in windows
try:
from paddleaudio import _paddleaudio
return True
except Exception:
return False
return is_module_available("paddleaudio._paddleaudio")


def requires_sox():
Expand Down