Audio

Audio

Description

SwinGame's Audio is responsible for loading and playing music and sound effects. The main functionality exists in LoadMusic, PlayMusic, LoadSoundEffect, and PlaySoundEffect. Associated with these are the Music and SoundEffect types.

Audio Ready

AudioReady indicates if SwinGame's audio has been opened. Sound effects and Music can only be played with the audio is "ready".

  • Audio Ready () : Boolean [show]

    AudioReady indicates if SwinGame's audio has been opened. Sound effects and Music can only be played with the audio is "ready".

    Returns:
    Boolean :
    Signatures by Language:
    C/C++: bool audio_ready();
    Pascal: function AudioReady(): Boolean;

Close Audio

CloseAudio is used to clean up the resources used by SwinGame audio. If OpenAudio is called, this must be called to return the resources used before the program terminates.

  • Close Audio () [show]

    CloseAudio is used to clean up the resources used by SwinGame audio. If OpenAudio is called, this must be called to return the resources used before the program terminates.


Fade Music In

Fades the music in over a number of milliseconds, and then continues to play the music repeatedly until the program ends or the music is stopped. The music fades from 0 volume up to the currently set music volume.

  • Fade Music In (mus, ms) [show]

    Fades the music in over a number of milliseconds, and then continues to play the music repeatedly until the program ends or the music is stopped. The music fades from 0 volume up to the currently set music volume.

    Parameters:
    mus : Music
    The Music resource to be played.
    ms : Longint
    The number of milliseconds over which to fade the music in to
    Signatures by Language:
    C/C++: void fade_music_in(music mus, int32_t ms);
    Pascal: procedure FadeMusicIn(mus: Music; ms: Longint);
  • Fade Music In (name, ms) [show]

    Fades the music in over a number of milliseconds, and then continues to play the music repeatedly until the program ends or the music is stopped. The music fades from 0 volume up to the currently set music volume.

    Parameters:
    name : String
    The name of the Music resource to be played.
    ms : Longint
    The number of milliseconds over which to fade the music in to
    Signatures by Language:
    C/C++: void fade_music_named_in(const char *name, int32_t ms);
    C++: void fade_music_in(const char *name, int32_t ms);
    Pascal: procedure FadeMusicIn(name: String; ms: Longint);
  • Fade Music In (name, loops, ms) [show]

    This version of FadeMusicIn fades the music in then plays the 'Music' for a given number of loops.Setting loops to -1 repeats the music infinitely, other values larger than 0 indicate the number of times that the music should be played.

    Parameters:
    name : String
    The name of the Music resource to be played.
    loops : Longint
    The number of times that the music should be played, -1 for repeat infinitely
    ms : Longint
    The number of milliseconds over which to fade the music in to the current music volume.
    Signatures by Language:
    C/C++: void fade_music_named_in_with_loops(const char *name, int32_t loops, int32_t ms);
    C++: void fade_music_in(const char *name, int32_t loops, int32_t ms);
    Pascal: procedure FadeMusicIn(name: String; loops: Longint; ms: Longint);
  • Fade Music In (mus, loops, ms) [show]

    This version of FadeMusicIn fades the music in then plays the 'Music' for a given number of loops.Setting loops to -1 repeats the music infinitely, other values larger than 0 indicate the number of times that the music should be played.

    Parameters:
    mus : Music
    The Music resource to be played.
    loops : Longint
    The number of times that the music should be played, -1 for repeat infinitely
    ms : Longint
    The number of milliseconds over which to fade the music in to the current music volume.
    Signatures by Language:
    C/C++: void fade_music_in_with_loops(music mus, int32_t loops, int32_t ms);
    C++: void fade_music_in(music mus, int32_t loops, int32_t ms);
    Pascal: procedure FadeMusicIn(mus: Music; loops: Longint; ms: Longint);

Fade Music Out

Fades the currently playing music out over a number of milli seconds.

  • Fade Music Out (ms) [show]

    Fades the currently playing music out over a number of milli seconds.

    Parameters:
    ms : Longint
    The number of milliseconds over which to fade the music to 0 volume.
    Signatures by Language:
    C/C++: void fade_music_out(int32_t ms);
    Pascal: procedure FadeMusicOut(ms: Longint);

Free Music

Frees the resources used by a Music resource. All loaded Music should be freed once it is no longer needed.

  • Free Music (var mus) [show]

    Frees the resources used by a Music resource. All loaded Music should be freed once it is no longer needed.

    Parameters:
    mus : Music
    Signatures by Language:
    C/C++: void free_music(music *mus);
    C++: void free_music(music &mus);
    Pascal: procedure FreeMusic(var mus: Music);

Free Sound Effect

Frees the resources used by a SoundEffect resource. All loaded SoundEffects should be freed once they are no longer needed.

  • Free Sound Effect (var effect) [show]

    Frees the resources used by a SoundEffect resource. All loaded SoundEffects should be freed once they are no longer needed.

    Parameters:
    effect : SoundEffect
    Signatures by Language:
    C/C++: void free_sound_effect(sound_effect *effect);
    C++: void free_sound_effect(sound_effect &effect);
    Pascal: procedure FreeSoundEffect(var effect: SoundEffect);

Has Music

Determines if SwinGame has a music value loaded for the supplied name. This checks against all music values loaded using LoadMusicNamed.

  • Has Music (name) : Boolean [show]

    Determines if SwinGame has a music value loaded for the supplied name. This checks against all music values loaded using LoadMusicNamed.

    Parameters:
    name : String
    Returns:
    Boolean :
    Signatures by Language:
    C/C++: bool has_music(const char *name);
    Pascal: function HasMusic(name: String): Boolean;

Has Sound Effect

Determines if SwinGame has a sound effect loaded for the supplied name. This checks against all sounds loaded, those loaded without a name are assigned the filename as a default

  • Has Sound Effect (name) : Boolean [show]

    Determines if SwinGame has a sound effect loaded for the supplied name. This checks against all sounds loaded, those loaded without a name are assigned the filename as a default

    Parameters:
    name : String
    Returns:
    Boolean :
    Signatures by Language:
    C/C++: bool has_sound_effect(const char *name);
    Pascal: function HasSoundEffect(name: String): Boolean;

Load Music

Loads the Music from the supplied filename. The music will be loaded from the Resources/sounds folder unless a full path to the file is passed in. If you are passing in the full path and you want toensure that your game is able to work across multiple platforms correctly ensure that you use PathToResource to get the full path to the files in the projects resources folder.

LoadMusic can load mp3, wav and ogg audio files.

FreeMusic should be called to free the resources used by the Music data once the resource is no longer needed.

  • Load Music (filename) : Music [show]

    Loads the Music from the supplied filename. The music will be loaded from the Resources/sounds folder unless a full path to the file is passed in. If you are passing in the full path and you want toensure that your game is able to work across multiple platforms correctly ensure that you use PathToResource to get the full path to the files in the projects resources folder.

    LoadMusic can load mp3, wav and ogg audio files.

    FreeMusic should be called to free the resources used by the Music data once the resource is no longer needed.

    Parameters:
    filename : String
    the filename to the music file to load.
    Returns:
    Music :
    Signatures by Language:
    C/C++: music load_music(const char *filename);
    Pascal: function LoadMusic(filename: String): Music;

Load Music Named

Loads and returns a music value. The supplied filename is used to locate the music file to load. The supplied name indicates the name to use to refer to this Music value. The Music can then be retrieved by passing this name to the MusicNamed function.

  • Load Music Named (name, filename) : Music [show]

    Loads and returns a music value. The supplied filename is used to locate the music file to load. The supplied name indicates the name to use to refer to this Music value. The Music can then be retrieved by passing this name to the MusicNamed function.

    Parameters:
    name : String
    filename : String
    Returns:
    Music :
    Signatures by Language:
    C/C++: music load_music_named(const char *name, const char *filename);
    Pascal: function LoadMusicNamed(name: String; filename: String): Music;

Load Sound Effect

Loads the SoundEffect from the supplied filename. The sound will be loaded from the Resources/sounds folder unless a full path to the file is passed in. If you are passing in the full path and you want to ensure that your game is able to work across multiple platforms correctly then use PathToResource to get the full path to the files in the projects resources folder.

LoadSoundEffect can load wav and ogg audio files.

FreeSoundEffect should be called to free the resources used by the SoundEffect data once the resource is no longer needed.

  • Load Sound Effect (filename) : SoundEffect [show]

    Loads the SoundEffect from the supplied filename. The sound will be loaded from the Resources/sounds folder unless a full path to the file is passed in. If you are passing in the full path and you want to ensure that your game is able to work across multiple platforms correctly then use PathToResource to get the full path to the files in the projects resources folder.

    LoadSoundEffect can load wav and ogg audio files.

    FreeSoundEffect should be called to free the resources used by the SoundEffect data once the resource is no longer needed.

    Parameters:
    filename : String
    the filename of the sound effect file to load.
    Returns:
    SoundEffect :
    Signatures by Language:
    C/C++: sound_effect load_sound_effect(const char *filename);
    Pascal: function LoadSoundEffect(filename: String): SoundEffect;

Load Sound Effect Named

Loads and returns a sound effect. The supplied filename is used to locate the sound effect to load. The supplied name indicates the name to use to refer to this SoundEffect. The SoundEffect can then be retrieved by passing this name to the SoundEffectNamed function.

  • Load Sound Effect Named (name, filename) : SoundEffect [show]

    Loads and returns a sound effect. The supplied filename is used to locate the sound effect to load. The supplied name indicates the name to use to refer to this SoundEffect. The SoundEffect can then be retrieved by passing this name to the SoundEffectNamed function.

    Parameters:
    name : String
    filename : String
    Returns:
    SoundEffect :
    Signatures by Language:
    C/C++: sound_effect load_sound_effect_named(const char *name, const char *filename);
    Pascal: function LoadSoundEffectNamed(name: String; filename: String): SoundEffect;

Music Filename

Returns the filename that SwinGame uses to load to this music data.

  • Music Filename (mus) : String [show]

    Returns the filename that SwinGame uses to load to this music data.

    Parameters:
    mus : Music
    Returns:
    String :
    Signatures by Language:
    C/C++: void music_filename(music mus, char *result);
    Pascal: function MusicFilename(mus: Music): String;

Music Name

Returns the name that SwinGame uses to refer to this music data. This name can be used to fetch and release this music resource.

  • Music Name (mus) : String [show]

    Returns the name that SwinGame uses to refer to this music data. This name can be used to fetch and release this music resource.

    Parameters:
    mus : Music
    Returns:
    String :
    Signatures by Language:
    C/C++: void music_name(music mus, char *result);
    Pascal: function MusicName(mus: Music): String;

Music Named

Returns the Music that has been loaded with the specified name. This works with music data loaded using LoadMusicNamed.

  • Music Named (name) : Music [show]

    Returns the Music that has been loaded with the specified name. This works with music data loaded using LoadMusicNamed.

    Parameters:
    name : String
    Returns:
    Music :
    Signatures by Language:
    C/C++: music music_named(const char *name);
    Pascal: function MusicNamed(name: String): Music;

Music Playing

This function indicates if music is currently playing. As only one music resource can be playing at a time this does not need to be told which music resource to check for.

  • Music Playing () : Boolean [show]

    This function indicates if music is currently playing. As only one music resource can be playing at a time this does not need to be told which music resource to check for.

    Returns:
    Boolean : true if the music is playing
    Signatures by Language:
    C/C++: bool music_playing();
    Pascal: function MusicPlaying(): Boolean;

Music Volume

This function returns the current volume of the music. This will be a value between 0 and 1, with 1 indicating 100% of the Music resources volume.

  • Music Volume () : Single [show]

    This function returns the current volume of the music. This will be a value between 0 and 1, with 1 indicating 100% of the Music resources volume.

    Returns:
    Single : The volume of the currently playing music.
    Signatures by Language:
    C/C++: float music_volume();
    Pascal: function MusicVolume(): Single;

Open Audio

OpenAudio is used to initialise the SwinGame audio code. This should be called at the start of your programs code, and is usually coded into the starting project templates. After initialising the audio code you can load and play Music using LoadMusic and PlayMusic, load and play SoundEffects using LoadSoundEffect and PlaySoundEffect. At the end of the program you need to call CloseAudio to ensure that the audio code is correctly terminated.


Pause Music

Pauses the currently playing music. See ResumeMusic.


Play Music

PlayMusic starts playing a Music resource. SwinGame only allows one music resource to be played at a time. Starting to play a new music resource will stop the currently playing music track. You can also stop the music by calling StopMusic.

By default SwinGame starts playing music at its full volume. This can be controlled by calling SetMusicVolume. The current volume can be checked with MusicVolume.

To test if a Music resource is currently playing you can use the MusicPlaying function.

This version of PlayMusic can be used to play background music that is looped infinitely. The currently playing music is stopped and the new music resource will start playing, and will repeat until StopMusic is called, or another resource is played.

  • Play Music (mus) [show]

    PlayMusic starts playing a Music resource. SwinGame only allows one music resource to be played at a time. Starting to play a new music resource will stop the currently playing music track. You can also stop the music by calling StopMusic.

    By default SwinGame starts playing music at its full volume. This can be controlled by calling SetMusicVolume. The current volume can be checked with MusicVolume.

    To test if a Music resource is currently playing you can use the MusicPlaying function.

    This version of PlayMusic can be used to play background music that is looped infinitely. The currently playing music is stopped and the new music resource will start playing, and will repeat until StopMusic is called, or another resource is played.

    Parameters:
    mus : Music
    The Music resource to play.
    Signatures by Language:
    C/C++: void play_music(music mus);
    Pascal: procedure PlayMusic(mus: Music);
  • Play Music (name) [show]

    PlayMusic starts playing a Music resource. SwinGame only allows one music resource to be played at a time. Starting to play a new music resource will stop the currently playing music track. You can also stop the music by calling StopMusic.

    By default SwinGame starts playing music at its full volume. This can be controlled by calling SetMusicVolume. The current volume can be checked with MusicVolume.

    To test if a Music resource is currently playing you can use the MusicPlaying function.

    This version of PlayMusic can be used to play background music that is looped infinitely. The currently playing music is stopped and the new music resource will start playing, and will repeat until StopMusic is called, or another resource is played.

    Parameters:
    name : String
    The name of the Music resource to play.
    Signatures by Language:
    C/C++: void play_music_named(const char *name);
    C++: void play_music(const char *name);
    Pascal: procedure PlayMusic(name: String);
  • Play Music (mus, loops) [show]

    This version of PlayMusic allows you to control the number of times the Music resource is repeated. It starts playing the supplied Music resource, repeating it the numder of times specified in the loops parameter. Setting loops to -1 repeats the music infinitely, other values larger than 0 indicate the number of times that the music should be played.

    Parameters:
    mus : Music
    The Music resource to be played.
    loops : Longint
    The number of times that the music should be played, -1 for repeat infinitely
    Signatures by Language:
    C/C++: void play_music_with_loops(music mus, int32_t loops);
    C++: void play_music(music mus, int32_t loops);
    Pascal: procedure PlayMusic(mus: Music; loops: Longint);
  • Play Music (name, loops) [show]

    This version of PlayMusic allows you to control the number of times the Music resource is repeated. It starts playing the supplied Music resource, repeating it the numder of times specified in the loops parameter. Setting loops to -1 repeats the music infinitely, other values larger than 0 indicate the number of times that the music should be played.

    Parameters:
    name : String
    The name of the Music resource to be played.
    loops : Longint
    The number of times that the music should be played, -1 for repeat infinitely
    Signatures by Language:
    C/C++: void play_music_named_with_loops(const char *name, int32_t loops);
    C++: void play_music(const char *name, int32_t loops);
    Pascal: procedure PlayMusic(name: String; loops: Longint);

Play Sound Effect

There are several versions of PlaySoundEffect that can be used to control the way the sound effect plays, allowing you to control its volume and the number of times the code loops. In all cases the started sound effect is mixed with the currently playing sound effects and music.

With this version of PlaySoundEffect, the started sound effect will be played at full volume.

  • Play Sound Effect (effect) [show]

    There are several versions of PlaySoundEffect that can be used to control the way the sound effect plays, allowing you to control its volume and the number of times the code loops. In all cases the started sound effect is mixed with the currently playing sound effects and music.

    With this version of PlaySoundEffect, the started sound effect will be played at full volume.

    Parameters:
    effect : SoundEffect
    The effect indicates which sound effect to start playing. This effect is played once at its full volume.
    Signatures by Language:
    C/C++: void play_sound_effect(sound_effect effect);
    Pascal: procedure PlaySoundEffect(effect: SoundEffect);
  • Play Sound Effect (name) [show]

    There are several versions of PlaySoundEffect that can be used to control the way the sound effect plays, allowing you to control its volume and the number of times the code loops. In all cases the started sound effect is mixed with the currently playing sound effects and music.

    With this version of PlaySoundEffect, the started sound effect will be played at full volume.

    Parameters:
    name : String
    The name of the sound effect to play
    Signatures by Language:
    C/C++: void play_sound_effect_named(const char *name);
    C++: void play_sound_effect(const char *name);
    Pascal: procedure PlaySoundEffect(name: String);
  • Play Sound Effect (name, vol) [show]

    This version of PlaySoundEffect allows you to control the volume of the sounds playback. The vol parameter will take a value between 0 and 1 indicating the percentage of full volume to play at. For example, 0.1 plays the sound effect at 10% of its original volume.

    Parameters:
    name : String
    The name of the sound effect to play.
    vol : Single
    Indicates the percentage of the original volume to play the SoundEffect at. This must be between 0 and 1.
    Signatures by Language:
    C/C++: void play_sound_effect_named_with_volume(const char *name, float vol);
    C++: void play_sound_effect(const char *name, float vol);
    Pascal: procedure PlaySoundEffect(name: String; vol: Single);
  • Play Sound Effect (effect, vol) [show]

    This version of PlaySoundEffect allows you to control the volume of the sounds playback. The vol parameter will take a value between 0 and 1 indicating the percentage of full volume to play at. For example, 0.1 plays the sound effect at 10% of its original volume.

    Parameters:
    effect : SoundEffect
    The effect indicates which sound effect to start playing.
    vol : Single
    Indicates the percentage of the original volume to play the SoundEffect at. This must be between 0 and 1.
    Signatures by Language:
    C/C++: void play_sound_effect_with_volume(sound_effect effect, float vol);
    C++: void play_sound_effect(sound_effect effect, float vol);
    Pascal: procedure PlaySoundEffect(effect: SoundEffect; vol: Single);
  • Play Sound Effect (name, loops) [show]

    This version of PlaySoundEffect allows you to indicate the number of times the sound effect is repeated. Setting the loops parameter to -1 will cause the sound effect to be looped infinitely, setting it to a value larger than 0 plays the sound effect the number of times indicated, calling with a value of 0 means the sound effect is not played.

    Parameters:
    name : String
    The name of the sound effect to start playing.
    loops : Longint
    Controls the number of times the sound effect is played. -1 means the sound effect is repeated infinitely.
    Signatures by Language:
    C/C++: void play_sound_effect_named_with_loop(const char *name, int32_t loops);
    C++: void play_sound_effect(const char *name, int32_t loops);
    Pascal: procedure PlaySoundEffect(name: String; loops: Longint);
  • Play Sound Effect (effect, loops) [show]

    This version of PlaySoundEffect allows you to indicate the number of times the sound effect is repeated. Setting the loops parameter to -1 will cause the sound effect to be looped infinitely, setting it to a value larger than 0 plays the sound effect the number of times indicated, calling with a value of 0 means the sound effect is not played.

    Parameters:
    effect : SoundEffect
    The effect indicates which sound effect to start playing. This effect is played once at its full volume.
    loops : Longint
    Controls the number of times the sound effect is played. -1 means the sound effect is repeated infinitely.
    Signatures by Language:
    C/C++: void play_sound_effect_with_loop(sound_effect effect, int32_t loops);
    C++: void play_sound_effect(sound_effect effect, int32_t loops);
    Pascal: procedure PlaySoundEffect(effect: SoundEffect; loops: Longint);
  • Play Sound Effect (effect, loops, vol) [show]

    This version of PlaySoundEffect allows you to control both the number of times the SoundEffect is repeated, and its playback volume.

    Parameters:
    effect : SoundEffect
    The effect indicates which sound effect to start playing.
    loops : Longint
    Controls the number of times the sound effect is played.
    vol : Single
    Indicates the percentage of the original volume to play the SoundEffect at. This must be between 0 and 1.
    Signatures by Language:
    C/C++: void play_sound_effect_with_loop_and_volume(sound_effect effect, int32_t loops, float vol);
    C++: void play_sound_effect(sound_effect effect, int32_t loops, float vol);
    Pascal: procedure PlaySoundEffect(effect: SoundEffect; loops: Longint; vol: Single);
    • source code
    • lib name: PlaySoundEffectWithLoopAndVolume
  • Play Sound Effect (name, loops, vol) [show]

    This version of PlaySoundEffect allows you to control both the number of times the SoundEffect is repeated, and its playback volume.

    Parameters:
    name : String
    The name of the sound effect to start playing.
    loops : Longint
    Controls the number of times the sound effect is played.
    vol : Single
    Indicates the percentage of the original volume to play the SoundEffect at. This must be between 0 and 1.
    Signatures by Language:
    C/C++: void play_sound_effect_named_with_loop_and_volume(const char *name, int32_t loops, float vol);
    C++: void play_sound_effect(const char *name, int32_t loops, float vol);
    Pascal: procedure PlaySoundEffect(name: String; loops: Longint; vol: Single);
    • source code
    • lib name: PlaySoundEffectNamedWithLoopAndVolume

Release All Music

Releases all of the music data that have been loaded.

  • Release All Music () [show]

    Releases all of the music data that have been loaded.


Release All Sound Effects

Releases all of the sound effects that have been loaded.

  • Release All Sound Effects () [show]

    Releases all of the sound effects that have been loaded.


Release Music

Releases the music that have been loaded with the supplied name.

  • Release Music (name) [show]

    Releases the music that have been loaded with the supplied name.

    Parameters:
    name : String
    Signatures by Language:
    C/C++: void release_music(const char *name);
    Pascal: procedure ReleaseMusic(name: String);

Release Sound Effect

Releases the SwinGame resources associated with the sound effect of the specified name.

  • Release Sound Effect (name) [show]

    Releases the SwinGame resources associated with the sound effect of the specified name.

    Parameters:
    name : String
    Signatures by Language:
    C/C++: void release_sound_effect(const char *name);
    Pascal: procedure ReleaseSoundEffect(name: String);

Resume Music

Resume currently paused music. See PauseMusic.


Set Music Volume

This procedure allows you to set the volume of the currently playing music. The vol parameter indicates the percentage of the original volume, for example, 0.1 sets the playback volume to 10% of its full volume.

  • Set Music Volume (value) [show]

    This procedure allows you to set the volume of the currently playing music. The vol parameter indicates the percentage of the original volume, for example, 0.1 sets the playback volume to 10% of its full volume.

    Parameters:
    value : Single
    Indicates the percentage of the original volume to play the Music at. This must be between 0 and 1, e.g. 0.1 is 10%.
    Signatures by Language:
    C/C++: void set_music_volume(float value);
    Pascal: procedure SetMusicVolume(value: Single);

Sound Effect Filename

Returns the filename that SwinGame used to load to this sound effect.

  • Sound Effect Filename (effect) : String [show]

    Returns the filename that SwinGame used to load to this sound effect.

    Parameters:
    effect : SoundEffect
    Returns:
    String :
    Signatures by Language:
    C/C++: void sound_effect_filename(sound_effect effect, char *result);
    Pascal: function SoundEffectFilename(effect: SoundEffect): String;

Sound Effect Name

Returns the name that SwinGame uses to refer to this sound effect. This name can be used to fetch and release this sound effect resource.

  • Sound Effect Name (effect) : String [show]

    Returns the name that SwinGame uses to refer to this sound effect. This name can be used to fetch and release this sound effect resource.

    Parameters:
    effect : SoundEffect
    Returns:
    String :
    Signatures by Language:
    C/C++: void sound_effect_name(sound_effect effect, char *result);
    Pascal: function SoundEffectName(effect: SoundEffect): String;

Sound Effect Named

Returns the SoundEffect that has been loaded with the specified name, see LoadSoundEffectNamed.


Sound Effect Playing

This function can be used to check if a sound effect is currently playing.

  • Sound Effect Playing (effect) : Boolean [show]

    This function can be used to check if a sound effect is currently playing.

    Parameters:
    effect : SoundEffect
    The sound effect to check.
    Returns:
    Boolean : true if the effect SoundEffect is playing.
    Signatures by Language:
    C/C++: bool sound_effect_playing(sound_effect effect);
    Pascal: function SoundEffectPlaying(effect: SoundEffect): Boolean;
  • Sound Effect Playing (name) : Boolean [show]

    This function can be used to check if a sound effect is currently playing.

    Parameters:
    name : String
    The name of the sound effect to check.
    Returns:
    Boolean : true if the effect SoundEffect is playing.
    Signatures by Language:
    C/C++: bool sound_effect_named_playing(const char *name);
    C++: bool sound_effect_playing(const char *name);
    Pascal: function SoundEffectPlaying(name: String): Boolean;

Stop Music

Stops playing the current music resource.


Stop Sound Effect

Stops all occurances of the effect SoundEffect that is currently playing.

  • Stop Sound Effect (effect) [show]

    Stops all occurances of the effect SoundEffect that is currently playing.

    Parameters:
    effect : SoundEffect
    The sound to stop.
    Signatures by Language:
    C/C++: void stop_sound_effect(sound_effect effect);
    Pascal: procedure StopSoundEffect(effect: SoundEffect);
  • Stop Sound Effect (name) [show]

    Stops all occurances of the named SoundEffect that are currently playing.

    Parameters:
    name : String
    The name of the sound effect to stop.
    Signatures by Language:
    C/C++: void stop_sound_effect_named(const char *name);
    C++: void stop_sound_effect(const char *name);
    Pascal: procedure StopSoundEffect(name: String);

Try Open Audio

TryOpenAudio attempts to open the audio device for SwinGame to use. If this fails TryOpenAudio returns false to indicate that the audio device has not opened correctly and audio cannot be played.

  • Try Open Audio () : Boolean [show]

    TryOpenAudio attempts to open the audio device for SwinGame to use. If this fails TryOpenAudio returns false to indicate that the audio device has not opened correctly and audio cannot be played.

    Returns:
    Boolean :
    Signatures by Language:
    C/C++: bool try_open_audio();
    Pascal: function TryOpenAudio(): Boolean;