TMusicLoop Class

Definition

Class to play an individual sound or a music (as background loop or not)

Delphi
type TMusicLoop = class(TObject)
Inheritance
TObject
TMusicLoop

Constructors

Create

Create an instance of a TMusicLoop or use "TMusicLoop.Current" to use the default one

Destroy

Destroy this instance

Properties

AudioPaused
Filename
Volume

Set or get volume level for current playing sound or music

audioActif
audioEnBoucle
audioOn
tag

Methods

Current

Get the instance of the default music loop to use it as a singleton

CurrentTimeInSeconds

Return current playing time in seconds

DurationInSeconds

Return the music duration in seconds

IsActive

Check if a sound or music file is loaded

IsPlaying

Check if a sound or music is playing

Load(string)

Load a music or sound (file formats depend on the operating system). You can try MP3 for music and WAV for sounds

Pause

Stop the music or restart it if it was paused

Play(Boolean)

Play current soound or music in an infinite loop or one time

Play(string, Boolean)

Load and play a sound or music

PlaySound

Just play current sound once time

Stop

Stop current play (sound or music)

isPaused

Return true if the music is in pause