My code is an auto notification system. The audio file I used with my code s in the same directory as the Python file. But when I run the code, playsound
says file not found.
import schedule
import time
from playsound import playsound
#define functions
def g_assembly():
#play sound when function is called
playsound("trialvoice.mp3")
def greet():
playsound("trialvoice.mp3")
#initiate schedule
schedule.every().friday.at('15:55').do(g_assembly)
schedule.every().friday.at('15:56').do(greet)
#keep schedule running
while True:
schedule.run_pending()
time.sleep(1)
this is the error below:
Error 275 for command:
open "trialvoice.mp3" alias playsound_0.9746097500934046
Cannot find the specified file. Make sure the path and filename are correct.
Process finished with exit code 1