QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

Adding MP3

This is a discussion on Adding MP3 within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; can some add the mp3 player code in my source or give me the code. I tried it my self ...

Reply
 
LinkBack Thread Tools
Old 12-22-2006, 01:55 PM   #1
 
Join Date: Sep 2006
Posts: 484
Trader Feedback: 0
Default Adding MP3

can some add the mp3 player code in my source or give me the code. I tried it my self i and i cant get it. Oh and i want it to reapet.

Here is my source if you want it:
Code:
/* HALO COMBAT EVOLVED
BY PSPFREAK9 FINISHED AT **-**-**
*/

#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pspaudio.h>
#include <pspaudiolib.h>
#include <psppower.h>
#include <mp3player.h>
#include "graphics.h" 
#define printf pspDebugScreenPrintf
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) 
PSP_MODULE_INFO("HALO COMBAT EVOLVED", 0, 1, 1); 
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
          sceKernelExitGame();
          return 0;
}

/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
          int cbid;

          cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
          sceKernelRegisterExitCallback(cbid);

          sceKernelSleepThreadCB();

          return 0;
}

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
          int thid = 0;

          thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
          if(thid >= 0) {
                    sceKernelStartThread(thid, 0, 0);
          }

          return thid;
} 
    int CursorXPosition = 0;
    int CursorY = 0;
int imagesareloaded =0;
char buffer[200];
Image* ourImage;
Image* cursor;


void load_images(){
if(imagesareloaded ==0){
sprintf(buffer, "halo/Halo.png");
          ourImage = loadImage(buffer); 

sprintf(buffer, "cursor.PNG");
          cursor = loadImage(buffer); 

imagesareloaded =1;
}

}
int main() {while(1)

clearScreen(0);
	sceCtrlReadBufferPositive(&pad, 1);
		  
load_images();

if (!ourImage) {
                    //Image load failed
                    printf("Image load failed!\n");
          } else { 
 int x = 0;
                    int y = 0;
                    sceDisplayWaitVblankStart();
 while (x < 480) {
                              while (y < 272) { 
     blitAlphaImageToScreen(0 ,0 ,480 , 272, ourImage, x, y);
                                        y += 272;
                              } 
 x += 480;
                              y = 0;
                    } 
          } 


if (!cursor) {
                    //Image load failed
                    printf("Image load failed!\n");
          } else { 
                    sceDisplayWaitVblankStart(); 
     blitAlphaImageToScreen(0 ,0 ,10 , 16, cursor, CursorXPosition += (pad.Lx -128) /30, CursorY += (pad.Ly -128) /30);
 flipScreen();
}
}
sceKernelSleepThread();
          return 0;
}
__________________
Need a GFX Guy for EBOOT ICONS, BACkGROUNDS?? I can help you there.
Just see some of my work. PM me for GFX.
pspfreak9 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Best prices available for:
Price Range:
$13.00 - $25.00
at 10 Stores

Price Range:
$17.00 - $48.00
at 10 Stores

Old 12-22-2006, 02:06 PM   #2

QJ Gamer Silver
 
yaustar's Avatar
 
Join Date: Jun 2006
Location: UK
Posts: 2,322
Trader Feedback: 0
Default

What errors do you get?
yaustar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-22-2006, 02:14 PM   #3
 
Join Date: Sep 2006
Posts: 484
Trader Feedback: 0
Default

something like

main.o: In function `main':
main.c.text+0x1f8): undefined reference to `MP3_Init'
main.c.text+0x204): undefined reference to `MP3_Load'
main.c.text+0x20c): undefined reference to `MP3_Play'
main.c.text+0x240): undefined reference to `MP3_EndOfStream'
main.c.text+0x35c): undefined reference to `MP3_Stop'
main.c.text+0x364): undefined reference to `MP3_FreeTune'
main.c.text+0x39c): undefined reference to `MP3_Pause'
main.c.text+0x3b8): undefined reference to `MP3_EndOfStream'
main.c.text+0x3cc): undefined reference to `MP3_Stop'
collect2: ld returned 1 exit status
make: *** [hello.elf] Error 1

By the way i deleted all my code of mP3 player from the source i gave you
-= Double Post =-
sry but the error happens to have symbols in it

Last edited by pspfreak9; 12-22-2006 at 02:14 PM.. Reason: Automerged Doublepost
pspfreak9 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-22-2006, 02:15 PM   #4

QJ Gamer Silver
 
yaustar's Avatar
 
Join Date: Jun 2006
Location: UK
Posts: 2,322
Trader Feedback: 0
Default

Either you are not compiling the source file needed and/or not linking the object file/library in the makefile.

Post the makefile.
yaustar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-22-2006, 02:17 PM   #5
 
Join Date: Sep 2006
Posts: 484
Trader Feedback: 0
Default

Makefile:

TARGET = hello
OBJS = main.o graphics.o framebuffer.o

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LIBS = -lpspgu -lpng -lz -lm -lmad -lpspaudiolib -lpspaudio -lpsppower
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = HALO COMBAT EVOLVED
PSP_EBOOT_ICON = ICON0.PNG

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
pspfreak9 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-22-2006, 02:22 PM   #6

QJ Gamer Silver
 
yaustar's Avatar
 
Join Date: Jun 2006
Location: UK
Posts: 2,322
Trader Feedback: 0
Default

Assuming that you are compiling the C files, you need to link the mp3player object to this line:
Code:
OBJS = main.o graphics.o framebuffer.o
to
Code:
OBJS = main.o mp3player.o graphics.o framebuffer.o
yaustar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-22-2006, 02:59 PM   #7
 
Join Date: Sep 2006
Posts: 484
Trader Feedback: 0
Default

Man I'm so stupid i cant belive i didnt see that
-= Double Post =-
Wait when I play my game it plays the music on a black screen that says play at *i cant remember the number*MHZ But i want it to play in the background of my game.
-= Double Post =-
anyone??

Last edited by pspfreak9; 12-22-2006 at 02:59 PM.. Reason: Automerged Doublepost
pspfreak9 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
adding , mp3

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 01:13 PM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2010, QJ.NET. All Rights Reserved.
Contact Us | Free Flash Games