Only set/clear voicemail_event when voicemail is detected
This commit is contained in:
@@ -280,10 +280,12 @@ class ClassificationProcessor(FrameProcessor):
|
|||||||
|
|
||||||
elif isinstance(frame, UserStartedSpeakingFrame):
|
elif isinstance(frame, UserStartedSpeakingFrame):
|
||||||
# User started speaking - set the voicemail event
|
# User started speaking - set the voicemail event
|
||||||
|
if self._voicemail_detected:
|
||||||
self._voicemail_event.set()
|
self._voicemail_event.set()
|
||||||
|
|
||||||
elif isinstance(frame, UserStoppedSpeakingFrame):
|
elif isinstance(frame, UserStoppedSpeakingFrame):
|
||||||
# User stopped speaking - clear the voicemail event
|
# User stopped speaking - clear the voicemail event
|
||||||
|
if self._voicemail_detected:
|
||||||
self._voicemail_event.clear()
|
self._voicemail_event.clear()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user