text_game_maker.audio package

Submodules

text_game_maker.audio.audio.init(frequency=44100, samplewidth=-16, numchannels=1, buffersize=1024)

Initialize game audio and load PTTTL files for default sounds (called automatically by text_game_maker.builder.map_builder.MapBuilder.run_game)

Parameters:
  • frequency (int) – frequency in HZ
  • samplewidth (int) – sample size in bits
  • numchannels (int) – number of audio channels
  • buffersize (int) – size in bytes of the buffer to be used for playing audio samples
text_game_maker.audio.audio.load_file(filename, sound_id=None)

Read a PTTTL file, convert to PCM samples and save for playback

Parameters:
  • filename (str) – filename for PTTTL file to read
  • sound_id – key used to retrieve sound for playback (if None, filename is used)
text_game_maker.audio.audio.play_sound(sound_id)

Play a loaded sound

Parameters:sound_id – key for sound to play
text_game_maker.audio.audio.quit()

Disable audio after it has been initialized

text_game_maker.audio.audio.wait()

Wait until currently playing sound is finished playing (if any)