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 

Need help, pspAudioSetChannelCallback()

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



Joined: 18 Sep 2006
Posts: 5

PostPosted: Tue Sep 19, 2006 10:02 pm    Post subject: Need help, pspAudioSetChannelCallback() Reply with quote

Say, I have an audio file with 2 channels, do I need to call pspAudioSetChannelCallback() function for each channel of the audio file?
I tested to call it just once:
Code:
pspAudioSetChannelCallback(0, callback, 0);

it sounded like both channels were playbacked.
then
Code:
pspAudioSetChannelCallback(1, callback, 0);

also worked..
I also searched through internet, but there are very few documentations on pspsdk functions, so what on earth does the first argument mean?

Thanks!
Back to top
View user's profile Send private message
laichung



Joined: 06 May 2005
Posts: 123

PostPosted: Wed Sep 20, 2006 11:55 am    Post subject: Re: Need help, pspAudioSetChannelCallback() Reply with quote

from the source code of PSPSDK pspaudiolib.c

Code:

void pspAudioSetChannelCallback(int channel, pspAudioCallback_t callback, void *pdata)
{
   volatile psp_audio_channelinfo *pci = &AudioStatus[channel];
   pci->callback=0;
   pci->pdata=pdata;
   pci->callback=callback;
}



Hope it can help you. And I think you mis-understanding the meaning of "channel" in the function, it is not mean to "L/R" channel, it should be the hardware mixing sound channel. (mean multi sources of sound input)

There are few documentations on internet about PSPSDK becasue most of the comments are already inside the source code of PSPSDK and the header file. So you better keep a copy of the PSPSDK source code. (or if you have enough patient, go to web access of SVN to search what you need, with thoursand times of page reload)

Enjoy your coding and have fun :)


Gan Quan wrote:
Say, I have an audio file with 2 channels, do I need to call pspAudioSetChannelCallback() function for each channel of the audio file?
I tested to call it just once:
Code:
pspAudioSetChannelCallback(0, callback, 0);

it sounded like both channels were playbacked.
then
Code:
pspAudioSetChannelCallback(1, callback, 0);

also worked..
I also searched through internet, but there are very few documentations on pspsdk functions, so what on earth does the first argument mean?

Thanks!
Back to top
View user's profile Send private message
Gan Quan



Joined: 18 Sep 2006
Posts: 5

PostPosted: Thu Sep 21, 2006 12:00 pm    Post subject: Reply with quote

Emm.. you are right, I misunderstood the meaning of "channel", acutally I know little about programming multimedia devices, so, way to go, hehe.

Thanks for your reply, I can go back to my kill-them-all psp application now ;)
Back to top
View user's profile Send private message
laichung



Joined: 06 May 2005
Posts: 123

PostPosted: Thu Sep 21, 2006 1:58 pm    Post subject: Reply with quote

You are welcome , feel free to ask any question. I also a beginner of programming in PSP. Too many things to learn and discover.



Gan Quan wrote:
Emm.. you are right, I misunderstood the meaning of "channel", acutally I know little about programming multimedia devices, so, way to go, hehe.

Thanks for your reply, I can go back to my kill-them-all psp application now ;)
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