I attach source file and audio file (PCM 8bit mono 11025Hz).
Here the main loop:
Code: Select all
if(ASND_SetInfiniteVoice(0, VOICE_MONO_8BIT, 11025, 0, (void *)sounds[0], sound_size[0], MAX_VOLUME, MAX_VOLUME) != SND_OK)
printf("ASND_SetInfiniteVoice error\n");
while(1) {
// Call WPAD_ScanPads each loop, this reads the latest controller states
WPAD_ScanPads();
// WPAD_ButtonsDown tells us which buttons were pressed in this loop
// this is a "one shot" state which will not fire again until the button has been released
u32 pressed = WPAD_ButtonsDown(0);
if (pressed & WPAD_BUTTON_A) {
printf("Bing %d\n", hit_raw_size);
if(ASND_SetVoice(1, VOICE_MONO_8BIT, 11025, 0, (void *)sounds[1], sound_size[1], MAX_VOLUME, MAX_VOLUME, NULL) != SND_OK)
printf("ASND_SetVoice error\n");
}
// We return to the launcher application via exit
else if ( pressed & WPAD_BUTTON_HOME ) break;
// Wait for the next frame
VIDEO_WaitVSync();
}
ASND_StopVoice(0);
ASND_StopVoice(1);
Thanks guys.