can't listen the file

Iñigo i_munoz at euskalnet.net
Sun Oct 3 07:15:02 EDT 2004


Hello again:
    I was making some tests with pygame and I have written a very small 
piece of code, just to test if it really works right. The code is this:
import os
import pygame

def load_sound(name):
    pygame.mixer.init()
    if os.path.exists(name) != False:
        sound= pygame.mixer.Sound(name)
        print sound.get_num_channels()
        sound.set_volume(0.5)
        sound.play(1, 10)
        print sound.get_num_channels()
        return sound
       
    else:
        print 'File does not exist:', name
        return 0


explode1= load_sound("Sun.wav")

The thing is I do not get any error message but it does not play Sun.wav 
file. Any idea?
   



More information about the Python-list mailing list