Play song

From Bennu Wiki
Jump to navigation Jump to search


Definition

INT play_song ( <INT songID> , <INT repeats> )

Plays a song.

Parameters

INT songID - SongID of the song loaded previously with load_song().
INT repeats - Number of times to repeat the song. Use -1 for an infinite loop.

Returns

INT : Error.

-1 - Error: sound inactive; mixer error; invalid songID.
0 - No error.

Errors

Sound inactive - The sound is inactive.
Invalid songID - The songID was invalid.
Other - Some Mixer error.

Example

Program example;
Private
    int song;
Begin
    song = load_song("my_song.ogg");
    play_song(song,0);
    Loop
        frame;
    End
End

Used in example: load_song()


Sound Functions
Fade_music_in()Fade_music_off()Is_playing_song()Is_playing_wav()Load_song()Load_wav()Pause_song()Pause_wav()Play_song()Play_wav()Reserve_channels()Resume_song()Resume_wav()Reverse_stereo()Set_channel_volume()Set_distance()Set_music_position()Set_panning()Set_position()Set_song_volume()Set_Wav_Volume()Sound_close()Sound_init()Stop_song()Stop_wav()Unload_song()Unload_wav()