Esempio n. 1
0
/*  CXAudio2::SetupSound
applies current sound settings by recreating the voice objects and buffers
-----
returns true if successful, false otherwise
*/
bool CXAudio2::SetupSound()
{
	if(!initDone)
		return false;

	DeInitVoices();

	blockCount = 8;
	UINT32 blockTime = 64 / blockCount;

	singleBufferSamples = (Settings.SoundPlaybackRate * blockTime * (Settings.Stereo ? 2 : 1)) / 1000;
	singleBufferBytes = singleBufferSamples * (Settings.SixteenBitSound ? 2 : 1);
	sum_bufferSize = singleBufferBytes * blockCount;

    if (InitVoices())
    {
		soundBuffer = new uint8[sum_bufferSize];
		writeOffset = 0;
    }
	else {
		DeInitVoices();
		return false;
	}

	bufferCount = 0;

	BeginPlayback();

    return true;
}
Esempio n. 2
0
s32 SdInit(s32 flag)
{
	flag &= 1;

	InitSpu2();
	InitSpdif();

	Reset(flag);

	InitVoices();
	InitCoreVolume(flag);

	EnableIntr(IOP_IRQ_DMA_SPU);
	EnableIntr(IOP_IRQ_DMA_SPU2);
	EnableIntr(IOP_IRQ_SPU);

	return 0;
}
Esempio n. 3
0
s32 SdInit(s32 flag)
{
	flag &= 1;

	InitSpu2();
	InitSpdif();

	Reset(flag);

	InitVoices();
	InitCoreVolume(flag);

	EnableIntr(0x24);
	EnableIntr(0x28);
	EnableIntr(9);

	return 0;
}