Sup guys,
How can someone play two different sounds at once using PlaySound(...)?
Thanks.
Printable View
Sup guys,
How can someone play two different sounds at once using PlaySound(...)?
Thanks.
PlaySound doesnt have any sound mixing. You will have to use a sound library such as sdl mixer / FMOD / Directx
I'm not exactly talking about mixing :) What I meant to say was can PlaySound be used twice at once, without you having to wait ofr it to return?
Thanks.
Maybe if you call it in a thread while calling it in main thread too. Though thats not exactly an efficient way, and may still not work.
I tried your idea and it didn't seem to change a thing :(
Any other ideas?
Thanks.
Try to use the SND_ASYNC flag. However, please note that with PlaySound you cannot play 2 sounds at the same time. When you try either the current sound will stop or the new will not play.
I think I should start this post by telling you the purpose of me needing PlaySound to play two(or more) sounds at once. Bascially, I'm creating a program that plays a range of selecting sounds and certain selected sounds will/should play at the SAME time. So is there ANY way what so ever to play multiple sounds at once?
Thanks.
YES, and you were already given some good answers about things (like DirectX) that are capable sophisticated audioQuote:
Originally Posted by .pcbrainbuster
Of course you could network multiple computers together and have each one of them play one sound. You would hear multiple sounds at once [the preceeding was a joke!]
Guess playing multiple sounds will have to wait for some time :( I plan to learn DirectX later in my life.
LOOOL :lol: A very interesting solution :DQuote:
Originally Posted by TheCPUWizard
Actually that was a very real solution for a project I worked on back in the late 1970's. Granted the computers were RCA 1802 uP's and the "network" was direct IO port interconnects. But it was one of the first truely multi-voice professional quality digital synths. The output from each UP went to an A/D which whas then fed into a 32 channel Makie.Quote:
Originally Posted by Marc G
Hehe, in that context I can indeed see the use for such a solution.Quote:
Originally Posted by TheCPUWizard
I can barely imagine what kind of solutions you had to come up with to accomplish certain things in those days :)
No need to "imagine", most (larger) public libraries have archives of Byte managizine from the mid 1970's [1973 thru 1978 are probably the best].Quote:
Originally Posted by Marc G
They say that "necessity is the mother of invention", and back then sometimes necessity was a real mother [censored].
Unfortunately there are VERY VERY few schools (secondary, collega, university, technical) that even introduce students to the fundaments of a very simple system. So few programmers these days really have an understanding of how the very computer they are writing code for actually works.
For example, assume you have 2 bytes each represented by their individual bits [A7..A0] and [B7..A0]. Using just "Nand" functionallity, generate the Sum [Represented as [C7..C0]. Temporary boolean variables may be used, but NO other functionallity.
Code:bool NAND(bool x, bool y)
{
return !(x&&b);
}
Well, at my university we learned how computers are working internally. Everything from basic registers and logic operations on transistor level up to higher levels.
Fortunately some schools DO teach this. Often it only occurs in "engineering" courses. I have interviewed MANY college graduates who could not even follow a simple logic diagram.Quote:
Originally Posted by Marc G