Advertisement

Sound/Music in Delphi demos

Started by September 21, 2000 02:03 PM
0 comments, last by TeRan 24 years, 4 months ago
HI! I have a trouble with creating delphi-OpenGL demos.. I don''t know how to add sound and/or music... any kind of music format is ok(midi,mp3,mod,..) and any kind of sound... I konw there is component TMediaPlayer in delphi but id doesn''t work if there is no form... if i create it manulaly (name.create(self)) it just returns some wierd error. Please help! Mail me if you have any kind of unit/lib to load and play sound files in Delphi... thanks! -Mirko
Alright, major breakthrough here if I can help you since I don''t even know what the Delphi editing screen looks like let alone the code, but, if you take a look at lesson 21 (the one with the pic that says ''Grid Crazy'') then you''ll find some basic sounds in there... Pretty sure it''s using DirectSound...

Here''s the line I fished out of the Delphi port, see if it works

PlaySound(''test.wav'', 0, SND_ASYNC or SND_LOOP);

should play a .wav file called test.wav... Dunno if there was supposed to be more code with the Delphi version or not, try it out, if it doesn''t work, read through the Delphi port of tutorial 21.

S.

This topic is closed to new replies.

Advertisement