MP3 Playback sample code
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.
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
Here is my make file
Can anyone help?
Code: Select all
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/bin/ld: cannot find -libmad
collect2: ld returned 1 exit status
Code: Select all
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
Perhaps -lmad will do (provided the lib can be found in your searchpaths somewhere)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: Select all
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/bin/ld: cannot find -libmad collect2: ld returned 1 exit status
Yup. That did it. Thank you.Chrighton wrote:Perhaps -lmad will do (provided the lib can be found in your searchpaths somewhere)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: Select all
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/bin/ld: cannot find -libmad collect2: ld returned 1 exit status
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.