I installed the latest devkitPPC and I am coding an app for Nintendo Wii.
I used the codemii tutorials to build it but I have a problem with this sound tutorial
http://www.codemii.com/2009/04/21/tutor ... /#more-509
I manage to compile it but NO SOUND can be heard even if everything seems to be ok.
Can someone re-adapt this code in order to make it working with latest devkitPPC?
I re-say that it compiles fine but under a real wii no sound can be heard !
If a re-adapt is too laborious can someone write me there what have I to code in my Makefile and in main.c in order to make a file (mod, mp3 or whatever) palying in loop in background ? I mean:
1) What to include in MakeFile
2) Whato to add in main.c
#INCLUDE
int main()
other ?
My makefile has those libs:
LIBS := -ljpeg -lwiiuse -lmad -lbte -lfat -logc -lm -lmodplay -lasnd
My main.c has the above tutorial code
THANK YOU VERY VERY VERY MUCH !!!
Thank you to everyone that can answer me !
No sound with libogc
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: No sound with libogc
add #include <asndlib.h> and replace AUDIO_Init(NULL); with ASND_Init(NULL);
you already have libasnd linked so it should work fine from there.
you already have libasnd linked so it should work fine from there.
Re: No sound with libogc
Thank you VERY much for your quick reply !
This is the new code:
MakeFile libraries:
main.c
If I compile simply adding #include <asndlib.h> it compiles fine, but when I substitute AUDIO_Init(NULL); with ASND_Init(NULL);
I obtain this (bad-realized collage-image ):
This is the new code:
MakeFile libraries:
Code: Select all
LIBS := -lwiiuse -lbte -logc -lmodplay -lasnd -lm
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <ogcsys.h>
#include <gccore.h>
#include <wiiuse/wpad.h>
#include <gcmodplay.h>
#include <asndlib.h>
#include "loop_mod.h"
static u32 *xfb;
static GXRModeObj *rmode;
// Modplay
static MODPlay play;
void Initialise() {
VIDEO_Init();
WPAD_Init();
rmode = VIDEO_GetPreferredMode(NULL);
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
VIDEO_Configure(rmode);
VIDEO_SetNextFramebuffer(xfb);
VIDEO_SetBlack(FALSE);
VIDEO_Flush();
VIDEO_WaitVSync();
if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
ASND_Init(NULL);
MODPlay_Init(&play);
}
int main() {
Initialise();
MODPlay_SetMOD(&play, loop_mod);
MODPlay_Start(&play);
printf("\x1b[2;0H");
printf("Playing mod file. Press Home to exit\n");
while(1) {
WPAD_ScanPads();
u32 pressed = WPAD_ButtonsDown(0);
if (pressed & WPAD_BUTTON_HOME) {
MODPlay_Stop(&play);
exit(0);
}
VIDEO_WaitVSync();
}
return 0;
}
I obtain this (bad-realized collage-image ):
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: No sound with libogc
Link order matters
As a general rule of thumb, -logc should always be last, followed by standard compiler libraries such as -lm
Code: Select all
LIBS := -lwiiuse -lbte -lmodplay -lasnd -logc -lm
Re: No sound with libogc
It works ! Thank you MAN !!!!!!!
Who is online
Users browsing this forum: No registered users and 4 guests