forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

audio mixing??

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
yokfran



Joined: 28 Dec 2009
Posts: 16

PostPosted: Sun Jan 31, 2010 8:46 pm    Post subject: audio mixing?? Reply with quote

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:
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.
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Mon Feb 01, 2010 2:02 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
yokfran



Joined: 28 Dec 2009
Posts: 16

PostPosted: Mon Feb 01, 2010 1:11 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Mon Feb 01, 2010 8:17 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
yokfran



Joined: 28 Dec 2009
Posts: 16

PostPosted: Tue Feb 02, 2010 1:31 am    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Tue Feb 02, 2010 2:24 am    Post subject: Reply with quote

You have to manage with 8 channels.
Back to top
View user's profile Send private message
crazyc



Joined: 17 Jun 2005
Posts: 410

PostPosted: Tue Feb 02, 2010 2:31 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
yokfran



Joined: 28 Dec 2009
Posts: 16

PostPosted: Tue Feb 02, 2010 2:32 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group