| View previous topic :: View next topic |
| Author |
Message |
Shinen
Joined: 18 Oct 2005 Posts: 8 Location: Moscow
|
Posted: Wed Nov 16, 2005 8:53 pm Post subject: 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? :) |
|
| Back to top |
|
 |
Duo
Joined: 21 Oct 2005 Posts: 25
|
Posted: Thu Nov 17, 2005 3:42 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Shinen
Joined: 18 Oct 2005 Posts: 8 Location: Moscow
|
Posted: Fri Nov 18, 2005 8:58 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
starman2049
Joined: 19 Sep 2005 Posts: 75
|
Posted: Sun Nov 20, 2005 6:09 am Post subject: |
|
|
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!! |
|
| Back to top |
|
 |
Duo
Joined: 21 Oct 2005 Posts: 25
|
Posted: Sun Nov 20, 2005 7:40 am Post subject: |
|
|
| The link above has a racecar game source with exactly that. It uses sdl, though. |
|
| Back to top |
|
 |
starman2049
Joined: 19 Sep 2005 Posts: 75
|
Posted: Sun Nov 27, 2005 3:34 pm Post subject: |
|
|
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? |
|
| Back to top |
|
 |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Sun Nov 27, 2005 6:22 pm Post subject: |
|
|
| Shinen wrote: | I still don't know anything about interrupt usage, at this moment it can be probably found in official SDK only.
|
You could take a look at the PSPSDK samples at http://svn.ps2dev.org/listing.php?repname=psp&path=%2Ftrunk%2Fpspsdk%2Fsrc%2Fsamples%2Faudio%2F&rev=0&sc=0 . The audio functions uses callback functions, which are called from interrupt, I think.
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. |
|
| Back to top |
|
 |
Shinen
Joined: 18 Oct 2005 Posts: 8 Location: Moscow
|
Posted: Sun Nov 27, 2005 8:10 pm Post subject: |
|
|
Audiolib makes threads with higher priority and use "*blocking" functions.
So callback functions called from thread of audiolib. |
|
| Back to top |
|
 |
Shinen
Joined: 18 Oct 2005 Posts: 8 Location: Moscow
|
Posted: Sun Nov 27, 2005 8:47 pm Post subject: |
|
|
| starman2049 wrote: |
Has anyone done this without using SDL or other OpenSource routines? |
I'm on the way ;) but too lazy. |
|
| Back to top |
|
 |
dsn

Joined: 09 Nov 2005 Posts: 47 Location: Indianapolis, Indiana, USA
|
Posted: Mon Nov 28, 2005 5:15 pm Post subject: |
|
|
| starman2049 wrote: | | Has anyone done this without using SDL or other OpenSource routines? |
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/
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. |
|
| Back to top |
|
 |
|