[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Ogg bug in sdl.mixer on Mac OS



After a bit of experimentation, I've isolated a bug in the current SDL.mixer for Mac OS. It won't play ogg files smaller than about 8k.

My question is, where do I submit the bug? So it'll get fixed? Up until now, I've been very happy to let PyGame protect me from SDL's details.

Reverting to an older version of sdl.mixer corrects the problem, (at least on Panther), but the older version of SDL.mixer does not run on Tiger.

Here is sample code. Use your own tiny ogg files to prove it.


import sys
import os
import pygame


def main(args):
    #make sure we're in the correct directory
    fullpath = os.path.abspath(sys.argv[0])
    dir = os.path.split(fullpath)[0]
    #change the directory to this file
    os.chdir(dir)

    pygame.init()
   
    #cpPlay("fingersnap",3); #8k file fails
    cpPlay("thunderclap",3); #12k file works
   
    startTime = pygame.time.get_ticks() + 5000;
    while (pygame.time.get_ticks() < startTime):
        pygame.event.pump();
    pass

def cpPlay(name,loops): #here loop is: 0->infinite, >0 ->play times.
    #get path for sound (either global or local to setting folder)
    #does file exist?
    temp = pygame.mixer.Sound(name+".ogg");
    if (temp == None):
        print ("Bad sound file name: " + name);
        exit(1);
   
    chan = temp.play(loops-1);
    if (not chan):
        print "bad channel"
    pass

main ([])