Message when listining MP3 in homebrew

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
JoRDozZzz
Posts: 9
Joined: Thu Apr 05, 2007 6:23 am
Contact:

Message when listining MP3 in homebrew

Post by JoRDozZzz »

Hello,
I'd like to hear music in my homebrew, on thebackground. that's done, but now when i ear a mp3-song. I see information about that song in my screen. I don't like that cause i'd like to hear the mp3 on the background and without any controls for play and pause. Maybe someone can help;

Message in homebrew:
recoverable frame level error (lost synchronization) // This is on the top of the screen
128 kb/s audio MPEG layer III stream at 4410 mhz // This is on the bottom of the screen

Source:

int main()
{
scePowerSetClockFrequency(333, 333, 166);
pspDebugScreenInit();
SetupCallbacks();
pspAudioInit();
SceCtrlData pad;
int i;
char buffer[200];
Image* ourImage;
initGraphics();
sprintf(buffer, "background.PNG");
ourImage = loadImage(buffer);

MP3_Init(1);
MP3_Load("music.mp3");
MP3_Play();

while(1)
{
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_CROSS)
{
break;
}
else if(pad.Buttons & PSP_CTRL_CIRCLE)
{
MP3_Pause();
for(i=0; i<10; i++)
{
sceDisplayWaitVblankStart();
}
}

if (MP3_EndOfStream() == 1)
{
MP3_Stop();
}
}


if (!ourImage)
{
//Image load failed
printf("Image load failed!\n");
}
else
{
/* If the loadImage function */

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;
}

flipScreen();
}

MP3_Stop();
MP3_FreeTune();


----------------------------------------
Hope someone can help, thanks
// Grtzzzz
C/C++ Noob/Beginner
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

The code for that output is within mp3player.c. Just #undef printf after the includes and the prints shouldn't appear on screen anymore.
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
MK2k
Posts: 14
Joined: Sat Apr 14, 2007 12:50 am

Post by MK2k »

Maybe he needs the printf's somewhere else, so JoRDozZzz comment out or delete those lines in mp3player.c that contian a printf.
User avatar
harleyg
Posts: 123
Joined: Wed Oct 05, 2005 6:15 am

Post by harleyg »

Copy and pasting code from 2 / 3 of his tutorials is not good either, thats when you end up with code like that. (No indentation, etc)

Also, use...

Code: Select all

&#91;code&#93;&#91;/code&#93;
JoRDozZzz
Posts: 9
Joined: Thu Apr 05, 2007 6:23 am
Contact:

Post by JoRDozZzz »

I've done the #undef printf in the mp3player.c but i still see a message in the homebrew.

Code: Select all

// mp3player.c&#58; MP3 Player Implementation in C for Sony PSP
//
////////////////////////////////////////////////////////////////////////////

#include <pspkernel.h>
#include <pspdebug.h>
#include <pspiofilemgr.h>
#include <pspdisplay.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
#include <pspaudiolib.h>
#include "mp3player.h"

#undef printf 
#define FALSE 0
#define TRUE !FALSE
#define min&#40;a,b&#41; &#40;&#40;&#40;a&#41;<&#40;b&#41;&#41;?&#40;a&#41;&#58;&#40;b&#41;&#41;
#define max&#40;a,b&#41; &#40;&#40;&#40;a&#41;>&#40;b&#41;&#41;?&#40;a&#41;&#58;&#40;b&#41;&#41;
#define MadErrorString&#40;x&#41; mad_stream_errorstr&#40;x&#41;
#define INPUT_BUFFER_SIZE	&#40;5*8192&#41;
#define OUTPUT_BUFFER_SIZE	2048

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

http://www.megaupload.com/?d=O0ZYVQEK
Thats the download of my source :)

But i don't really now how i can fix this. So i've the whole source + mp3 + png uploaded on Megaupload. Hope that someone will/can fix the code for me. Thank you all very very much :D

Excuses for not using [ code ], on our PSP website we have the same forum so i know how this works :)

// JoRDozZzz
C/C++ Noob/Beginner
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

just dont use the function that prints mp3 tag data
and remember to uncomment/remove the line where
this function is actually called
10011011 00101010 11010111 10001001 10111010
Post Reply