On Stackoverflow I found a code snippet to import a WAVE file in an application.
I used that code to play a song in a loop.
Is it possible to randomly pick a song out of an undefined amout of tracks?
for example now I have three songs, named after the naming scheme:
- song_01.wav
- song_02.wav
- song_03.wav
- song_0X.wav
Maybe I want to add some tracks, maybe I want to delete some.
This is my code for the music player:
procedure TForm1.MusicPlayer();
begin
RandomTrack := music; //I don't know how to randomly pick a song
PlaySound(music,0,SND_ASYNC or SND_LOOP);
end;