GetFreeMusic
MusicIndex = GetFreeMusic()
 
Parameters: NONE
Returns:

    MusicIndex = The Index Music Channel that is currently Free for use
 

The GetFreeMusic function returns the Index of a Music that is currently NOT in use. This is particularly useful when you wish to dynamically request and use Music media as you need it. As it takes the burdon of managing available Music indexes off your shoulders, and hides it away inside PlayBasic.



FACTS:


* GetFreeMusic() will return a ZERO if the max number of Music Indexes have been exceeded.



Mini Tutorial:


This example uses GetFreeMusic() to request a free music index. Then using this index it loads a music track and plays.


  
; Ask PlayBASIC for the Music Index that is currently free for use.
  MyMusic=GetFreeMusic()
  
; Load a Music File into this Free Music
  LoadMusic "..\..\..\Music\Ambient.xm",MyMusic
  
; Play the Music
  PlayMusic MyMusic
  
; Display the Status of MyMusic
  Print "Music Status:"+Str$(GetMusicStatus(MyMusic))
  
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  





 
Related Info: DeleteAllMusics | DeleteMusic | GetMusicStatus | LoadMusic | LoadNewMusic :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com