本文整理汇总了C++中IXAudio2SourceVoice::SetFilterParameters方法的典型用法代码示例。如果您正苦于以下问题:C++ IXAudio2SourceVoice::SetFilterParameters方法的具体用法?C++ IXAudio2SourceVoice::SetFilterParameters怎么用?C++ IXAudio2SourceVoice::SetFilterParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IXAudio2SourceVoice
的用法示例。
在下文中一共展示了IXAudio2SourceVoice::SetFilterParameters方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: playSoundEffect
//.........这里部分代码省略.........
switch (choice) {
case 0: voice->SubmitSourceBuffer(scream1BufferDetails, scream1WMABuffer);
break;
case 1: voice->SubmitSourceBuffer(scream2BufferDetails, scream2WMABuffer);
break;
case 2: voice->SubmitSourceBuffer(scream3BufferDetails, scream3WMABuffer);
break;
default:
voice->SubmitSourceBuffer(scream1BufferDetails, scream1WMABuffer);
}
break;
}
case SFX_CAREXPLODE:
{
voice->SetVolume(2.0f);
voice->SubmitSourceBuffer(carexplodeBufferDetails, carexplodeWMABuffer);
break;
}
case SFX_EXPLOSION:
{
voice->SubmitSourceBuffer(explosionBufferDetails, explosionWMABuffer);
break;
}
case SFX_BEEP:
{
voice->SubmitSourceBuffer(beepBufferDetails, beepWMABuffer);
break;
}
case SFX_ROCKETLAUNCH:
{
voice->SubmitSourceBuffer(rocketlaunchBufferDetails, rocketlaunchWMABuffer);
break;
}
case SFX_PICKUP:
{
voice->SetVolume(2.0f);
voice->SubmitSourceBuffer(pickupBufferDetails, pickupWMABuffer);
break;
}
case SFX_SELECT:
{
voice->SubmitSourceBuffer(selectBufferDetails, selectWMABuffer);
break;
}
case SFX_SHOTGUN:
{
voice->SetVolume(2.5f);
voice->SubmitSourceBuffer(shotgunBufferDetails, shotgunWMABuffer);
break;
}
case SFX_TAKENLEAD:
{
voice->SubmitSourceBuffer(takenleadBufferDetails, takenleadWMABuffer);
break;
}
case SFX_LOSTLEAD:
{
voice->SubmitSourceBuffer(lostleadBufferDetails, lostleadWMABuffer);
break;
}
case SFX_NOAMMO:
{
voice->SubmitSourceBuffer(noammoBufferDetails, noammoWMABuffer);
break;
}
case SFX_ONE:
{
voice->SubmitSourceBuffer(oneBufferDetails, oneWMABuffer);
break;
}
case SFX_TWO:
{
voice->SubmitSourceBuffer(twoBufferDetails, twoWMABuffer);
break;
}
case SFX_THREE:
{
voice->SubmitSourceBuffer(threeBufferDetails, threeWMABuffer);
break;
}
default:
break;
}
X3DAudioCalculate(audio3DHandle, &listener, emit,
X3DAUDIO_CALCULATE_MATRIX | X3DAUDIO_CALCULATE_DOPPLER | X3DAUDIO_CALCULATE_LPF_DIRECT,
&dspSettings);
voice->SetOutputMatrix(smSFX, 1, details.OutputFormat.Format.nChannels, dspSettings.pMatrixCoefficients);
voice->SetFrequencyRatio(dspSettings.DopplerFactor);
XAUDIO2_FILTER_PARAMETERS filterParameters = { LowPassFilter, 2.0f * sinf(X3DAUDIO_PI/6.0f * dspSettings.LPFDirectCoefficient), 1.0f };
voice->SetFilterParameters(&filterParameters);
voice->Start();
}