diff --git a/apps/utils/speech.py b/apps/utils/speech.py index 9925f4c6..fcf0f0a0 100644 --- a/apps/utils/speech.py +++ b/apps/utils/speech.py @@ -3,7 +3,6 @@ from django.conf import settings import uuid import os from django.utils import timezone -import edge_tts from asgiref.sync import async_to_sync @@ -34,6 +33,7 @@ def generate_voice(msg: str, per: int = 0): f.write(result) return True, path + file_name, None elif getattr(settings, 'EDGE_TTS_ENABLED', False): + import edge_tts if per == 0: per = 'zh-CN-XiaoxiaoNeural' else: