home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2000 May / maximum-cd-2000-05.iso / Invictus / data1.cab / Game_Files / Assets / Scripts / modules / tigerSound.py < prev    next >
Encoding:
Text File  |  2000-02-25  |  551 b   |  26 lines

  1. #Tiger sound interface module
  2.  
  3. import string, sys, environ
  4.  
  5. soundNameDict = {}
  6.  
  7. soundNamesFile = open('./dagame/common/soundnums.h', 'r')
  8.  
  9. # Get rid of the header lines
  10. soundNamesFile.readlines()
  11. soundNamesFile.readlines()
  12.  
  13. for line in soundNamesFile.readlines():
  14.     if line[:7] == '#define':
  15.         [soundName, soundID] = string.split(line)[1:3]
  16.         soundNameDict[soundName] = int(soundID)
  17. soundNamesFile.close()
  18.  
  19. def getSoundID(name):
  20.     return soundNameDict[name]
  21.  
  22. def playSound(name):
  23.     id = getSoundID(name)
  24.     environ.sPlaySound(id)
  25.  
  26.