home *** CD-ROM | disk | FTP | other *** search
- #Tiger sound interface module
-
- import string, sys, environ
-
- soundNameDict = {}
-
- soundNamesFile = open('./dagame/common/soundnums.h', 'r')
-
- # Get rid of the header lines
- soundNamesFile.readlines()
- soundNamesFile.readlines()
-
- for line in soundNamesFile.readlines():
- if line[:7] == '#define':
- [soundName, soundID] = string.split(line)[1:3]
- soundNameDict[soundName] = int(soundID)
- soundNamesFile.close()
-
- def getSoundID(name):
- return soundNameDict[name]
-
- def playSound(name):
- id = getSoundID(name)
- environ.sPlaySound(id)
-
-