feat: save_voice_and_speak 优化

This commit is contained in:
caoqianming 2024-10-08 15:10:42 +08:00
parent 40c6479cf3
commit 494b078a09
1 changed files with 3 additions and 4 deletions

View File

@ -159,10 +159,9 @@ def save_voice_and_speak(event: Event):
if event.voice: # 如果已经生成了报警声音不用再请求 if event.voice: # 如果已经生成了报警声音不用再请求
pass pass
else: else:
if getattr(settings, 'BD_SP_ENABLED', False): _, event.voice, _ = generate_voice(event.voice_msg, v_p)
_, event.voice, _ = generate_voice(event.voice_msg, v_p) event.save()
event.save() if main_cate.speaker_on and event.voice:
if main_cate.speaker_on:
sps = [] sps = []
if event.area: # 如果事件存在发生区域 if event.area: # 如果事件存在发生区域
sps = list(TDevice.objects.filter(area=event.area, sps = list(TDevice.objects.filter(area=event.area,