This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Multiple wavs playing at the same time?


Multiple wavs playing at the same time?

Postby Karl » Jan 4, 2002 @ 9:14am

Still trying to bang my first game together.<br><br>Is it possible to play two wav files simultaneously using sndPlaySound or any other function?<br><br>
Karl
 


Re: Multiple wavs playing at the same time?

Postby BadBazza » Jan 4, 2002 @ 9:21am

Karl,<br><br>Yes you can play two wavs together but I don't think it can be done with nsdPlaySound. More likely WaveOut will help you.<br><br>I am currently using fmodce from http://www.fmod.org and would thoroughly recommend it. It allows you to play multiple wavs and a backing mod music file without any noticeable speed reduction.<br><br>If you are intending to distribute your game for free then fmodce is free. For commercial products have a look at the licensing page, I have a multiple shareware license which for $250 I think is good value.<br><br>I hope this helps<br>Bad<br><br>PS I have nothing to do with fmod other than being an impressed customer :)
Lost....... Assumed Coding!
User avatar
BadBazza
pm Insider
 
Posts: 81
Joined: Sep 21, 2001 @ 6:26am
Location: Blackpool, UK


Re: Multiple wavs playing at the same time?

Postby MirekCz » Jan 4, 2002 @ 9:27am

as far as I know, nope. You should mix all sound together by yourself into one wav and send it using waveout to get good results. You will create such a wav every 50-100ms or so. There's a basic waveout support in easyce1.6 as far as i remember, you will need to add some mixing routines by yourself, you can find some in midmod source code, i think.<br>Good luck
With best regards,
Mirek Czerwinski
User avatar
MirekCz
pm Member
 
Posts: 269
Joined: Sep 18, 2001 @ 6:42pm
Location: Poland,city Poznań


Re: Multiple wavs playing at the same time?

Postby Hosed » Jan 4, 2002 @ 9:50pm

BadBazza is right.  FMOD is really the way to go.  Not only is it some of the fastest sound code available, it also supports all the MOD formats (which are a REAL bitch to get right), MP3s, multiple wave outs, etc.  I see no reason to write your own in this regard, unless sound coding is your bag ofcourse.<br><br>-Hosed
L. L. Goodwin<BR>Purveyor of Code<BR><A href="http://www.planettribes.com/hosed/">Hosed's House of Code</A>
User avatar
Hosed
pm Member
 
Posts: 249
Joined: Jan 3, 2002 @ 2:51am
Location: Montana, USA


Re: Multiple wavs playing at the same time?

Postby MirekCz » Jan 5, 2002 @ 6:40am

hosed:or unless you want to release your stuff as shareware or so and 100$ (or what was the price) is a lil much for you.
With best regards,
Mirek Czerwinski
User avatar
MirekCz
pm Member
 
Posts: 269
Joined: Sep 18, 2001 @ 6:42pm
Location: Poland,city Poznań


Re: Multiple wavs playing at the same time?

Postby Phantom » Jan 5, 2002 @ 8:17am

Lemmings is using MikMod. It works fine, but it is a little slow, IMO. It is free however.
Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Re: Multiple wavs playing at the same time?

Postby Dan East » Jan 5, 2002 @ 8:54am

IMO, the FMOD limitation that it can no longer play sound if the device is powered off / on places it one small step above worthless.<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: Multiple wavs playing at the same time?

Postby MirekCz » Jan 5, 2002 @ 11:00am

hmm, how's that? couldn't they simple make a routine that checks if device was turned off/on and reinitialize if needed???
With best regards,
Mirek Czerwinski
User avatar
MirekCz
pm Member
 
Posts: 269
Joined: Sep 18, 2001 @ 6:42pm
Location: Poland,city Poznań


Re: Multiple wavs playing at the same time?

Postby Dan East » Jan 5, 2002 @ 11:33am

Jacco, is this the version of mikmod you use:<br>http://www.xsolution-online.de/mikmodce.htm<br><br>It says for ARM only. I just wondered if there were multiple ports of it to CE created by different coders, thus some may be better than others. Can mikmod be used to play synchronous wavs as well, or does it just do mods / music?<br><br>I think that is one of the most blaring, lacking things for CE gaming development at this time - a good, open source, free sound library. mikmod may be the solution, but is sounds like it at least needs optimizing. There are several gfx libraries, and even a few fixed point 3D engines that look pretty good. So maybe we can take mikmodce and optimize it into what it should be?<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: Multiple wavs playing at the same time?

Postby Phantom » Jan 5, 2002 @ 1:13pm

Yeah, that's where I got it. And it compiles just fine on all other PPC's. No problem. Just stick with 22Khz or even 11Khz to keep the CPU hit reasonable.<br><br>Main issue with the performance is not the average CPU usage BWT, because that seems to be OK. MikMod does however seem to use more % in some frames, making games slightly jerky.
Give me some good data and
I will give you the world
User avatar
Phantom
pm Insider
 
Posts: 913
Joined: Feb 21, 2001 @ 8:14am
Location: Houten, Netherlands


Re: Multiple wavs playing at the same time?

Postby Dan East » Jan 5, 2002 @ 5:50pm

I looked at the source and didn't see anything too cludged together. It looked decent to me. It doesn't look like any of the actual core routines were even touched in the porting process. Of course being that they are all math none should be needed.<br><br>It would be interesting for someone with both MikMod and FMod to create a simple test app to play a mod file. Then each time you call the update function calc the milliseconds it required to process (GetTickCount) and generate a culmulative total of milliseconds processing required to play that mod. We could then see exactly which was more effecient, and how much so. That would ebe very interesting, hint, hint. :)<br><br>Jacco, various effects performed on the instruments could greatly increase processing while that one note was played. That of course is note-specific, so the artist would "cause" that problem. You could always edit the mod and strip out the effects, modify the player to not perform certain effects, or ask the artist to not use them if the music is custom-made for you.<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: Multiple wavs playing at the same time?

Postby simonjacobs » Jan 5, 2002 @ 6:07pm

Dan:<br><br>With fmod you just call PlaySong and it gets on with things in its own thread, you dont need to call anything else. I'm not sure how you could count the processing time it uses except by monitoring processor usage.<br>
User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Re: Multiple wavs playing at the same time?

Postby Digby » Jan 5, 2002 @ 6:44pm

Simon,<br><br>At a minimum, you could profile your app with the song playing, then again without it and note the difference in performance of other areas within the app (i.e. frame rate).  That's pretty easy to do and would at least give you a starting point in determining the overhead.<br><br><br>
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Re: Multiple wavs playing at the same time?

Postby Dan East » Jan 5, 2002 @ 7:40pm

If anyone has actually paid the small fortune and has access to the source, they could do the timing in FMod's main loop. That would provide the most accurate result that could be compared directly to MikMod.<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: Multiple wavs playing at the same time?

Postby MirekCz » Jan 5, 2002 @ 8:08pm

if you would ask fmod's developer really nice he might do it for you. But as far as I know fmod for ce is still work in progress and it lacks optimizations and mp3 support.
With best regards,
Mirek Czerwinski
User avatar
MirekCz
pm Member
 
Posts: 269
Joined: Sep 18, 2001 @ 6:42pm
Location: Poland,city Poznań


Next

Return to Phantom's Forum


Sort


Forum Description

Discuss any of Phantom's projects here (Operation Nutcracker, etc.)

Moderators:

sponge, RICoder, Phantom

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum