|
-
February 19th, 2008, 05:59 PM
#1
Two sounds at once -
Sup guys,
How can someone play two different sounds at once using PlaySound(...)?
Thanks.
Just sayin' but I'm 14(I'm telling you this so you know what sort of language to use).
Advice received by a user.
-
February 19th, 2008, 08:37 PM
#2
Re: Two sounds at once -
PlaySound doesnt have any sound mixing. You will have to use a sound library such as sdl mixer / FMOD / Directx
Last edited by bovinedragon; February 19th, 2008 at 08:41 PM.
Don't forget to rate my post if I was helpful!
Use code tags when posting code!
[code] "your code here" [/code]
-
February 19th, 2008, 08:48 PM
#3
Re: Two sounds at once -
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.
Just sayin' but I'm 14(I'm telling you this so you know what sort of language to use).
Advice received by a user.
-
February 19th, 2008, 11:28 PM
#4
Re: Two sounds at once -
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.
-
February 20th, 2008, 06:40 AM
#5
Re: Two sounds at once -
I tried your idea and it didn't seem to change a thing 
Any other ideas?
Thanks.
Just sayin' but I'm 14(I'm telling you this so you know what sort of language to use).
Advice received by a user.
-
February 20th, 2008, 10:21 AM
#6
Re: Two sounds at once -
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.
-
February 20th, 2008, 03:00 PM
#7
Re: Two sounds at once -
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.
Just sayin' but I'm 14(I'm telling you this so you know what sort of language to use).
Advice received by a user.
-
February 20th, 2008, 03:11 PM
#8
Re: Two sounds at once -
 Originally Posted by .pcbrainbuster
I 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 audio
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!]
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
February 20th, 2008, 03:30 PM
#9
Re: Two sounds at once -
Guess playing multiple sounds will have to wait for some time I plan to learn DirectX later in my life.
Just sayin' but I'm 14(I'm telling you this so you know what sort of language to use).
Advice received by a user.
-
February 21st, 2008, 11:01 AM
#10
Re: Two sounds at once -
 Originally Posted by TheCPUWizard
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!]
LOOOL A very interesting solution
-
February 21st, 2008, 11:30 AM
#11
Re: Two sounds at once -
 Originally Posted by Marc G
LOOOL  A very interesting solution 
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.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
February 21st, 2008, 12:32 PM
#12
Re: Two sounds at once -
 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.
Hehe, in that context I can indeed see the use for such a solution.
I can barely imagine what kind of solutions you had to come up with to accomplish certain things in those days
-
February 21st, 2008, 12:49 PM
#13
Re: Two sounds at once -
 Originally Posted by Marc G
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].
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);
}
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
February 23rd, 2008, 12:11 PM
#14
Re: Two sounds at once -
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.
-
February 23rd, 2008, 12:44 PM
#15
Re: Two sounds at once -
 Originally Posted by Marc G
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.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|