473,545 Members | 2,019 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pygame loading .mp3 Couldn't Read File Error

1 New Member
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\Schoo l Work\Comp 523\Projects\Me diaPlayer\Media Player\src\Medi aPlayer\Music\o ne.mp3
-----------------------------------------
My Project files are:
D:\My Documents\Schoo l Work\Comp 523\Projects\Me diaPlayer\Media Player\src\Medi aPlayer
------------------------------
Here is my code:

import pygame

pygame.init()
pygame.mixer.in it()


print "Mixer Settings"
print "Mixer Channels"
filename = "D:\My Documents\Schoo l Work\Comp 523\Projects\Me diaPlayer\Media Player\src\Medi aPlayer\Music\k laxons.mp3"

pygame.mixer.mu sic.load(filena me)

pygame.mixer.mu sic.play()

print "Play"


while pygame.mixer.mu sic.get_busy():
print "Playing"

print "Done"

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

Mixer Settings
Mixer Channels
Traceback (most recent call last):
File "D:\My Documents\Schoo l Work\Comp 523\Projects\Me diaPlayer\Media Player\src\Medi aPlayer\RandomJ ukebox.py", line 12, in <module>
pygame.mixer.mu sic.load(filena me)
pygame.error: Couldn't read from 'D:\My Documents\Schoo l Work\Comp 523\Projects\Me diaPlayer\Media Player\src\Medi aPlayer\Music\o ne.mp3'

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

Please HELP!!! Thanks
Feb 18 '08 #1
1 5840
Subsciber123
87 New Member
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

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

Similar topics

5
3075
by: Andrea Griffini | last post by:
Just a quick shoot... can I produce a "closed source" program using "core" python, pygame (and eventually psyco), packaging it by using py2exe and a custom installer ? A clear yes/no answer is something I'll be asked about when proposing python as an interesting alternative. If the answer is "no" (as I fear) what's the minimum of...
3
3699
by: Tim Knauf | last post by:
Hi everyone, I'm glad to have found this list. I've written a small script for my own use which, amongst other things, captures mouse click information from a window containing an image. I used Pygame to manage the image window, as it was the easiest way to implement the functionality I needed. The surrounding interface windows (there are...
3
4443
by: tlviewer | last post by:
hello, The script below is a prototype for loading playing card images from the bitmap resource in cards.dll (WinXP) I like the idea of not keeping copies of the images as files. I'm able to extract the card images as files, then load them in pygame as a surface, but I keep getting errors
1
6781
by: liuliuliu | last post by:
hi -- sorry if this is trivial -- but how do you make a screenshot of a pygame display? i have a surface which is basically the entire visible screen -- how do you write this surface as an image file during specific events in the script execution? image format doesnt matter. thanks! christine
2
2387
by: adhan | last post by:
hi all, i'm new in pygame and i'm trying to make my first excercise with following tutorial in pygame website,but when i'm try to execute the program, the idle will show error like this: Traceback (most recent call last): File "C:/Python25/game/1st project", line 12, in <module> xxx=pygame.image.load(ikon) error: Couldn't open...
4
5858
kaarthikeyapreyan
by: kaarthikeyapreyan | last post by:
I have installed pygame v 1.8.0 The installation was sucessful, but the optional packages were not included like the font,movie etc When i was trying to run the sample script that was given it showed me this error $python fonty.py fonty.py:33: RuntimeWarning: use font: No module named font font = pygame.font.Font(None, 80) Traceback...
5
4201
by: globalrev | last post by:
if pygame.key.get_pressed: print "Muppet" K_a is not defined. but yes it is. why do i get this error? this works: if pygame.key.get_pressed():
11
11652
by: globalrev | last post by:
http://www.pygame.org/docs/ref/mixer.html import pygame #pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=3072) //it complained abiout words= so i guess its only the nbrs should be there// pygame.mixer.init(22050, -16, 2, 3072) pygame.mixer.music.load("example1.mp3")
7
6607
by: Hamy Li | last post by:
after i download everything i need. i run the pygame setup from python. But when i run it an error shows up No Arguments Given, Perform Default Install? y WARNING, DLL for SDL library not found. running install running build running build_py running build_ext building 'pygame._numericsurfarray' extension
0
7468
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7808
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7423
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7757
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5329
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.