Mercurial > rinkhals
changeset 589:b6f42a09945d
Add sound play test case
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Sat, 28 Nov 2009 23:19:56 +0000 |
parents | 2899ddc4d92c |
children | 066b85a7f1cf |
files | gamelib/main.py |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/gamelib/main.py Sat Nov 28 23:16:08 2009 +0000 +++ b/gamelib/main.py Sat Nov 28 23:19:56 2009 +0000 @@ -12,8 +12,7 @@ from pgu import gui from pygame.locals import SWSURFACE, SRCALPHA -#from engine import Engine, MainMenuState -from sound import init_sound +import sound import constants from config import config import data @@ -47,11 +46,16 @@ pygame.Surface((100, 100), flags=SRCALPHA) except Exception, e: complaint_dialog("Unable to create a suitable screen, please check your display settings") + if sound.SOUND_INITIALIZED: + try: + sound.play_sound('silence.ogg') + except pygame.error: + complaint_dialog('Error trying to play sound. Please run with --no-sound') def main(): """Main script.""" config.configure(sys.argv[1:]) - init_sound() + sound.init_sound() sanity_check() screen = pygame.display.set_mode(constants.SCREEN, SWSURFACE) pygame.display.set_icon(pygame.image.load(