Hello! Thank you for watching.. :)

How is it possible to loop a sound without a delay inbetween?? I need a few sounds, about 100, loaded into the memory, all ready to play, And loop, without a delay inbetween. How is this possible in delphi?? I don't want to play 100 at a time, just about 6.. but the rest needs to be on stand by.

Thank You!! Any help would be much appreciated!
Best regards
Corné

Recommended Answers

All 5 Replies

Dear my friend
hear is the solution for playing a sound continuously before using this code you mast use mmsystem Unit in Uses Part of your Unit

procedure TForm1.Button1Click(Sender: TObject);
begin
    SndPlaySound('1.wav', SND_ASYNC or SND_LOOP) ;
end;

"1.Wave" is the sample sound file. you can write full address of another sound file instead that.

But unfortunately I don't Understand what your min about 100 sound and playing them repeatedly !!

Bye

Thank you friend! This works fubulous!! :) :) Is there a way to stop a specific sound?? Lets say I used this "1.wav".. and i am playing other sounds too, is there a way to stop only "1.wav" ??

What I meant was, 100 audio files need to be on stand by and be ready to play at the press of a button, and loop. I thought it will have to be loaded to the memory. This works amazing though, so it wont be neccesary!

Thank you again, very much for your help! :) I appreciate it a lot.
Best Regards
Corné

Dear my friend
hear is the solution for playing a sound continuously before using this code you mast use mmsystem Unit in Uses Part of your Unit

procedure TForm1.Button1Click(Sender: TObject);
begin
    SndPlaySound('1.wav', SND_ASYNC or SND_LOOP) ;
end;

"1.Wave" is the sample sound file. you can write full address of another sound file instead that.

But unfortunately I don't Understand what your min about 100 sound and playing them repeatedly !!

Bye

Oh, i also notice this method only can play 1 sound at a time. Is there no way to bypass this?

Thank you
Corné

Is there a way to stop a specific sound??

Hi
hear is the code for stopping to play Sound

procedure TForm1.Button2Click(Sender: TObject);
begin
    SndPlaySound(nil, SND_ASYNC or SND_LOOP) ;
end;

note that this function play only one sound at a time.
if you want to play tow sound at Time you can play another sound by TMediaplayer in System tab of Delphi

Thank you very much for your help!! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.