can't listen the file

  • Thread starter =?ISO-8859-1?Q?I=F1igo?=
  • Start date
?

=?ISO-8859-1?Q?I=F1igo?=

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?
\0\0\0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,209
Messages
2,571,088
Members
47,686
Latest member
sparada

Latest Threads

Top