0

I have written a simple Python code with pygame and I am using an MP3 file from my local PC in it. But I want to share this script as an exe file, So how do I add the music to the exe file that it doesn't give an error when the exe is executed.

mixer.pre_init(frequency=48000, size=-16, channels=2, buffer=512)
mixer.init()
mixer.music.load(r"C:\Users\dayana.ramesh\Documents\Undiporaadhey.mp3")

This is the part where I am using the MP3 file.

eyllanesc
  • 221,139
  • 17
  • 121
  • 189
  • 3
    you need to package it with the file in a local directory. Same as any other `.py` or `.png`. An example project structure. `src/assets/sound/Undiporaadhey.mp3` – TheLazyScripter Oct 23 '21 at 19:00

0 Answers0