From 84acb4de8ca9fa0663b9de35df150cc99d49062a Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Sat, 20 Oct 2007 21:23:51 +0000 Subject: Added support to be able to play wav and aiff format --- (limited to 'game.py') diff --git a/game.py b/game.py index e825a0d..1f0357d 100755 --- a/game.py +++ b/game.py @@ -152,12 +152,12 @@ class MemorizeGame(gobject.GObject): if self.sound == 1: snd = self.model.grid[id].get('snd', None) if snd != None: - if snd.endswith('.wav'): - pass - # code to csound play wav + if len(snd.split('.')) > 1: + if snd.split('.')[1] in ['wav', 'aif', 'aiff']: + self.cs.perform('i 102 0.0 3.0 "%s" 1 0.9 0'%(os.path.join(os.path.dirname(__file__), snd))) else: - self.cs.perform('i 108 0.0 3.0 "%s" 1 0.9 0'%(os.path.join(os.path.dirname(__file__), snd))) - _logger.debug('Audio: play sound=%s'%snd) + self.cs.perform('i 100 0.0 3.0 "%s" 1 0.9 0'%(os.path.join(os.path.dirname(__file__), snd))) + _logger.debug('Audio: play sound=%s'%snd) # First card case if self.last_flipped == -1: -- cgit v0.9.1