Audio usage - functions
Audio usage - functions
I've just had a look to audio programming and noticed that there's too little info available on functions' usage and meanings.
So, what is the difference between sceAudioOutput and sceAudioOutputBlocking and what *Panned means?
Is it also possible to use interrupts when buffer ends ?
p.s. I know about the audiolib, but maybe there's a better way? :)
So, what is the difference between sceAudioOutput and sceAudioOutputBlocking and what *Panned means?
Is it also possible to use interrupts when buffer ends ?
p.s. I know about the audiolib, but maybe there's a better way? :)
http://www.fumi2kick.com/pspapp/ Download the source for tcgs car. It has a lot of functions with sound channels and playing .wavs over each other. This may not be exactly what you're looking for. The pspsdk examples have something on sound, too? It's hard to find a lot of examples, but the playstation is still early.
replying to myself ;)
Maybe it is well-known and everyone is too lazy to write a few words ;) but maybe it`d be useful to somebody.
The functions with Blocking postfix wait while for the buffer to stop playing and then play the new one (ordinary functions, like sceAudioOutput, start playing the new one immediately).
The functions with Panned postfix play sounds with different volume on the left and right channels (imho useful for hardware mix of a few mono-channels).
I still don't know anything about interrupt usage, at this moment it can be probably found in official SDK only.
2 Duo:
Thanks for your reply, but these sources didn't give any useful info to me, because they use SDL_auduo libs.
Maybe it is well-known and everyone is too lazy to write a few words ;) but maybe it`d be useful to somebody.
The functions with Blocking postfix wait while for the buffer to stop playing and then play the new one (ordinary functions, like sceAudioOutput, start playing the new one immediately).
The functions with Panned postfix play sounds with different volume on the left and right channels (imho useful for hardware mix of a few mono-channels).
I still don't know anything about interrupt usage, at this moment it can be probably found in official SDK only.
2 Duo:
Thanks for your reply, but these sources didn't give any useful info to me, because they use SDL_auduo libs.
-
- Posts: 75
- Joined: Mon Sep 19, 2005 5:41 am
I am trying to get audio to work to and have not found a good foothold yet. The PS2 game I am porting needs to be able to play a long, looping .WAV (or .MP3) background piece of music, and then various sound effect need to be able to be cued overtop.
I figured that since the PSP is such a rich multimedia device this kind of stuff should be easy, but I have not yet been able to find sample code that would allow me to do this.
Any help from one of the audio experts on this forum would be greatly appreciated!!
I figured that since the PSP is such a rich multimedia device this kind of stuff should be easy, but I have not yet been able to find sample code that would allow me to do this.
Any help from one of the audio experts on this forum would be greatly appreciated!!
-
- Posts: 75
- Joined: Mon Sep 19, 2005 5:41 am
Thanks for the tip, but I agree with Shinen I would rather not introduce SDL into this when all I want to do is play a .WAV file.
It looks like the hooks are there to output buffers, but the buffers would need to be fed/filled by hand. If data does not fit in memory then streaming would need to be written. If format is other than RAW data than it would need to be converted realtime, and if more than 8 Mono/4 stereo channels are needed then mixing would need to be done by hand as well.
Has anyone done this without using SDL or other OpenSource routines?
It looks like the hooks are there to output buffers, but the buffers would need to be fed/filled by hand. If data does not fit in memory then streaming would need to be written. If format is other than RAW data than it would need to be converted realtime, and if more than 8 Mono/4 stereo channels are needed then mixing would need to be done by hand as well.
Has anyone done this without using SDL or other OpenSource routines?
You could take a look at the PSPSDK samples at http://svn.ps2dev.org/listing.php?repna ... rev=0&sc=0 . The audio functions uses callback functions, which are called from interrupt, I think.Shinen wrote:I still don't know anything about interrupt usage, at this moment it can be probably found in official SDK only.
If you just want to play some WAV files, take a look at mikmodlib or libmikmod in the SVN repository and e.g. at Lua Player in the pspware SVN repository to see how to use mikmod for playing WAVs and MODs.
Audiolib makes threads with higher priority and use "*blocking" functions.Shine wrote:You could take a look at the PSPSDK samples at http://svn.ps2dev.org/listing.php?repna ... rev=0&sc=0 . The audio functions uses callback functions, which are called from interrupt, I think.
So callback functions called from thread of audiolib.
This is still a work-in-progress, but you might be interested in trying the audio portion of a framework I'm writing: http://captaindan.org/sw/GameKit/starman2049 wrote:Has anyone done this without using SDL or other OpenSource routines?
Documentation is available there and is also included in the download. Like I said, it's still a work-in-progress, so there are some rough edges and one or two things mentioned in the docs that don't actually work yet. (Most notably, texture swizzling isn't implemented.) But the audio stuff is pretty solid.
Please let me know if you need any help with it.