LoopMusic
LoopMusic Index, State
 
Parameters:

    Index = The Index of Music you wish to resume
    State = Looping ON or OFF
Returns: NONE
 

LoopMusic allows you activate automatic looping for a music channel.



FACTS:


* You can't change the Looping state while a music is playing.

* You can also find this Example in the PlayBasic\Projects\Music folder

* Beware: Some Music Mod formats (I.e. MOD, XM etc) can be set up (by the music author) to never end, as such, those tracks will loop regardless !




Mini Tutorial:


This example will load a music file then let the user control the musics playback with various keyboard controls.

  
  
; 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
  
; Activate Looping for this music channel
  LoopMusic MyMusic,true
  
  
;  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: DeleteMusic | GetFreeMusic | LoadMusic | MusicVolume | PauseMusic | PlayMusic | ResumeMusic | StopMusic :
 


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