Playing multiple wav files in Delphi 2006

Posted on 2006-05-14
Last Modified: 2010-04-05
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 plain english

Sound1 = Filename
Sound2 = Filename
Sound3 = Filename
Sound20 = Filename

then i have to be able to something like


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.

Question by:Brommers
    LVL 22

    Accepted Solution

    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);

    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 ;-)

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

    LVL 1

    Author Comment

    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 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

    LVL 1

    Author Comment

    hello Mnasman :)

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

    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,

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
    Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now