From cdf7e5591d69e099a28e19319d13a7f445e5cafc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Tue, 27 Aug 2024 22:50:22 +0800 Subject: [PATCH] fix --- LunaTranslator/LunaTranslator/myutils/audioplayer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LunaTranslator/LunaTranslator/myutils/audioplayer.py b/LunaTranslator/LunaTranslator/myutils/audioplayer.py index 3066b19e..065d599d 100644 --- a/LunaTranslator/LunaTranslator/myutils/audioplayer.py +++ b/LunaTranslator/LunaTranslator/myutils/audioplayer.py @@ -63,7 +63,11 @@ class playonce: return False if not self.channel_length: return False + if self.channel_length == -1: + return False channel_position = BASS_ChannelGetPosition(self.handle, BASS_POS_BYTE) + if channel_position == -1: + return False return channel_position < self.channel_length def __play(self, fileormem, volume):