From 74ece85b0a500eb59f9f588aa93f02e1e9d9c36a Mon Sep 17 00:00:00 2001 From: zty Date: Wed, 9 Oct 2024 10:00:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20import=20edge=5Ftts=20=E5=9C=A8=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E4=B8=AD=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/utils/speech.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: