本文整理汇总了C++中sgd::AudioManager::SetVoiceVolume方法的典型用法代码示例。如果您正苦于以下问题:C++ AudioManager::SetVoiceVolume方法的具体用法?C++ AudioManager::SetVoiceVolume怎么用?C++ AudioManager::SetVoiceVolume使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sgd::AudioManager
的用法示例。
在下文中一共展示了AudioManager::SetVoiceVolume方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckDamage
void Player::CheckDamage(void)
{
SGD::AudioManager* pAudio = SGD::AudioManager::GetInstance();
Game* pGame = Game::GetInstance();
// dead, !hurt
if (profile.health <= 0.0f)
{
profile.health = 0.0f;
if (m_hHurt != nullptr && pAudio->IsAudioPlaying(*m_hHurt) == true)
pAudio->StopAudio(*m_hHurt);
if (pAudio->IsAudioPlaying(*m_hDeath) == false)
voice = pAudio->PlayAudio(*m_hDeath, false);
pAudio->SetVoiceVolume(voice);
m_bIsAlive = false;
SetVelocity({ 0, 0 });
}
// hurt, !dead
else
{
int sound = rand() % 3;
switch (sound)
{
case 0:
m_hHurt = &pGame->playerHurt1;
break;
case 1:
m_hHurt = &pGame->playerHurt2;
break;
case 2:
m_hHurt = &pGame->playerHurt3;
break;
default:
break;
}
if (pAudio->IsAudioPlaying(pGame->playerHurt1) == false &&
pAudio->IsAudioPlaying(pGame->playerHurt2) == false &&
pAudio->IsAudioPlaying(pGame->playerHurt3) == false)
voice = pAudio->PlayAudio(*m_hHurt, false);
pAudio->SetVoiceVolume(voice);
m_hHurt = nullptr;
}
}
示例2: if
// Enter
/*virtual*/ void IntroState::Enter(void)
{
// Set background color
SGD::GraphicsManager::GetInstance()->SetClearColor({ 0, 0, 0 }); // black
//starting_y = Game::GetInstance()->GetScreenHeight() + 20.0F;// * 15.0F;// + 170.0F;
// Load assets
SGD::GraphicsManager* pGraphics = SGD::GraphicsManager::GetInstance();
SGD::AudioManager* pAudio = SGD::AudioManager::GetInstance();
AnimationManager* pAnimationManager = AnimationManager::GetInstance();
//pAnimationManager->Load("resource/config/animations/Zombie_Animation_New.xml", "zombie");
//animation.m_strCurrAnimation = "zombie";
pAudio->SetVoiceVolume(Game::GetInstance()->m_hMainVoice, 35);
m_hBackgroundImage = pGraphics->LoadTexture("resource/graphics/MenuImages/emergencybroadcast.png");
m_hinstruct = SGD::GraphicsManager::GetInstance()->LoadTexture("resource/graphics/MenuImages/ArcadeControlsIcons.png");
m_hEmergency = pAudio->LoadAudio("resource/audio/zombieemergency.wav");
if (IntroTimer.GetTime() < 45.0f)
{
float newTime = 45.0f - IntroTimer.GetTime();
IntroTimer.AddTime(newTime);
}
else if (IntroTimer.GetTime() <= 0.0f)
IntroTimer.AddTime(45.0f);
if (ScreenTimer.GetTime() < .1f)
{
float newTime = .1f - ScreenTimer.GetTime();
ScreenTimer.AddTime(newTime);
}
else if (ScreenTimer.GetTime() <= 0.0f)
ScreenTimer.AddTime(.1f);
transBack = 255;
transTextFirst = 0;
transText = 0;
//IntroTimer.AddTime(45.0f - IntroTimer.GetTime());
//ScreenTimer.AddTime(.1f - ScreenTimer.GetTime());
pAudio->PlayAudio(m_hEmergency, false);
//m_hBackgroundImage = pGraphics->LoadTexture("resource/graphics/youLose.png");
//m_hBackgroundMusic = pAudio->LoadAudio("resource/audio/JNB_Credits_PinballGroove.xwm");
//pAudio->PlayAudio(m_hBackgroundMusic);
}
示例3:
// Exit
/*virtual*/ void IntroState::Exit(void)
{
SGD::GraphicsManager* pGraphics = SGD::GraphicsManager::GetInstance();
SGD::AudioManager * pAudio = SGD::AudioManager::GetInstance();
// Unload assets
pGraphics->UnloadTexture(m_hBackgroundImage);
pGraphics->UnloadTexture(m_hinstruct);
//pAudio->UnloadAudio(m_hBackgroundMusic);
pAudio->UnloadAudio(m_hEmergency);
pAudio->SetVoiceVolume(Game::GetInstance()->m_hMainVoice, 100);
}