GP32 Virtual Mixer


mystic_twin

Still Fresh
Joined
Jul 2, 2003
Messages
30
Hi all,

I have this idea for a game that i would like to code up, the only problem is audio. I will need about 8 channels of audio to carry it off properly, and this would mean mixing 8 channels down into 4.

Does anyone know of a way to do this?

Also, does anybody have any idea how much GP CPU it would use to play 8 channels similtaniously (if it was coded well).

Any light shed on this topic would be greatly appreciated.

Cheers. :)
 
Mixing isn't the most CPU intensive task, so it shouldn't be a huge deal. The standard way to deal with it (AFAIK) is to take the two overlapping audio tracks, and for each sample, add the sample numbers together, remembering to not let the ints wrap around if it gets too high or two low. The number produced is the mix of the two sounds.

Mind you, this can cause distortion issues if your waveforms are very similar, and so there are better methods that use logarithms and such, but that's about the simplest way to do it.

Anyone else want to comment on a better way?
 
could this work for mixing mp3's as well? DJ's get pissed of when I turn up with a laptop, it would really bug them if i used a gp!
 
hahah yeah, it could... but that means you have to decode 2 MP3s at once. I think the GP32 could probably handle it, but you could kiss your battery-life goodbye. ;)
 
Back
Top