本文整理汇总了C++中fmod::Channel::addDSP方法的典型用法代码示例。如果您正苦于以下问题:C++ Channel::addDSP方法的具体用法?C++ Channel::addDSP怎么用?C++ Channel::addDSP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fmod::Channel
的用法示例。
在下文中一共展示了Channel::addDSP方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
{
key = _getch();
}
if (key == 'e' || key == 'E')
{
bool bypass;
dsp->getBypass(&bypass);
dsp->setBypass(!bypass);
if (bypass)
{
FMOD_REVERB_PROPERTIES prop = FMOD_PRESET_CONCERTHALL;
system->setReverbProperties(&prop);
}
else
{
FMOD_REVERB_PROPERTIES prop = FMOD_PRESET_OFF;
system->setReverbProperties(&prop);
}
printf("\n\n *** TURN DSP EFFECT %s ** \n\n", bypass ? "ON" : "OFF");
}
system->getRecordPosition(0, &recordpos);
ERRCHECK(result);
recorddelta = recordpos >= lastrecordpos ? recordpos - lastrecordpos : recordpos + soundlength - lastrecordpos;
samplesrecorded += recorddelta;
if (samplesrecorded >= adjustedlatency && !channel)
{
result = system->playSound(FMOD_CHANNEL_FREE, sound, 0, &channel);
ERRCHECK(result);
result = channel->addDSP(dsp, 0);
ERRCHECK(result);
}
if (channel && recorddelta)
{
unsigned int playrecorddelta;
unsigned int playpos = 0;
int adjusting = 0;
float smootheddelta;
float dampratio = 0.97f;
static unsigned int minrecorddelta = (unsigned int)-1;
/*
If the record driver steps the position of the record cursor in larger increments than the user defined latency value, then we should
increase our latency value to match.
*/
if (recorddelta < minrecorddelta)
{
minrecorddelta = recorddelta;
if (adjustedlatency < recorddelta)
{
adjustedlatency = recorddelta;
}
}
channel->getPosition(&playpos, FMOD_TIMEUNIT_PCM);
playrecorddelta = recordpos >= playpos ? recordpos - playpos : recordpos + soundlength - playpos;
/*
Smooth total
*/