 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Geecko
Joined: 04 Nov 2008 Posts: 7
|
Posted: Sat Feb 12, 2011 5:57 pm Post subject: [SOLVED] Problem with SceMp3Init |
|
|
Hi all,
I'm actually coding a new game so I want to add some sound, using Arshia001's Advanced Audio Library.
My game is using several threads. When I do this :
| Code: | int audioThread(SceSize args, void *argp)
{
while (!exit_state)
{
[...]
}
return 0;
}
void initAudio()
{
AalibInit();
AalibLoad("./audio/music.mp3",MUSIC_CHANNEL,0);
AalibSetAutoloop(MUSIC_CHANNEL,1);
AalibPlay(MUSIC_CHANNEL);
// Start audio thread
SceUID thid = sceKernelCreateThread("audio_thread",audioThread,0x11,0xFA0,
0,NULL);
} |
It's working, the music plays well but when I put AalibLoad in the thread :
| Code: | int audioThread(SceSize args, void *argp)
{
AalibLoad("./audio/music.mp3",MUSIC_CHANNEL,0);
AalibSetAutoloop(MUSIC_CHANNEL,1);
AalibPlay(MUSIC_CHANNEL);
while (!exit_state)
{
[...]
}
return 0;
}
void initAudio()
{
AalibInit();
// Start audio thread
SceUID thid = sceKernelCreateThread("audio_thread",audioThread,0x11,0xFA0,
0,NULL);
} |
It's absolutely not working : AalibLoad returns 22 (PSPAALIB_ERROR_SCEMP3_INIT) and sceMp3Init returns 0x807F00FD. I don't know why... any ideas ?
Last edited by Geecko on Sun Feb 13, 2011 9:12 am; edited 1 time in total |
|
| Back to top |
|
 |
psPea
Joined: 01 Sep 2007 Posts: 67
|
Posted: Sun Feb 13, 2011 5:33 am Post subject: |
|
|
I don't think a cwd is setup when you create a new thread, you'll have to set one or use absolute path. _________________ Click ME! |
|
| Back to top |
|
 |
Geecko
Joined: 04 Nov 2008 Posts: 7
|
Posted: Sun Feb 13, 2011 8:14 am Post subject: |
|
|
Great ! Working like a charm :D
I just got the cwd by calling this in the main function :
| Code: | strcpy(cwd,argv[0]);
cwd[strlen(cwd)-strlen("/eboot.pbp")] = '\0'; |
Then, just added this to your freshly created thread :
DONE ! |
|
| Back to top |
|
 |
|
|
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
|