This wiki is out of date, use the continuation of this wiki instead

Load song

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 23:58, 25 April 2007 (edit)
Sandman (Talk | contribs)
m (Load Song moved to Load song)
← Previous diff
Revision as of 00:14, 26 April 2007 (edit) (undo)
Sandman (Talk | contribs)

Next diff →
Line 4: Line 4:
'''INT''' load_song ( <'''STRING''' path> ) '''INT''' load_song ( <'''STRING''' path> )
-Loads a song for later use with [[play_song]]. The delicious music file format OGG is the only one I know of that works with this but there may be others.+Loads a song for later use with [[play_song]]().
 + 
 +There are multiple [[filetypes]] you can load using this [[function]]. Included are:
 +* OGG Vorbis (.ogg). Good quality for [[song]]s and doesn't take too much space (it's similar to *.mp3).
 +* MIDI (.mid). Takes very low space, but it's limited to samples of the soundcard.
 +* Modules (.xm, .it, .s3m, .mod). Like MIDI, but Modules also contain the samples themselves.
 +* WAV (.wav). Uncompressed audio data, taking very much space.
 + 
 +== Parameters ==
 +{|
 +| '''STRING''' path || - The [[path]] to the music file to be loaded.
 +|}
 + 
 +== Returns ==
 +'''INT''' : [[SongID]]
 +{|
 +| -1 || - Could not load music file (errormessage in console).
 +|-
 +| >=0 || - The SongID.
 +|}
 + 
 +== Example ==
 +<pre>
 +Program example;
 +Private
 + int song;
 +Begin
 + song = load_song("my_song.ogg");
 + play_song(song,0);
 + Loop
 + frame;
 + End
 +End
 +</pre>

Revision as of 00:14, 26 April 2007


INT load_song ( <STRING path> )

Loads a song for later use with play_song().

There are multiple filetypes you can load using this function. Included are:

  • OGG Vorbis (.ogg). Good quality for songs and doesn't take too much space (it's similar to *.mp3).
  • MIDI (.mid). Takes very low space, but it's limited to samples of the soundcard.
  • Modules (.xm, .it, .s3m, .mod). Like MIDI, but Modules also contain the samples themselves.
  • WAV (.wav). Uncompressed audio data, taking very much space.

Parameters

STRING path - The path to the music file to be loaded.

Returns

INT : SongID

-1 - Could not load music file (errormessage in console).
>=0 - The SongID.

Example

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