audio mixing??

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
yokfran
Posts: 12
Joined: Mon Dec 28, 2009 9:17 pm

audio mixing??

Post by yokfran »

i'm wondering how to mix two or more sound stream.
is there any internal functions to mix the audio(buffer)?


i've searched all the pspsdk "src" dir by word "mix", but only one line found:

Code: Select all

try("ms0:/PSP/../PSP/");   /* mixed                       */
so i really dont know how to do, but i've seen a thread named "SceAudioMixer" from psplink.

If anyone knows, please teach me how to mix audio through internal functions.
thank u very much.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

No one mixes audio in real time games. That's why you need a sound card with lots of channels. Just play each on a different channel.
yokfran
Posts: 12
Joined: Mon Dec 28, 2009 9:17 pm

Post by yokfran »

Torch wrote:No one mixes audio in real time games. That's why you need a sound card with lots of channels. Just play each on a different channel.
thanks for the reply

So, i have to mix audio buffers in another thread.
m0skit0
Posts: 191
Joined: Tue Jun 02, 2009 8:58 pm

Post by m0skit0 »

No, I think Torch means play one sound in one channel, the other in other channel, simultaneously, then you get a mixed result.
The Incredible Bill Gates wrote:The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
yokfran
Posts: 12
Joined: Mon Dec 28, 2009 9:17 pm

Post by yokfran »

m0skit0 wrote:No, I think Torch means play one sound in one channel, the other in other channel, simultaneously, then you get a mixed result.
I think he said "sound card" that means he was saying the situation on PC.
(Does psp have hardware sound card? I dont know...)

The psp has only 8 audio channels, but I want 2 channels for each music/sound, so i must create 4 threads for audio output.
I dont know each size of each audio stream, one maybe 1 sec(short sound), or maybe 2 min(long music), so I cannot just play them directly, thay must be mixed before output function called.

So I want to know, is there an internal functions to mix audio, better via psp hardware. Like decode atrac3/mp3...
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

You have to manage with 8 channels.
crazyc
Posts: 408
Joined: Fri Jun 17, 2005 10:13 am

Post by crazyc »

Torch wrote:You have to manage with 8 channels.
The PSP (at least 1000 and 2000) has only 1 hardware stereo channel. The mixing of the 8 "channels" occurs in a kernel thread. If you mix yourself use sceAudioSRCOutputBlocking for a nice performance boost due to the skipping of the software mixer and get hardware sample rate conversion as a bonus.
yokfran
Posts: 12
Joined: Mon Dec 28, 2009 9:17 pm

Post by yokfran »

Torch wrote:You have to manage with 8 channels.
Right,

but one thing i cared about is, sometimes there may be lot of audio streams playing at the same time, so mixing is necessary.

Thanks for the advice.
Post Reply