Pygame loading .mp3 Couldn't Read File Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zswartz
    New Member
    • Feb 2008
    • 1

    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\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
  • Subsciber123
    New Member
    • Nov 2006
    • 87

    #2
    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.

    Comment

    Working...