Jump to content
plastkort

Playing multiple wave files simultaneously

Recommended Posts

Have been digging everywhere around the web for a solution that allows me to play simple wave files simultaneously... 

 

i found some examples but none of them works

 

soundplay works with only a single file at a time even if i create them in a TThread, i tried to change and tweak it, but for now i have given up, 

 

so now I am asking if anyone of you have experience with this before, any library that can help, i am not really interrested in using an external program as a via shell execute since it can slow things down.

 

would be perfect if there was a working windows API that just plays the sound and with no hassle.. 

 

mciSendString does not work at all either for me

 

 

 

 

 

 

 

Share this post


Link to post

As far as I remember from older discussions you have to merge (mix) the sound files into one before you can play it.

Windows has an API for that, see Audio mixers

If you google for

mixer audio sound delphi

you may find something useful.

 

Share this post


Link to post

Hi,

Playing dynamicaly sounds on parallel channel is not easy : You have to deal with low level media implementation.

 

I used BASS (https://www.un4seen.com/) for a kiosk app demo it is free for non commercial use : Delphi exemple are provided and mixing are perfect : It is the lightweightest solution that I known for excelent quality. IT match delphi (Win) and FPC for Win, Nix, and OsX.

As suggested by David, Mitov's AudioLab is, AFAIK, free for non cormercial use too, and match more target (FMX one) but I do not try it.

 

 

Share this post


Link to post

aparently this could work but it seems not to work in delphi by some reason ? 

 

uses mmSystem;

 

mciSendString('play D:\test.wav',nil,0,0); 

 

 

i seen other examples in c++ this works.. but in delphi it does not

 

Share this post


Link to post
14 minutes ago, plastkort said:

aparently this could work but it seems not to work in delphi by some reason ? 

 

uses mmSystem;

 

mciSendString('play D:\test.wav',nil,0,0); 

 

 

i seen other examples in c++ this works.. but in delphi it does not

 

What library is this from? It looks like the built-in API for the old original Windows audio services. This was inherited from DOS. I wouldn't go near it with a 10' pole!

 

You mentioned "bloat"... What percentage of your xxGB of memory is the footprint of your EXE taking up with whatever audio library you're referring to?

 

BTW, there's a reason that audio devices all need custom drivers to work flawlessly in WIndows but not MacOS. The audio support built into Windows SUCKS!

 

If you're really worried about "bloat" ... you'd avoid Windows for audio stuff.

 

And I can attest that Mitov's libs work VERY WELL for multi-channel audio (and video, too) on both Windows and Mac.

Share this post


Link to post
On 8/3/2019 at 5:44 PM, plastkort said:

would be nice if this does not bloat the filesize tho? 

 

 

What is more important to you? A solution that works, and 1mb extra exe file size, or no solution and 1mb smaller exe size? 

Share this post


Link to post

WARNING: Mitov's library installs both debug and release libs for every possible platform on your version of Delphi. It does take up quite a bit of disk space! But you can safely go through and delete the platform libs you won't need.

 

  • Like 1

Share this post


Link to post
On 8/5/2019 at 1:54 AM, David Schwartz said:

WARNING: Mitov's library installs both debug and release libs for every possible platform on your version of Delphi. It does take up quite a bit of disk space! But you can safely go through and delete the platform libs you won't need.

 

yeah it also modified my entire delphi IDE 😕 not cool

 

Share this post


Link to post
1 hour ago, plastkort said:

yeah it also modified my entire delphi IDE 😕 not cool

 

You can use the OpenWire GUI tool it installs in the IDE to wire-up your data flows, or you can do it in code. Trust me when I say that you do NOT want to do it manually in code!

 

But hey ... it'll solve your problem.

Share this post


Link to post
9 hours ago, David Schwartz said:

You can use the OpenWire GUI tool it installs in the IDE to wire-up your data flows, or you can do it in code. Trust me when I say that you do NOT want to do it manually in code!

 

But hey ... it'll solve your problem.

but still. I don't like the IDE modifications it does to my object inspector 😞 it's like forced upon me.. cannot uninstall that i think

Share this post


Link to post
9 hours ago, David Schwartz said:

You can use the OpenWire GUI tool it installs in the IDE to wire-up your data flows, or you can do it in code. Trust me when I say that you do NOT want to do it manually in code!

 

But hey ... it'll solve your problem.

I mean. this in the object inspector... i just doublecolick to toggle true and false.. amd now it opens this annoying dialog for every property that has some toggles, totally not cool

 

 

image.thumb.png.95f2338316bb6d344a9431271fbf6c5b.png

Share this post


Link to post

property editors ... there are ways to disable them.

 

I was trying to help you solve your audio playing problem.

 

Instead, it looks like you're more interested in discussing politics of how libraries are packaged.

 

If you have some beefs about a library, you need to take them up with the library's vendor.


I can't help you with that stuff. And I have no problem with it either. 

Share this post


Link to post
Just now, David Schwartz said:

property editors ... there are ways to disable them.

 

I was trying to help you solve your audio playing problem.

 

Instead, it looks like you're more interested in discussing politics of how libraries are packaged.

 

If you have some beefs about a library, you need to take them up with the library's vendor.


I can't help you with that stuff. And I have no problem with it either. 

Pardon!,

 

I did not mean to cause politics about it, just a friendly question on how to disable them if you knew,, I messaged the author but he did not answer, i'll try digging and see if i can disable this, and then i will try make it work:) 

 

no harm meant 🙂 thanks for the suggestion

 

Share this post


Link to post

Well, if you ever get around to dealing with your audio file playback problem again, keep us apprised of your progress.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×