Sign in to follow this  

fast sound on Pocket PC

This topic is 4830 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm working on a game for Pocket PC's. The graphics part works great using gapi, but playing a sound kills the framerate. To play a sound I use sndPlaySound() with a sound file that was loaded at program start. Is there a fast way to play sounds on the Pocket PC or is it just to heavy for the cpu?

Share this post


Link to post
Share on other sites
Quote:
Original post by Decept
I'm working on a game for Pocket PC's. The graphics part works great using gapi, but playing a sound kills the framerate. To play a sound I use sndPlaySound() with a sound file that was loaded at program start. Is there a fast way to play sounds on the Pocket PC or is it just to heavy for the cpu?


I have like no experience in this field but maybe a smaller sound file might help. Have you tried on any other PPC's other than your own? Have you tried it wil differnt amounts of free RAM?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
visit pocketmatrix.com -> forums ->general developers for much info

Either use a library like mikmod, bass or fmod or write your own proper sound playing library using window calls (look for example into pocketquake source which does it)

It's quite easy and works well... the window call you're using is just for playing single sounds(like beep for warning) and not in-game sound/music.

Share this post


Link to post
Share on other sites
I don't have access to other Pocket PCs unfortunately.

I checked out PocketMatrix.com and downloaded the PocketQuake source. The way it's done in PocketQuake seems a little overkill for my game. Someone there also mentioned using PlaySound(), what's the difference between it and sndPlaySound()? They look almost identical (not like that says anything).

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Well, pocketquake is the first source file that came to my mind :)
Do some searching, you will surelly find some easier to understand/smaller source to work with.

It's actually pretty simple, whole code for playing a continous stream of data is like 100lines long. The thing left to do is loading .wav files and mixing them (mixing - add few signals together). Writing a .wav loader (assuming you use one format for all files) and sound mixer is very easy.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
ahh, found some code + tutorial for you

http://www.gamedev.net/reference/articles/article1348.asp

Use the waveout option. Now you only need to add .wav loader (best is if you decide yourself on one wav format like 21khz 16bit mono, and write only a simple loader which blindly tries to load data without checking header) and push the data to windows.

Remember that you need the same playback mode as your wav files or else you will get some strange results :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
(best is if you decide yourself on one wav format like 21khz 16bit mono, and write only a simple loader which blindly tries to load data without checking header)

IMO, it's not a bad idea to only try to load one format, but you really should have the function check that the wave file is in that format; it greatly simplifies debuging.

Share this post


Link to post
Share on other sites

This topic is 4830 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

Sign in to follow this