|
Sound Playback Using Direct Mode Example 4 |
Mission : Get to hear something in the easiest way possible!
Download the Expansion Pack!
IntroLocated in Header File void SetupDirectPlay(); void DirectPlay(unsigned char); void DirectPlay(); void GetISRPtr(ISRS*); long place; ISRS * isrs; |
void SB16::SetupDirectPlay()
{isrs->SetupTimerISR();
isrs->SetTimerFrequency(11025);
}
void SB16::GetISRPtr(ISRS* isrs)
{ this->isrs=isrs;
}
|
void SB16::DirectPlay(unsigned char byte)
{WriteDSP(0x10);
WriteDSP(byte);
}
void SB16::DirectPlay()
{unsigned char byte=Sounds[0].Sound[place];
WriteDSP(0x10);
WriteDSP(byte);
place++;
if(place >=Sounds[0].Length)
{place=0;
}
} |