Need help, pspAudioSetChannelCallback()

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

Moderators: cheriff, TyRaNiD

Post Reply
Gan Quan
Posts: 5
Joined: Mon Sep 18, 2006 6:42 pm

Need help, pspAudioSetChannelCallback()

Post by Gan Quan »

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: Select all

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

Code: Select all

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!
laichung
Posts: 123
Joined: Fri May 06, 2005 2:02 pm

Re: Need help, pspAudioSetChannelCallback()

Post by laichung »

from the source code of PSPSDK pspaudiolib.c

Code: Select all

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: Select all

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

Code: Select all

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!
Gan Quan
Posts: 5
Joined: Mon Sep 18, 2006 6:42 pm

Post by Gan Quan »

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 ;)
laichung
Posts: 123
Joined: Fri May 06, 2005 2:02 pm

Post by laichung »

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 ;)
Post Reply