Hi
I'm about 2 yrs into studying Python - started with "Hello World", and I'm
working with v 2.5.1 right now. The past year I've begun trying to write my
own interactive fiction. That works pretty well, but now I'm attempting to put
some music into programs (I thought background music would be good), and I'm
running into roadblocks.
I've tried several different things for this, and come up with either my text
that comes to a halt eventually at an error message (can't read from the files
or mixer isn't initialized are the most common ones), or a completely blank
screen with no sound. I've tried both .mp3 files and .wav ones, neither works
for this.
Here's the most recent code I've attempted:
import pygame , sys
import random
size=[500,500]
def run(self):
import pygame.mixer
pygame.mixer.init(22050, -16, 2, 4096)
self.sound.seek(0)
snd = pygame.mixer.Sound(self.sound)
pygame.mixer.Sound.play("bach-cello-suite-1.wav")
musicPlaying = True
Any ideas would be appreciated. Thanks.
my website: http://jahowe.com
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor