Пример #1
0
FMOD::Sound* USwFMOD::RegisterSoundSample( USound* Sound )
{
	if( Sound )
	{
		if( !Sound->Handle )
			RegisterSound(Sound);
		return GetSoundSample(Sound);
	}
	return NULL;
}
Пример #2
0
/**
**  Ask the sound server to register a sound and store the mapping
**  between its name and its id.
**  Register a sound group (or an unique sound if nb==1) and get the
**  corresponding sound id.
**
**  @param name  name of this sound group (Freed by caller).
**  @param file  list of sound file names
**  @param nb    number of sounds
**
**  @return      the sound id of the created group
*/
CSound *MakeSound(const std::string &name, const char *file[], int nb)
{
	CSound *sound;

	Assert(nb <= 255);

	if ((sound = FindSound(name))) {
		DebugPrint("re-register sound `%s'\n" _C_ name.c_str());
		return sound;
	}

	sound = RegisterSound(file, nb);
	if(sound != NO_SOUND)
		MapSound(name, sound);

	return sound;
}