Sound effects with ASNDlib. No sound at all
Posted: Mon Feb 03, 2020 9:10 pm
Hi, I'm try to play sounds using ASNDlib, but non sounds is played and non errors from ASND_Set... functions.
I attach source file and audio file (PCM 8bit mono 11025Hz).
Here the main loop:
Where I wrong?
Thanks guys.
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.