コード例 #1
0
ファイル: mixer.py プロジェクト: jggatc/pyjsdl-ts
 def __init__(self, sound_file, id=None):
     if id is None:
         self._id = Sound._id
         Sound._id += 1
     else:
         self._id = id
     if isinstance(sound_file, str):
         self._sound_object = Audio(sound_file.replace('\\','/'))
     else:
         self._sound_object = sound_file
     self._sound_objects = []
     self._sound_objects.append(self._sound_object)
     self._channel = None
     self._volume = 1.0
コード例 #2
0
ファイル: mixer.py プロジェクト: jggatc/pyjsdl-ts
 def get_sound_object(self):
     if len(self._sound_objects) > 0:
         sound_object = self._sound_objects.pop()
     else:
         sound_object = Audio(self._sound_object.getSrc())
     return sound_object