Skip to: Site menu | Main content


Welcome to PSP-Programming.com, a place for developers to get together.

Welcome to the forums. Here you can find other user tutorials as well as homebrew releases and the source code repository. You can also ask for help with your code here and post your own homebrew!

PSP-Programming.com Forums
February 08, 2012, 05:50:43 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

News: Check out the Code Section!
Home Help Search Shop Login Register
Digg This!
Pages: [1] 2
Print
Author Topic: [C] libaudio (Yet another audio library)  (Read 13878 times)
mowglisanu

C/C++ Developer
Hero Member
*

Karma: +36/-11
Offline Offline

Posts: 787
0.00 points

View Inventory
Send Money to mowglisanu


View Profile
« on: June 21, 2009, 12:11:56 PM »

Capability:
mp3 through ME
mp3/2/1 through libmad
aac(adts) through ME
atrac3/plus(RIFF WAVE) and aa3 through ME
flac through libflac
ogg through vorbisfile or libTremor
ogg-flac through libflac with ogg support
wav au aiff
midi throuhg libtimidity
mp4/m4a (aac only) through ME (supports multiple tracks)
wma through ME (only regular no pro or lossless)

formats in the works(maybe):
...
looking into
...

Sound effects(PCM stored in memory)
Streaming from file or from memory.

Quote from: README
Audio library for psp

Installation:
Uncompress to a folder and navigae to the folder, type
make
then
make samples
to compile the samples

Requirements:
libMad
libvorbisfile, libvorbis, libogg or libTremor
libFlac

Configuration of Makefile.audio
To exclude libmad set
USE_MAD = 0
To exclude libflac set
USE_FLAC = 0
If libflac is built without ogg support set
FLAC_OGG_SUPPORTED = 0
To exclude libogg and libvorbis set
USE_OGG = 0
To exclude libtimidity and midi set
USE_MIDI = 0

Use
add
LIBS += -lpspaudio -lpspaudiocodec -lpspatrac3 -lpspasfparser -lpsppower -lflac [-lvorbisfile -lvorbis -logg|-lvorbisidec] -ltimidity -lmad  -lm
in your makefile
include Audio.h and other needed files
call audioInit(sounds) to initialize(sounds:number of sfx threads to create)
then
load*
playAudio
etc.

Audio.h
   audioInit - Initializes the audio library
   loadWav - loads a wav pcm file(RIFF    WAVE)
   loadAu - loads an au uncomrpessed file
   loadAiff - loads an aiff uncomrpessed file
   playAudio - plays the specified audio
   pauseAudio - pauses the specified audio
   stopAudio - stops the specified audio
   seekAudio - seek the specified audio
   loopAudio - sets the specified audio to loop
   freeAudio - frees the specified audio and all its resources
   etc.
AudioAT3.h
   loadAt3 - loads an atrac3/plus file (RIFF    WAVE)
   loadAa3 - loads an atrac3/plus file (aa3)
AudioFLAC.h
   loadFlac - loads a flac file
   loadFlacAdvance - loads a flac file with advanced options
AudioMPEG.h
   loadMp3 - load an mp3 also capable of loading mp2/1 through loadMADMpeg
   loadMp4 - load an mp4(aac) file
   loadAac - load an aac(adts) file
   loadMp3Advance - load an mp3 with advanced options
   loadMADMpeg - load an mp3/2/1 via libmad
AudioOGG.h
   loadOgg - loads an ogg-vorbis file also capable of loading oog-flac via loadFlacAdvance(if libflac is built with ogg support)
AudioWMA.h
   loadWma - loads a Windows media audio file (MeBootStart.prx needs to be in the cwd or you can set its path with setBootStartWma(char *location))
AudioMUSIC.h
   loadMusic - loads a midi file (requires gus compatible patches and timidity.cfg to play)
see header files and samples for more info

Don't want to build a library?
Use the files individually
Audio.h/c Always required(base library)(libs -lpspaudio -lpspaudiocodec -lpsppower)

AudioMPEG.h/c AudioMAD.c mpeg audio(libs -lm)
add -DSANE to CFLAGS in your makefile to exclude AudioMAD

AudioAt3.h/c atrac audio(libs -lpspatrac3)

AudioFLAC.h/c flac audio(libs -lflac -lm (-logg if built with ogg support))
add -DOGG_FLAC to CFLAGS in makefile for ogg-flac support

AudioOGG.h/c ogg audio(requires -lvorbisfile -lvorbis -logg(or -lvorbisidec if built wtih libTremor))
add -DOGG_FLAC to CFLAGS in makefile for ogg-flac support

AudioWMA.h/c wma (libs -lpspasfparser) MeBootStart.prx

AudioMUSIC.h/c midi (libs -ltimidity -lm)


Any bugs, comments or suggestions email me mowglisanu@gmail.com

Thanks to:
   cooleyes: For all his samples to decode via the ME
   moonlight: For his sample to decode via the ME
   Heimdall: For MinPSP
   hrimfaxi: For his sample to decode via the ME
   Insert_Witty_Name: For general information
   Raphael: For general information
   TyRaNiD: For pspLink
   The people who ported doom(where I got libtimidty)
Also
Arnold
sakya
AlphaDingDong
Noware
dan69
Arshia001
and the entire psp homebrew community

updated libaudio+samples
Instrument package for midi
Smaller instrument package for midi

libaudio+samples
libaudio+samples mirror

All releases
« Last Edit: January 15, 2010, 06:45:52 PM by mowglisanu » Logged

Check out my:
 Audio lib
 Pmf Viewer


mowglisanu

C/C++ Developer
Hero Member
*

Karma: +36/-11
Offline Offline

Posts: 787
0.00 points

View Inventory
Send Money to mowglisanu


View Profile
« Reply #1 on: June 27, 2009, 11:29:58 PM »

To test the library I added sound to reizencroft's Tweexter
check it out

tweexter
src
« Last Edit: January 15, 2010, 07:08:27 PM by mowglisanu » Logged

Check out my:
 Audio lib
 Pmf Viewer
gibbocool
Embellished by our ignorance
News Posters
Hero Member
*

Karma: +34/-11
Offline Offline

Posts: 822
2973.87 points

View Inventory
Send Money to gibbocool

Power Overwhelming


View Profile WWW
« Reply #2 on: June 28, 2009, 12:06:53 AM »

Nice work dude Very Happy
Logged

Arshia001

C/C++ Developer
Sr. Member
*

Karma: +42/-41
Offline Offline

Posts: 268
1224.39 points

View Inventory
Send Money to Arshia001

View Profile
« Reply #3 on: June 30, 2009, 04:56:39 AM »

Yup,nice lib.It supports a large number of formats,many more than mine.Of course,there's always the fact that such a wide array of formats would look nicer in an audio player than it would in a game,because you are the one who decides which format you're going to use for your game.
Say,do you think you could complete the MIDI player any time soon?I think it'll make for a nice addition to PSPAALIB(if you'd allow me to add it,of course).It is a really nice format for BGM,and it's really small in size too.I wanted to add it,but I didn't know how...
Logged

Check out this audio library:
http://www.psp-programming.com/forums/index.php/topic,4338.0.html

Thanks for all the Karma,you guys!
mowglisanu

C/C++ Developer
Hero Member
*

Karma: +36/-11
Offline Offline

Posts: 787
0.00 points

View Inventory
Send Money to mowglisanu


View Profile
« Reply #4 on: July 01, 2009, 01:23:49 PM »

well I already did the midi but it comes with alot of baggage(It uses libtimidity)
it needs some GUS compatible patches to play, the package at the sdl website is about 14 mb.

I didn't test it to see cpu load, or exactly which patches are needed,
but it plays nice and smooth by itself with all the patches.

Also, I have to look into optimizations as well.
since you asked I'll raise its priority from 0 to about 5.

Also
wma is working but I don't know if libasfparser(needed to parse the asf container) is part of the toolchain and it needs to load cooleyesBridge to boot the ME(or something) which would require your app to be built as a prx... bla bla bla
Logged

Check out my:
 Audio lib
 Pmf Viewer
Arshia001

C/C++ Developer
Sr. Member
*

Karma: +42/-41
Offline Offline

Posts: 268
1224.39 points

View Inventory
Send Money to Arshia001

View Profile
« Reply #5 on: July 03, 2009, 03:08:45 AM »

Well,Thanx. Wink
Logged

Check out this audio library:
http://www.psp-programming.com/forums/index.php/topic,4338.0.html

Thanks for all the Karma,you guys!
AlphaDingDong
Combat Muskrat
All-Around Dev
Hero Member
*

Karma: +32/-3
Offline Offline

Posts: 882
2044.69 points

View Inventory
Send Money to AlphaDingDong
Hey... Are you gonna eat that?


View Profile
« Reply #6 on: July 03, 2009, 07:26:31 AM »

You should call it YAAL.  (Yet another audio library)

 Very Happy
Logged
itdemo
The inner machinations of my mind are an enigma.
Jr. Member
**

Karma: +0/-0
Offline Offline

Posts: 72
4438.82 points

View Inventory
Send Money to itdemo

Yes I use goto's sometimes!...


View Profile WWW
« Reply #7 on: July 03, 2009, 03:46:20 PM »

Em... I know some devs don't like working together but the two of you could get together and make a...



YAAAML!!!

Yet Another Advanced Audio Master Lib!

Very Happy

Logged

Arshia001

C/C++ Developer
Sr. Member
*

Karma: +42/-41
Offline Offline

Posts: 268
1224.39 points

View Inventory
Send Money to Arshia001

View Profile
« Reply #8 on: July 04, 2009, 12:51:29 AM »

You know,may be we could!How's about it?I've already got the effects,you've got the extra loaders!If we can find a way to work your loaders into my effects,We'd have a very cool lib!We'll also need to change the way one of them behaves(mine uses predefined channel identifiers,yours uses objects(pAudio?) if I'm correct).But,I think the project is worth it.What about you? Wink

-------------------------------------------------------------------

I did some thinking,and I think that my channel identifier system,while easier to use,can be a bit slow(Many switch statements).May be we should use objects which include function pointers(A big number of function pointers,because your way of passing the action as a parameter has the exact same problem),and the required data,along with a void* variable which can hold the specific decoder's data structure.We will also need the channel identifiers so that the user can't try to load more files than the lib supports(2 for sceMp3/sceAt3,10 for OggVorbis,etc.).
Do you think you can re-write some of your loaders(MIDI,WMA are the priorities,and we'll have all common formats,since I already have MP3,WAV,OGG,AT3)to match this format?If so,I can re-write my own code to do this,and we can put them all together to have YAVCPSPAMAL(Yet Another Very Cool PSP Advanced Master Audio Library,kinda long? Very Happy ).If you're interested as well,let's do it. Wink
« Last Edit: July 04, 2009, 06:18:47 AM by Arshia001 » Logged

Check out this audio library:
http://www.psp-programming.com/forums/index.php/topic,4338.0.html

Thanks for all the Karma,you guys!
itdemo
The inner machinations of my mind are an enigma.
Jr. Member
**

Karma: +0/-0
Offline Offline

Posts: 72
4438.82 points

View Inventory
Send Money to itdemo

Yes I use goto's sometimes!...


View Profile WWW
« Reply #9 on: July 06, 2009, 11:41:16 AM »

I would love to see this! Very Happy
I thought I was gonna get yelled at for even thinkin it but really if you guys did this it could be the final audio lib! Razz

I second this!
Logged

Arshia001

C/C++ Developer
Sr. Member
*

Karma: +42/-41
Offline Offline

Posts: 268
1224.39 points

View Inventory
Send Money to Arshia001

View Profile
« Reply #10 on: July 09, 2009, 09:21:24 PM »

Well,it seems like mowglisanu has been absent for quite a while.I'm still waiting to see what he says.
Logged

Check out this audio library:
http://www.psp-programming.com/forums/index.php/topic,4338.0.html

Thanks for all the Karma,you guys!
mowglisanu

C/C++ Developer
Hero Member
*

Karma: +36/-11
Offline Offline

Posts: 787
0.00 points

View Inventory
Send Money to mowglisanu


View Profile
« Reply #11 on: July 11, 2009, 04:23:17 PM »

Update:
A few bug fixes
some design changes(low level)
added midi au aiff
and some other functions

if you're using minpspw libtimidity wont install(it mightn't work any where else either)
so you can just comment it out in the makefile and I included it compiled already just extract it to psp_install_dir\psp

The package is so big because I included the patches to play midi
I had no time to add samples:/
timidity.cfg and instruments/ need to be in the same folder as your app

@Arshia001
You didn't have any samples and I'm too lazy, so I couldn't hear your lib in action.
Also to merge the libs one (or both) would have to be totally re-designed as they are totally incompatible,
also I would have no time to work on this in the near future
« Last Edit: July 25, 2009, 02:16:34 PM by mowglisanu » Logged

Check out my:
 Audio lib
 Pmf Viewer
Arshia001

C/C++ Developer
Sr. Member
*

Karma: +42/-41
Offline Offline

Posts: 268
1224.39 points

View Inventory
Send Money to Arshia001

View Profile
« Reply #12 on: July 12, 2009, 12:09:31 AM »

You used to read the previous topic.I'm sure you saw the samples I used to include(which were actually my last test).I also included a detailed readme,but I never got a chance to create that sample I promised to make...
Anyway,since you don't have the time to do this,maybe I'll just have to read through your source and add MIDI/WMA to my own code... Sad
Logged

Check out this audio library:
http://www.psp-programming.com/forums/index.php/topic,4338.0.html

Thanks for all the Karma,you guys!
mowglisanu

C/C++ Developer
Hero Member
*

Karma: +36/-11
Offline Offline

Posts: 787
0.00 points

View Inventory
Send Money to mowglisanu


View Profile
« Reply #13 on: August 18, 2009, 10:06:31 PM »

UPDATE Added MP4/M4A support
but only aac tracks though, as the only mp4/m4a files i found was aac or ac3 and i can't do ac3.
supports multiple tracks.

found in AudioMpeg.h/c
loadMp4 - loads the mp4
getTrackMp4 - gets the current track
setTrackMp4 - sets the current track
getTrackCountMp4 - get the number of tracks
Edit:bug fix
« Last Edit: August 22, 2009, 02:00:49 PM by mowglisanu » Logged

Check out my:
 Audio lib
 Pmf Viewer
ymg545
Hey, mister. Does that hat take ten gallons?
Newbie
*

Karma: +1/-0
Offline Offline

Posts: 1
133.41 points

View Inventory
Send Money to ymg545

View Profile
« Reply #14 on: August 26, 2009, 10:26:22 PM »

Awesoooome! Thanks for the nice audio library.
Logged
Pages: [1] 2
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.716 seconds with 38 queries.
Sister Sites: Guitar Hero 4   BrokeniTouch.com