By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,319 Members | 1,963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,319 IT Pros & Developers. It's quick & easy.

Pygame loading .mp3 Couldn't Read File Error

P: 1
Hi All, I've been stuck here for some time now and can't figure this out. If ANYONE can assist me, that would be AMAZING!!

I have Windows XP, with Python 25 and Pygame for python 25. I am also coding this in Eclipse
-----------------------------------------
My music files are:
D:\My Documents\School Work\Comp 523\Projects\MediaPlayer\MediaPlayer\src\MediaPlay er\Music\one.mp3
-----------------------------------------
My Project files are:
D:\My Documents\School Work\Comp 523\Projects\MediaPlayer\MediaPlayer\src\MediaPlay er
------------------------------
Here is my code:

import pygame

pygame.init()
pygame.mixer.init()


print "Mixer Settings"
print "Mixer Channels"
filename = "D:\My Documents\School Work\Comp 523\Projects\MediaPlayer\MediaPlayer\src\MediaPlay er\Music\klaxons.mp3"

pygame.mixer.music.load(filename)

pygame.mixer.music.play()

print "Play"


while pygame.mixer.music.get_busy():
print "Playing"

print "Done"

---------------------
Here is the error:

Mixer Settings
Mixer Channels
Traceback (most recent call last):
File "D:\My Documents\School Work\Comp 523\Projects\MediaPlayer\MediaPlayer\src\MediaPlay er\RandomJukebox.py", line 12, in <module>
pygame.mixer.music.load(filename)
pygame.error: Couldn't read from 'D:\My Documents\School Work\Comp 523\Projects\MediaPlayer\MediaPlayer\src\MediaPlay er\Music\one.mp3'

----------------------
I have also removed the id3 tags from the song as well

Please HELP!!! Thanks
Feb 18 '08 #1
Share this Question
Share on Google+
1 Reply


Subsciber123
P: 87
First, use forward slashes. Second, you have a space in the word "play er". I don't know if that is the problem or not. Those are the only things that I can see.
Apr 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.