本文整理汇总了C++中SoundManager::is_audio_enabled方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundManager::is_audio_enabled方法的具体用法?C++ SoundManager::is_audio_enabled怎么用?C++ SoundManager::is_audio_enabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoundManager
的用法示例。
在下文中一共展示了SoundManager::is_audio_enabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void ConverseSpeech::update()
{
TownsSound sound;
SoundManager *sm = Game::get_game()->get_sound_manager();
if(!sm->is_audio_enabled() || !sm->is_speech_enabled())
return;
if(!list.empty())
{
if(sm->isSoundPLaying(handle) == false)
{
list.pop_front();
if(!list.empty())
{
sound = list.front();
handle = sm->playTownsSound(sound.filename, sound.sample_num);
}
}
}
}
示例2: play_speech
void ConverseSpeech::play_speech(uint16 actor_num, uint16 sample_num)
{
std::string sample_file;
char filename[20]; // "/speech/charxxx.sam"
TownsSound sound;
SoundManager *sm = Game::get_game()->get_sound_manager();
if(!sm->is_audio_enabled() || !sm->is_speech_enabled())
return;
//translate the converse sample number into the CHAR number in the SPEECH directory if required.
if(actor_num == 202) //GUARDS
actor_num = 228;
if(actor_num == 201) //WISPS
actor_num = 229;
sample_num--;
sprintf(filename, "speech%cchar%u.sam", U6PATH_DELIMITER, actor_num);
config->pathFromValue("config/ultima6/townsdir", filename, sample_file);
DEBUG(0,LEVEL_DEBUGGING,"Loading Speech Sample %s:%d\n", sample_file.c_str(), sample_num);
sound.filename = sample_file;
sound.sample_num = sample_num;
if(list.empty())
handle = sm->playTownsSound(sample_file, sample_num);
list.push_back(sound);
return;
}