Wave Audio OnDeactivate Method

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

Wave Audio OnDeactivate Method

Postby FrankHunter » June 15th, 2005, 8:31 pm

Hi, this is an excellent product, thank you!

My question is that the StockAudioPlayer is connected to a WaveCollection with 2 songs. The first one is started in my FormCreate event. The second is supposed to start when the first ends. So I have the line

StockAudioPlayer1.PlayStock(1);

in the StockAudioPlayer's OnDeactivate Event. I know the event is called because I put a breakpoint there to check. But the song never plays.

Any idea what I'm doing wrong?
FrankHunter
Member
Member
 
Posts: 2
Joined: June 15th, 2005, 8:27 pm

Postby Kambiz » June 16th, 2005, 7:24 am

I wrote a similar code and it worked! :roll:
Attachments
MySample.zip
My sample code
(425.37 KiB) Downloaded 157 times
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Thanks!

Postby FrankHunter » June 16th, 2005, 5:10 pm

Thanks, all fixed.

One other question, is it possible to load the wav files into a WaveCollection component in the FormCreate or do the wav files have to be pre-loaded?

If they can be loaded at runtime what is the code?

Sounds.Waves.Add(FileName) ??
FrankHunter
Member
Member
 
Posts: 2
Joined: June 15th, 2005, 8:27 pm

Postby Kambiz » June 16th, 2005, 6:45 pm

First you should add a new WaveItem to WaveCollection, then load the wave file in to the Wave property of the WaveItem.

All can be done in a single line as follow:

Code: Select all
Sounds.Waves.Add.Wave.LoadFromFile(FileName);

Please look at the Wave Audio package's document for TWaveCollection properties for detailed description.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 1 guest