I created a virtual assistant which can search for things for me online, open specific websites, open applications like word, powerpoint, etc.. using Python 3.6 on Windows 10. I have successfully converted it into .exe file and it's running smoothly BUT it doesn't play sound clips I included with my code. I put the sounds on the same directory as my code before I converted it to exe. Instead of playing the sound, it was replaced by the sound of windows when you are trying to run an application as ADMINISTRATOR (i hope this does make sense). Is there any way I can fix this or can Pyinstaller mix my code with the audio? Thanks for any help!
I've never tried anything aside from re-converting it because removing the audio file from the directory won't make any sense.
this is the part of my code that plays sounds. if anyone of you wants/needs to see my entire code (it has 500 lines) just tell me and I will provide it.
elif "toss a coin" in recog1.recognize_google(audio, language="en-US"):
coin = ["HEADS", "TAILS"]
engine.say("Tossing a coin...")
engine.runAndWait()
winsound.PlaySound("coin_toss.wav", winsound.SND_FILENAME)
engine.say("The coin toss shows" + random.choice(coin))
engine.runAndWait()
elif "roll a die" in recog1.recognize_google(audio, language="en-US"):
engine.say("Rolling a die")
engine.runAndWait()
winsound.PlaySound("roll_die", winsound.SND_FILENAME)
engine.say("The die result shows " + str(random.randint(0, 6)))
engine.runAndWait()
when I run this on my IDE (Pycharm) it works flawlessly but when I run it on the command line, it runs too but the audio doesn't work.