Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

SimonB

DelphiX Wavelist

This topic is 5728 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Having antother problem here (nothin Powerdraw related this time , I wanted to use a DXWavelist component to play sounds inside the game, but loading the .wav files in delphi does not seem to be a good idea (.exe would be something like 30 megs when the game is finished) but I wanted to dynamically load files into it at the start, so to say preload the sounds and then play them in the game, I do not want to have to load the sounds every time I play them but to stay in the memory (in the DXWavelist that is) but I have absolutely no idea how I could do this, thanks in advance for any help

Share this post


Link to post
Share on other sites
Advertisement
Load them manually. Here''s some code from my old Black Magic project:


  
procedure TMainForm.LoadSamples();
const
SampleNames: array[0..12] of string =(''beam1.wav'', ''beam2.wav'', ''beam3.wav'', ''beam4.wav'', ''beam5.wav'', ''beam6.wav'', ''beam7.wav'', ''crash0.wav'', ''crash1.wav'', ''crash2.wav'', ''crash3.wav'', ''crash4.wav'', ''launch.wav'');

var
i: Integer;
Item: TWaveCollectionItem;
begin
for i:=0 to 12 do
begin
Item:= TWaveCollectionItem.Create(DXWaveList.Items);
Item.Wave.LoadFromFile(''sounds\'' + SampleNames[i]);
Item.Frequency:= 22050;
Item.Name:= SampleNames[i];
Item.MaxPlayingCount:= 3;
end;
end;

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!