- This wiki is out of date, use the continuation of this wiki instead
Play song
From FenixWiki
(Difference between revisions)
| Revision as of 15:16, 22 April 2007 (edit) Woody (Talk | contribs) ← Previous diff |
Current revision (12:02, 19 September 2007) (edit) (undo) Sandman (Talk | contribs) |
||
| (6 intermediate revisions not shown.) | |||
| Line 3: | Line 3: | ||
| ==Definition== | ==Definition== | ||
| - | + | '''INT''' play_song ( <'''INT''' songID> , <'''INT''' repeats> ) | |
| - | '''INT''' play_song ( <'''INT''' | + | |
| Plays a song. | Plays a song. | ||
| - | |||
| == Parameters == | == Parameters == | ||
| - | |||
| {| | {| | ||
| - | | '''INT''' | + | | '''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. | | '''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 == | ||
| + | <pre> | ||
| + | Program example; | ||
| + | Private | ||
| + | int song; | ||
| + | Begin | ||
| + | song = load_song("my_song.ogg"); | ||
| + | play_song(song,0); | ||
| + | Loop | ||
| + | frame; | ||
| + | End | ||
| + | End | ||
| + | </pre> | ||
| + | Used in example: [[load_song]]() | ||
| + | |||
| + | {{Funcbox | ||
| + | | category=Sound | ||
| + | }} | ||
Current revision
Contents |
[edit] Definition
INT play_song ( <INT songID> , <INT repeats> )
Plays a song.
[edit] 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. |
[edit] Returns
INT : Error.
| -1 | - Error: sound inactive; mixer error; invalid songID. |
| 0 | - No error. |
[edit] Errors
| Sound inactive | - The sound is inactive. |
| Invalid songID | - The songID was invalid. |
| Other | - Some Mixer error. |
[edit] 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 | |
| • Is_playing_song() • Load_song() • Load_wav() • Pause_song() • Play_song() • Play_wav() • Resume_song() • Set_song_volume() • Unload_song() • | |
