Page 1 of 1

Sound effects with ASNDlib. No sound at all

Posted: Mon Feb 03, 2020 9:10 pm
by nebiun
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:

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_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
Where I wrong?
Thanks guys.

Re: Sound effects with ASNDlib. No sound at all

Posted: Wed Feb 05, 2020 3:10 pm
by nebiun
Well, solved by myself.
I need use ASND_Pause(0) to unpause the sound engine, because ASND_Init leave it paused.