diff --git a/script.py b/script.py index 63656a8..217ee60 100644 --- a/script.py +++ b/script.py @@ -3,7 +3,7 @@ import cv2 import numpy as np import os import random -import simpleaudio as sa +import vlc import time import board import busio @@ -95,10 +95,13 @@ def showImage(file): def play_audio(file): clear_frame() - sound = sa.WaveObject.from_wave_file(file) - play_obj = sound.play() - while play_obj.is_playing(): + p = vlc.MediaPlayer(file) + p.play() + + time.sleep(.1) + + while p.is_playing(): # Add a small delay to prevent high CPU usage time.sleep(0.1)