Sound/Music Functions

Verge now supports (or will real soon) support module repacking. Please view the documentation at [ http://www.pi-r-squared.com/code/garlick ] . A brief, exciting summary of its critical features would be: removes redundant samples from mod files and optionally uses flac lossless compression to result in a significantly smaller distribution size for all games, especially those including custom music with shared samples.

Its integration with verge is simple. A call to PlayMusic("module.it") will attempt to look for the files `module.it_` and `library` in the same directory. If it finds them, it will load them as repacked modules. If not, it will attempt to load `module.it` directly before giving up.

It is thought that this interacts flawlessly with the pakfile system. Please contact zeromus if you encounter any difficulties.

As an added bonus, my_sfx.wav_ can be loaded the same way, resulting in around a 40-50% decrease in sfx size.

  • FreeSong() Free the song from memory to prevent memory leakage
  • FreeSound() Releases a loaded sound from memory.
  • GetSongPos() returns the current position of a song
  • GetSongVolume() returns the volume of the song your playing
  • LoadSong() load a song into memory for playing
  • LoadSound() Loads a sound file into memory and returns a sound handle.
  • PlayMusic() Loads and plays the specified songfile.
  • PlaySong() Play a song that you have loaded into memory
  • PlaySound() Plays the given sound effect at the given volume
  • SetMusicVolume() set the volume of the music playing
  • SetSongPaused() pause/unpause a song that's playing
  • SetSongPos() set the current position of a song playing
  • SetSongVolume() Sets the current volume of a song playing
  • SoundIsPlaying() Returns whether or not a sound is playing
  • StopMusic() Halts current music playing completely.
  • StopSong() Stop playing a song
  • StopSound() stops playing a sound
  • Talkback

    There are no talkbacks on this documentation page yet. Post the first?

    Post a new comment?

    Ben McGraw's lovingly crafted this website from scratch for years.
    It's a lot prettier this go around because of Jon Wofford.
    Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.