470,596 Members | 1,573 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,596 developers. It's quick & easy.

Pygame loading .mp3 Couldn't Read File Error

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
1 5350
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.

Similar topics

5 posts views Thread by Andrea Griffini | last post: by
3 posts views Thread by Tim Knauf | last post: by
3 posts views Thread by tlviewer | last post: by
1 post views Thread by liuliuliu | last post: by
kaarthikeyapreyan
4 posts views Thread by kaarthikeyapreyan | last post: by
5 posts views Thread by globalrev | last post: by
11 posts views Thread by globalrev | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.