| View previous topic :: View next topic |
| Author |
Message |
Shapyi
Joined: 25 Apr 2005 Posts: 95
|
Posted: Mon Aug 01, 2005 1:19 pm Post subject: MP3 Playback sample code |
|
|
| I hear libmad is used to decode MP3s. I am new to libmad and I was wondering if anyone had any sample code or source code on how to play an MP3 on PSP. I am making a simple 2D game and I would like music in it. Thanks. |
|
| Back to top |
|
 |
Shapyi
Joined: 25 Apr 2005 Posts: 95
|
Posted: Tue Aug 02, 2005 2:13 am Post subject: |
|
|
Alright, I downloaded libmad, compiled it and typed "make install". But it doesn't put the include file and lib file in any directory. I put mad include in the right directory, but no matter where I put libmad.a, my program doesn't compile, I get
| Code: | /usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/bin/ld: cannot find -libmad
collect2: ld returned 1 exit status |
Here is my make file
| Code: | TARGET = gamesdk
OBJS = main.o pg.o mp3player.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
LIBS= -lpspgu -lpspaudiolib -lpspaudio -libmad
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Test App
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak |
Can anyone help? |
|
| Back to top |
|
 |
Chrighton
Joined: 15 Jun 2005 Posts: 58
|
Posted: Tue Aug 02, 2005 2:41 am Post subject: |
|
|
| Shapyi wrote: | Alright, I downloaded libmad, compiled it and typed "make install". But it doesn't put the include file and lib file in any directory. I put mad include in the right directory, but no matter where I put libmad.a, my program doesn't compile, I get
| Code: | /usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/bin/ld: cannot find -libmad
collect2: ld returned 1 exit status |
|
Perhaps -lmad will do (provided the lib can be found in your searchpaths somewhere) |
|
| Back to top |
|
 |
Shapyi
Joined: 25 Apr 2005 Posts: 95
|
Posted: Tue Aug 02, 2005 9:43 am Post subject: |
|
|
| Chrighton wrote: | | Shapyi wrote: | Alright, I downloaded libmad, compiled it and typed "make install". But it doesn't put the include file and lib file in any directory. I put mad include in the right directory, but no matter where I put libmad.a, my program doesn't compile, I get
| Code: | /usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/bin/ld: cannot find -libmad
collect2: ld returned 1 exit status |
|
Perhaps -lmad will do (provided the lib can be found in your searchpaths somewhere) |
Yup. That did it. Thank you.
And if anyone is reading this thread and is interested in MP3 Decoding I used the source code from PSPMediaCenter by John_K. Worked like a charm. |
|
| Back to top |
|
 |
Shito
Joined: 11 May 2005 Posts: 21
|
Posted: Thu Aug 04, 2005 8:12 am Post subject: |
|
|
Works like a charm, but this thing is killing my fps !!! :/
I'm really bad when it comes to audio, I guess mp3 is quite cpu intensive, isn't there a way to use the ME for this (and how?^^), or is there another format I should be using instead, which would be a little bit lighter on the cpu ?? |
|
| Back to top |
|
 |
|