Page 1 of 1

StockAudioPlayer Question(s)

PostPosted: April 30th, 2009, 12:14 am
by CS60
I am trying to write program that will send notification sounds to a user. However, these notifications might be grouped together. (Three in rapid succession, for example.) Is there a way to force the StockAudioPlayer to finish the first sound before beginning the next one (or two)? I'm not familiar with your component(s), but I tried this:

StockAudioPlayer1.PlayStock(0);
StockAudioPlayer1.PlayStock(0);
StockAudioPlayer1.PlayStock(0);

Unfortunately, this generates an exception. (And a mis-spelling of the word "already" in the error dialog.)

Basically, what I would like to be able to do is this:

for x := 1 to 3 do
begin
Play Sound Here...
end;

In this case, each sound should play completely, and all three sounds should play.

Thanks.

Re: StockAudioPlayer Question(s)

PostPosted: April 30th, 2009, 2:25 am
by Kambiz
Call

Code: Select all
StockAudioPlayer1.WaitForStop;

after each play.

Re: StockAudioPlayer Question(s)

PostPosted: April 30th, 2009, 3:01 pm
by CS60
Kambiz wrote:Call

Code: Select all
StockAudioPlayer1.WaitForStop;

after each play.


Thank you. That worked perfectly....