mirror of
https://github.com/Oibaf66/fbzx-wii.git
synced 2024-11-24 17:16:57 +01:00
Added double buffer sound
This commit is contained in:
parent
dbff026c93
commit
ec7dbc28ae
24
src/sound.c
24
src/sound.c
@ -66,6 +66,7 @@ pa_simple *pulse_s;
|
|||||||
|
|
||||||
#ifdef GEKKO
|
#ifdef GEKKO
|
||||||
#include <asndlib.h>
|
#include <asndlib.h>
|
||||||
|
int started_sound_asnd;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum e_soundtype sound_type;
|
enum e_soundtype sound_type;
|
||||||
@ -172,6 +173,10 @@ int sound_init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GEKKO
|
#ifdef GEKKO
|
||||||
|
int voice;
|
||||||
|
void callback(voice)
|
||||||
|
{}
|
||||||
|
|
||||||
int sound_init_asnd() {
|
int sound_init_asnd() {
|
||||||
|
|
||||||
ASND_Init();
|
ASND_Init();
|
||||||
@ -181,7 +186,7 @@ int sound_init_asnd() {
|
|||||||
ordenador.channels=1;
|
ordenador.channels=1;
|
||||||
ordenador.freq=48000;
|
ordenador.freq=48000;
|
||||||
ordenador.buffer_len=4096;
|
ordenador.buffer_len=4096;
|
||||||
|
started_sound_asnd = 0;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -489,9 +494,20 @@ void sound_play() {
|
|||||||
#endif
|
#endif
|
||||||
#ifdef GEKKO
|
#ifdef GEKKO
|
||||||
case SOUND_ASND: // ASND
|
case SOUND_ASND: // ASND
|
||||||
retval=ASND_SetVoice(1,VOICE_MONO_8BIT,48000,0,ordenador.current_buffer,ordenador.buffer_len,
|
if (!started_sound_asnd) {
|
||||||
ordenador.volume, ordenador.volume, NULL);
|
ASND_SetVoice(1,VOICE_MONO_8BIT,48000,0,sound[0],ordenador.buffer_len,
|
||||||
while (ASND_StatusVoice(1) == SND_WORKING){};
|
ordenador.volume, ordenador.volume, callback);
|
||||||
|
started_sound_asnd = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (!ASND_TestVoiceBufferReady(1)){};
|
||||||
|
if (!ASND_TestPointer (1, sound[0]))
|
||||||
|
{ASND_AddVoice(1,sound[0],ordenador.buffer_len);
|
||||||
|
ordenador.current_buffer = sound[0]; }
|
||||||
|
else
|
||||||
|
{ASND_AddVoice(1,sound[1],ordenador.buffer_len);
|
||||||
|
ordenador.current_buffer = sound[1]; }
|
||||||
|
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user