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

[pygame] Strangest thing..



Hi pygame-users!

I'm new to the list, but not to Python/PyGame.

Tonight I tried playing some music, and noticed that my program only
would play sound if I doulble-clicked the .py file in an explorer
window, not if I ran the script from a command prompt. I'm on Vista,
Python 2.6.1 and Pygame downloaded today, the python 2.6-series.

I stripped down the script to a bare minimun to debug it, and the
behaviour still there in this tiny script which only uses the
"enter.wav" sound, built into windows.

####### START tmp.py
import pygame
import os
import sys

pygame.init()
pygame.mixer.init()

print(pygame.mixer.get_init())
print(sys.version)
print(os.getcwd())

pygame.mixer.music.load("enter.wav")
pygame.mixer.music.play()

while True: pass
####### END

I'm kind of lost as to what to do now to try to solve the problem, I'd
really like to know what I'm doing wrong, since I think this program
might be related to a show-stopping issue for me (DLL problems after
doing a py2exe build).

If any one would try and see if the error is still there on their
machines, I would be grateful. The "enter.wav" file should be located
beside the tmp.py script, and could be found using ordinary F3 search
on Windows.

Cya,

/Olof