View Full Version : music

10-06-2004, 02:39 AM
how do I put music in a project?

please explain in point form. ^_^

Harry Hunt
10-06-2004, 06:21 AM
There are several possibilities

TMediaPlayer (can play WAV, MIDI and CD Audio)
1. Select the system "System" tab from the components library, look for "TMediaPlayer" and place it on your form.
2. In the object inspector, set the "filename" property to a file on your hard disk (It's actually better to do that at runtime since you should be using relative paths).
3. Do this: MediaPlayer1.Play;
4. You wight want to se the "Visible" property to false.

PlaySound (can play WAV)
1. Put "MMSystem" in the uses-clause of your program.
2. Put this in your code PlaySound(PChar(SoundFileName), 0, SND_FILENAME or SND_ASYNC);

Use DirectSound (can play WAV)
1. Get the JEDI DirectX Header translations
2. Look for a tutorial on the web or buy a book on DirectX.
(Too difficult to explain it here)

Use DirectMusic (can play WAV, MIDI and DirectMusic Producer files)
(See above)

Use FMOD, BASS, MODPLUG or The Housemarque Sound System (can play WAV, MP3 and various tracker formats)
1. Go to one of these sites: http://www.fmod.org, http://www.un4seen.com, http://www.s2.org/hmqaudio/, http://www.modplug.com/modplug/developer.php3
2. Look for tutorial on the web and read the documentation

Use DelphiX, PowerDraw, Omega or XCESS (can play various formats)
1. Download paths can be found on DGDEV.
2. Look at the samples that come with these wrappers.

10-06-2004, 07:03 AM
OpenAL is also an option and its very easy to use.

10-06-2004, 07:32 AM
Problem with OpenAL in Windows is that it doesn't natively support music yet, it's just a sound library, the new beta version does support Vorbis OGG, but it's a beta so it's not guaranteed to work! :)

If you are just starting and want to make a non-commercial product or are ready to pay for a license for a commercial product, use FMOD it really rocks! :)