forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MP3 Playback sample code

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Shapyi



Joined: 25 Apr 2005
Posts: 95

PostPosted: Mon Aug 01, 2005 1:19 pm    Post subject: MP3 Playback sample code Reply with quote

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
View user's profile Send private message
Shapyi



Joined: 25 Apr 2005
Posts: 95

PostPosted: Tue Aug 02, 2005 2:13 am    Post subject: Reply with quote

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
View user's profile Send private message
Chrighton



Joined: 15 Jun 2005
Posts: 58

PostPosted: Tue Aug 02, 2005 2:41 am    Post subject: Reply with quote

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
View user's profile Send private message
Shapyi



Joined: 25 Apr 2005
Posts: 95

PostPosted: Tue Aug 02, 2005 9:43 am    Post subject: Reply with quote

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
View user's profile Send private message
Shito



Joined: 11 May 2005
Posts: 21

PostPosted: Thu Aug 04, 2005 8:12 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group