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 

Message when listining MP3 in homebrew

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



Joined: 05 Apr 2007
Posts: 9

PostPosted: Fri Apr 27, 2007 5:05 pm    Post subject: Message when listining MP3 in homebrew Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Raphael



Joined: 17 Jan 2006
Posts: 646
Location: Germany

PostPosted: Fri Apr 27, 2007 5:45 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
MK2k



Joined: 14 Apr 2007
Posts: 14

PostPosted: Fri Apr 27, 2007 6:40 pm    Post subject: Reply with quote

Maybe he needs the printf's somewhere else, so JoRDozZzz comment out or delete those lines in mp3player.c that contian a printf.
Back to top
View user's profile Send private message
harleyg



Joined: 05 Oct 2005
Posts: 123

PostPosted: Fri Apr 27, 2007 7:00 pm    Post subject: Reply with quote

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:
[code][/code]
Back to top
View user's profile Send private message
JoRDozZzz



Joined: 05 Apr 2007
Posts: 9

PostPosted: Sat Apr 28, 2007 2:52 am    Post subject: Reply with quote

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

Code:
// mp3player.c: 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(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
#define MadErrorString(x) mad_stream_errorstr(x)
#define INPUT_BUFFER_SIZE   (5*8192)
#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
Back to top
View user's profile Send private message Visit poster's website
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Sat Apr 28, 2007 7:54 am    Post subject: Reply with quote

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