I'm building a simple script and I want it to play one background music file. It works fine but I just can't get it to compile with audio.mp3 file into a standalone .exe file.
I am running a batch file with this:
pyinstaller --add-data audio.mp3;. --onefile script.py
pause
Script:
import time
import sys
import os
from pygame import mixer
init()
#audio
mixer.init()
mixer.music.load("audio.mp3")
mixer.music.play()
When I start the script.exe I get the following error:
...couldn't open 'audio.mp3'
[10012] Failed to execute script 4