 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Gan Quan
Joined: 18 Sep 2006 Posts: 5
|
Posted: Tue Sep 19, 2006 10:02 pm Post subject: Need help, pspAudioSetChannelCallback() |
|
|
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 |
|
 |
laichung
Joined: 06 May 2005 Posts: 123
|
Posted: Wed Sep 20, 2006 11:55 am Post subject: Re: Need help, pspAudioSetChannelCallback() |
|
|
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 |
|
 |
Gan Quan
Joined: 18 Sep 2006 Posts: 5
|
Posted: Thu Sep 21, 2006 12:00 pm Post subject: |
|
|
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 |
|
 |
laichung
Joined: 06 May 2005 Posts: 123
|
Posted: Thu Sep 21, 2006 1:58 pm Post subject: |
|
|
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 |
|
 |
|
|
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
|