Skip to content

Commit 648055d

Browse files
author
arch
committed
fix exception source by removing playsound for now
1 parent 451cc53 commit 648055d

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

funscript_editor/algorithms/funscriptgenerator.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ def min_max_selector(self,
296296
cv2.putText(image, "Use 'space' to quit and set the trackbar values",
297297
(self.x_text_start, 100), cv2.FONT_HERSHEY_SIMPLEX, self.font_size, (255,0,0), 2)
298298

299-
beep_thread = threading.Thread(target=self.beep)
300-
beep_thread.start()
299+
# beep_thread = threading.Thread(target=self.beep)
300+
# beep_thread.start()
301301
self.clear_keypress_queue()
302302
trackbarValueMin = lower_limit
303303
trackbarValueMax = upper_limit
@@ -320,11 +320,13 @@ def min_max_selector(self,
320320

321321
def beep(self) -> None:
322322
""" Play an sound to signal an event """
323-
if NOTIFICATION_SOUND_FILE is not None:
324-
if os.path.exists(NOTIFICATION_SOUND_FILE):
325-
playsound(NOTIFICATION_SOUND_FILE)
326-
else:
327-
self.logger.warning("Notification sound file not found (%s)", NOTIFICATION_SOUND_FILE)
323+
if False:
324+
# we have problems on windows with this
325+
if NOTIFICATION_SOUND_FILE is not None:
326+
if os.path.exists(NOTIFICATION_SOUND_FILE):
327+
playsound(NOTIFICATION_SOUND_FILE)
328+
else:
329+
self.logger.warning("Notification sound file not found (%s)", NOTIFICATION_SOUND_FILE)
328330

329331

330332
def calculate_score(self, bboxes) -> None:
@@ -858,8 +860,8 @@ def tracking(self) -> str:
858860

859861
scene_change_quit_flag = False
860862
if scene_detector.is_scene_change(frame_num-1 + self.params.start_frame):
861-
beep_thread = threading.Thread(target=self.beep)
862-
beep_thread.start()
863+
# beep_thread = threading.Thread(target=self.beep)
864+
# beep_thread.start()
863865
cv2.putText(last_frame, "Scene change detected, Press 'space' to continue tracking or press 'q' to finalize tracking",
864866
(self.x_text_start, 75), cv2.FONT_HERSHEY_SIMPLEX, self.font_size, (255,0,0), 2)
865867
cv2.imshow(self.window_name, self.preview_scaling(last_frame))

funscript_editor/config/settings.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ preview_scaling: 0.6
1818
tracker: 'CSRT'
1919

2020
# Specify the wav file to play when tracking finished (write 'off' to disable the sound notification)
21-
notification_sound: 'sound_notification.wav'
21+
# This feature was removed in v0.1.1 due to problems on windows
22+
notification_sound: 'off'
2223

2324
# Time in milliseconds at which the tracking is stopped if the selected feature is not found
2425
tracking_lost_time: 0

funscript_editor/ui/funscript_generator_window.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ def __funscript_generated(self, funscript, msg, success) -> None:
106106

107107
self.__logger.info("Save result to %s", self.output_file)
108108
if not success: self.__show_message(msg, error=True)
109-
if platform.system() == "Windows":
110-
# On windows i have problems to close the process
111-
# Workaround we kill with taskkill
112-
os.system('taskkill /f /im funscript-editor.exe')
113-
os._exit(os.EX_OK)
109+
if False:
110+
if platform.system() == "Windows":
111+
# On windows i have problems to close the process
112+
# Workaround we kill with taskkill
113+
os.system('taskkill /f /im funscript-editor.exe')
114+
os._exit(os.EX_OK)
115+
sys.exit()
114116

115117

116118
def run(self) -> None:

0 commit comments

Comments
 (0)