[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 444
  • Last Modified:

Playing multiple wav files in Delphi 2006

Hello everyone :)

I am a total Delphi newbie having recently moved from Visual Basic 6. Loving the language but finding it hard to do a few things.

I need to be able to play several short sounds (longest is less than 30 seconds) on top of each other...in plain english

Sound1 = Filename
Sound2 = Filename
Sound3 = Filename
etc..
Sound20 = Filename

then i have to be able to something like

Sound1.position=start
Sound2.position=start
Sound3.position=start
Sound1.play
Sound2.play
Sound3.play

the sounds should not stop the app from running and should only play once. I also need to be able to do a

Sound1.volume = 50 ; volume levels would be something like 0 per cent to 200 per cent.

All of the files are wav format...but if I could use MP3 then that would be an added bonus (not necessary tho)

I have tracked down the Jedi-Delphi headers for DirectX9 SDK but on downloading I dont find anything I recognise that would help me...I just see a lot of pas files. As I said I have never used Delphi before and am totally new to it. But I believe that DirectSound is the way I would like to go.

Would anyone familair with the Jedi DirectX9 headers be able to help...or assist me in learning what it is I need to make this work?

Would really appreciate your help. I'm assigning 500 points to this question because its pretty urgent I get this functionality up and running.

Thanks
Brommers.
0
Brommers
Asked:
Brommers
  • 2
1 Solution
 
Mohammed NasmanSoftware DeveloperCommented:
Hello Brommers,

You can easily use PlaySound API, to play wav sound files, you can play them Simultaneously use SND_ASYNC in the third parameter

or use SND_SYNC to play them one after one

uses MMsystem;

procedure TForm7.Button1Click(Sender: TObject);
begin
  PlaySound('c:\sound1.wav',0,SND_ASYNC);
  PlaySound('c:\sound2.wav',0,SND_ASYNC);
  PlaySound('c:\sound3.wav',0,SND_ASYNC);
end;


if you need more advanced and better way to work with sound files, look dsPack, it's a open source project to work with multimeda files using DirectX, but in easier way than JEDI one, you can build your own Media player with DsPack easily ;-)

http://www.progdigy.com/index.php

BTW, welcome to Delphi world, it's much better than VB (me old VBers :D)

Regards,
Mohammed
0
 
BrommersAuthor Commented:
Hi mnasman :)

the PlaySound API unfortunately isn't powerful enough for what I want to do. I did have a look at the DSPack some while ago but at that time Delphi 2006 had only just been released and there were no instructions on how to install it to work under 2006. Looking again I can see someone has posted on how to install it...so I will take a look at it in more depth. However it is I think more a wrapper for DirectShow than DirectSound...

Thanks for your help, will post back here if I  can get it to work

Brommers
0
 
BrommersAuthor Commented:
hello Mnasman :)

after researching for nearly 12 hours I came across a 3rd party sound library called BASS

www.un4seen.com

its an API driven system, costs $100 but the power it has after experimenting with it for just over 2 hours now is more than satisfying. I'll use this system I think :)

Thanks for posting with your help, and as you were part of the solution lifetime, I'm awarding you the points for the help you gave.

All the Best,
Brommers
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now