Ejemplo n.º 1
0
int Audio_Play(char *filename){

    char* suffix = strrchr(filename, '.');
    
    if(MediaType=="mp3"){
         MP3_End();
         }
    else if(MediaType=="ogg"){
         OGG_End();
         }
    else if(MediaType=="mod"){
         MIKMOD_End();
         }
	   
     if (stricmp(suffix, ".mp3") == 0) {
                         MP3_Init(NULL);
                         MP3_Load(filename);
                         MediaType = "mp3";
                         MP3_Play();
                         }
                         
     else if (stricmp(suffix, ".ogg") == 0) {
                         OGG_Init(NULL);
                         OGG_Load(filename);
                         MediaType = "ogg";
                         OGG_Play();
                         }
     //Doesnt work :(
     else if (stricmp(suffix, ".mod") == 0 || stricmp(suffix, ".xm") == 0 || stricmp(suffix, ".it") == 0 || stricmp(suffix, ".s3m") == 0 || stricmp(suffix, ".stm") == 0 || stricmp(suffix, ".mtm") == 0 || stricmp(suffix, ".it") == 0 || stricmp(suffix, ".669") == 0 || stricmp(suffix, ".far") == 0 || stricmp(suffix, ".dsm") == 0 || stricmp(suffix, ".med") == 0 || stricmp(suffix, ".ult") == 0 || stricmp(suffix, ".uni") == 0) {
                         MIKMOD_Init(NULL);
                         MIKMOD_Load(filename);
                         MediaType = "mod";
                         MIKMOD_Play();
                         }
}
Ejemplo n.º 2
0
int
psp_mp3_play_file(char* filename, int repeat)
{
# ifndef LINUX_MODE
  isRepeatMode = repeat;

  MP3_Stop();
  MP3_Init();
  if (! MP3_Load(filename)) {
    MP3_Stop();
  } else {
    MP3_Play();
  }
# endif
}
Ejemplo n.º 3
0
int main() {
    pspDebugScreenInit();
    SetupCallbacks();
    scePowerSetClockFrequency(333, 333, 166);
    
    pspAudioInit();
    SceCtrlData pad;
    int i;

    tzset();
    printf("Hello World\n");
    time_t now;
    now = time(NULL);
    printf("Started %s\n", ctime(&now));

    MP3_Init(1);
    MP3_Load("test.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();
            }
    }
    MP3_Stop();
    MP3_FreeTune();
    sceKernelSleepThread();
    return 0;
    }