Game Development Reference
In-Depth Information
if (cooef<0.0f)
cooef = 0.0f;
int newVolume = m_StartVolume +
( float(m_EndVolume - m_StartVolume) * cooef);
if (m_ElapsedTime >= m_TotalFadeTime)
{
newVolume = m_EndVolume;
Succeed(); }
m_Sound->SetVolume(newVolume);
}
This class can change the volume of a sound effect over time, either up or down. It
assumes the initial volume of the sound effect has already been set properly, and all
the times are given in milliseconds.
Here
'
s how you would create some background music and fade it in over 10 seconds:
Resource resource(“SpaceGod7-Level2.ogg”);
shared_ptr<ResHandle> rh = g_pApp->m_ResCache->GetHandle(&resource);
shared_ptr<SoundProcess> music(GCC_NEW SoundProcess(rh, PROC_MUSIC, 0, true));
m_pProcessManager->Attach(music);
shared_ptr<FadeProcess> fadeProc(new FadeProcess(music, 10000, 100));
m_pProcessManager->AttachProcess(fadeProc);
The fade process grabs a smart pointer reference to the sound it is modifying, and
once the volume has been interpolated to the final value, the process kills itself.
Note that the original sound is created with a zero volume, and the fade process
brings it up to 100.
Simlish
Sims have their own language of gibberish called
which is meant to
sound like a real language. While there are a few words and phrases that
come to have actual
Simlish,
s mostly just designed to sound
appropriate and go with the tone of the conversation. Even the music has to
use this fake language, which presents an interesting challenge to the
musicians who create the songs you can hear when your sim turns on its
radio.
translations,
it
'
How was Simlish born? Well, there is no possible way to record all the speech
and dialogue required for each interaction without it sounding completely
stale after the first few times. By having Simlish, we are more easily able to
create that illusion without shipping a terabyte of speech.
 
Search WWH ::




Custom Search