- This wiki is out of date, use the continuation of this wiki instead
Play wav
From FenixWiki
(Difference between revisions)
Revision as of 01:17, 26 April 2007 (edit) Sandman (Talk | contribs) m (→Example) ← Previous diff |
Revision as of 11:46, 31 July 2007 (edit) (undo) Sandman (Talk | contribs) Next diff → |
||
Line 3: | Line 3: | ||
== Definition == | == Definition == | ||
- | '''INT''' play_wav ( <'''INT''' waveID> , <'''INT''' repeats> ) | + | '''INT''' play_wav ( <'''INT''' waveID> , <'''INT''' repeats> , [<'''INT''' channel>] ) |
- | Plays a [[sound effect]] previously loaded with [[load_wav]]. | + | Plays a [[sound effect]] previously loaded with [[load_wav]](). |
== Parameters == | == Parameters == | ||
Line 11: | Line 11: | ||
| '''INT''' waveID || - The [[WaveID]] of the sound effect to be played. | | '''INT''' waveID || - The [[WaveID]] of the sound effect to be played. | ||
|- | |- | ||
- | | '''INT''' repeats || - Number of times to repeat the sound effect. Use -1 for an infinite loop. | + | | '''INT''' repeats || - Number of times to ''repeat'' the sound effect. Use -1 for an infinite loop. |
+ | |- | ||
+ | | ['''INT''' channel] || - The [[sound channel]] the [[sound effect]] is to be played on (-1 for any, default). | ||
|} | |} | ||
== Returns == | == Returns == | ||
- | '''INT''' : | + | '''INT''' : The [[sound channel]] the [[sound effect]] is now playing on. |
{| | {| | ||
- | | -1 || - Error | + | | -1 || - Error: sound inactive; invalid waveID |
|- | |- | ||
- | | 0 || - | + | | >=0 || - The [[sound channel]] the [[sound effect]] is now playing on. |
|} | |} | ||
+ | |||
+ | |||
== Example == | == Example == |
Revision as of 11:46, 31 July 2007
Contents |
Definition
INT play_wav ( <INT waveID> , <INT repeats> , [<INT channel>] )
Plays a sound effect previously loaded with load_wav().
Parameters
INT waveID | - The WaveID of the sound effect to be played. |
INT repeats | - Number of times to repeat the sound effect. Use -1 for an infinite loop. |
[INT channel] | - The sound channel the sound effect is to be played on (-1 for any, default). |
Returns
INT : The sound channel the sound effect is now playing on.
-1 | - Error: sound inactive; invalid waveID |
>=0 | - The sound channel the sound effect is now playing on. |
Example
Program Private int wave; Begin wave = load_wav("my_wav.wav"); play_wav(wave,0); Loop frame; End End
Used in example: load_wav()