Ejemplo n.º 1
0
void Android_SoundInit(int rate, int bufsizems, int bit16, int hq, int disableOSL)
{
	Log_print("SoundInit for android initializing with %dHz, %d bufsize, OSL %s",
				rate, bufsizems, (disableOSL) ? "off" : "on");
	POKEYSND_bienias_fix = 0;
	POKEYSND_enable_new_pokey = hq;
	at_sixteenbit = bit16;
	snd_bufsizems = bufsizems;
	snd_mixrate = rate;
	osl_bufnum = snd_bufsizems / OSL_BUFSIZE_MS;
	osl_bufszbytes = OSL_BUFSIZE_MS * (at_sixteenbit ? 2 : 1) * snd_mixrate / 1000;
	osl_disable = disableOSL;
	if (disableOSL)
		Android_osl_sound = FALSE;
	Log_print("Initializing POKEY");
	POKEYSND_Init(POKEYSND_FREQ_17_EXACT, rate, 1, bit16 ? POKEYSND_BIT16 : 0);
	Log_print("POKEY init done");
}
Ejemplo n.º 2
0
static void SoundSetup(void)
{
    int dsprate = 48000;
    int sound_flags = 0;
    int sconfig[JAVANVM_InitSoundSIZE];
    sound_flags |= POKEYSND_BIT16;
    sconfig[JAVANVM_InitSoundSampleRate] = dsprate;
    sconfig[JAVANVM_InitSoundBitsPerSample] = 16;
    sconfig[JAVANVM_InitSoundChannels] = POKEYSND_stereo_enabled ? 2 : 1;
    sconfig[JAVANVM_InitSoundSigned] = TRUE;
    sconfig[JAVANVM_InitSoundBigEndian] = TRUE;
    line_buffer_size = JAVANVM_InitSound((void *)&sconfig[0]);
    dsp_buffer_size = 4096; /*adjust this to fix skipping/latency*/
    if (POKEYSND_stereo_enabled) dsp_buffer_size *= 2;
    if (line_buffer_size < dsp_buffer_size) dsp_buffer_size = line_buffer_size;
    free(dsp_buffer);
    dsp_buffer = (UBYTE*)malloc(dsp_buffer_size);
    POKEYSND_Init(POKEYSND_FREQ_17_EXACT, dsprate, (POKEYSND_stereo_enabled ? 2 : 1) , sound_flags);
}