pygame.mixer.music.load(fileobject) causes "Module format not recognized"

Issue #53 open
René Dudfield
created an issue

== sakurai_youhei, 2010-08-30 09:49:33 -0700

Hi,

  • Python 2.6
  • pygame 1.9.1
  • Windows XP SP3

I faced strange behaviors, so I do test with following code.

import pygame.mixer
import time

filename="house_lo.mp3"
pygame.mixer.init()
f=open(filename,"rb")
pygame.mixer.music.load(f)
pygame.mixer.music.play(0)
time.sleep(1)

"house_lo.mp3" is in examples\data. This causes "Module format not recognized".

And I also try other files, "house_lo.ogg" and "boom.wav".

This code with "house_lo.ogg" works well at first time, and it hungs up after "pygame.mixer.music.play(0)" at second time.

This code with "boom.wav" works well always.

And I try following code.

import pygame.mixer
import time

filename="#FILENAME#"
pygame.mixer.init()
pygame.mixer.music.load(filename)
pygame.mixer.music.play(0)
time.sleep(1)
  • filename="boom.wav" => always OK
  • filename="house_lo.ogg" => always OK(again,again...)
  • filename="house_lo.mp3" => always NG

Regards.

Comments (8)

  1. cgohlke

    Could be a problem with the house_lo.mp3 file. The file has a "MPEG-2.5 layer 3" format. According to Wikipedia that format is non-standard, proprietary <http://en.wikipedia.org/wiki/MP3>. It is not recognized by smpeg on my system (built from trunk) and crashes smpeg on win-amd64. After converting the file to "MPEG-1 layer 3" pygame.mixer.music works. No problems with the ogg file here.

  2. Jason Marshall
    • changed version to 1.9.1
    • edited description

    I think that we should close this issue (wontfix) because the problematic audio file's format is non-standard. pygame should not be expected to support non-standard proprietary formats.

  3. Log in to comment