本文整理汇总了C++中fmod::DSP::addInput方法的典型用法代码示例。如果您正苦于以下问题:C++ DSP::addInput方法的具体用法?C++ DSP::addInput怎么用?C++ DSP::addInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fmod::DSP
的用法示例。
在下文中一共展示了DSP::addInput方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FMOD_Main
//.........这里部分代码省略.........
/*
Don't pass any dry signal from the reverb unit, instead take the dry part
of the mix from the main signal path
*/
result = reverbUnit->setParameterFloat(FMOD_DSP_CONVOLUTION_REVERB_PARAM_DRY, -80.0f);
ERRCHECK(result);
/*
We can now free our copy of the IR data and release the sound object, the reverb unit
has created it's internal data
*/
free(irData);
result = irSound->release();
ERRCHECK(result);
/*
Load up and play a sample clip recorded in an anechoic chamber
*/
FMOD::Sound* sound;
system->createSound(Common_MediaPath("singing.wav"), FMOD_3D | FMOD_LOOP_NORMAL, NULL, &sound);
ERRCHECK(result);
FMOD::Channel* channel;
system->playSound(sound, mainGroup, true, &channel);
ERRCHECK(result);
/*
Create a send connection between the channel head and the reverb unit
*/
FMOD::DSP* channelHead;
channel->getDSP(FMOD_CHANNELCONTROL_DSP_HEAD, &channelHead);
ERRCHECK(result);
FMOD::DSPConnection* reverbConnection;
result = reverbUnit->addInput(channelHead, &reverbConnection, FMOD_DSPCONNECTION_TYPE_SEND);
ERRCHECK(result);
result = channel->setPaused(false);
ERRCHECK(result);
float wetVolume = 1.0;
float dryVolume = 1.0;
/*
Main loop
*/
do
{
Common_Update();
if (Common_BtnPress(BTN_LEFT))
{
wetVolume = (wetVolume <= 0.0f) ? wetVolume : wetVolume - 0.05;
}
if (Common_BtnPress(BTN_RIGHT))
{
wetVolume = (wetVolume >= 1.0f) ? wetVolume : wetVolume + 0.05f;
}
if (Common_BtnPress(BTN_DOWN))
{
dryVolume = (dryVolume <= 0.0f) ? dryVolume : dryVolume - 0.05f;
}
if (Common_BtnPress(BTN_UP))
{
dryVolume = (dryVolume >= 1.0f) ? dryVolume : dryVolume + 0.05f;
}