本文整理汇总了C++中fmod::DSP::setChannelFormat方法的典型用法代码示例。如果您正苦于以下问题:C++ DSP::setChannelFormat方法的具体用法?C++ DSP::setChannelFormat怎么用?C++ DSP::setChannelFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fmod::DSP
的用法示例。
在下文中一共展示了DSP::setChannelFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitFmod
void InitFmod(){
cfmod(FMOD::System_Create(&fmodSystem));
u32 version = 0;
cfmod(fmodSystem->getVersion(&version));
if(version < FMOD_VERSION){
std::cerr
<< "FMOD version of at least " << FMOD_VERSION
<< " required. Version used " << version
<< std::endl;
throw "FMOD Error";
}
cfmod(fmodSystem->init(100, FMOD_INIT_NORMAL, nullptr));
FMOD::DSP* dsp;
FMOD::DSP* compressor;
{ FMOD_DSP_DESCRIPTION desc;
memset(&desc, 0, sizeof(desc));
// strncpy(desc.name, "Fuckyou", sizeof(desc.name));
desc.numinputbuffers = 0;
desc.numoutputbuffers = 1;
desc.read = DSPCallback;
desc.userdata = new DSPUserdata{/*sched, */0.0};
cfmod(fmodSystem->createDSP(&desc, &dsp));
cfmod(dsp->setChannelFormat(FMOD_CHANNELMASK_STEREO,2,FMOD_SPEAKERMODE_STEREO));
}
cfmod(fmodSystem->createDSPByType(FMOD_DSP_TYPE_COMPRESSOR, &compressor));
cfmod(compressor->setParameterFloat(FMOD_DSP_COMPRESSOR_THRESHOLD, -13));
cfmod(compressor->setParameterFloat(FMOD_DSP_COMPRESSOR_ATTACK, 1));
cfmod(compressor->setBypass(false));
cfmod(dsp->setBypass(false));
FMOD::ChannelGroup* mastergroup;
cfmod(fmodSystem->getMasterChannelGroup(&mastergroup));
cfmod(mastergroup->addDSP(0, compressor));
cfmod(fmodSystem->playDSP(dsp, mastergroup, false, &channel));
cfmod(channel->setMode(FMOD_2D));
cfmod(channel->setVolume(0.7f));
FMOD::Reverb3D* reverb;
cfmod(fmodSystem->createReverb3D(&reverb));
// http://www.fmod.org/docs/content/generated/FMOD_REVERB_PROPERTIES.html
FMOD_REVERB_PROPERTIES rprops = {
.DecayTime = 8000.0, //1500.0, /* Reverberation decay time in ms */
.EarlyDelay = 7.0, //7.0, /* Initial reflection delay time */
.LateDelay = 11.0, //11.0, /* Late reverberation delay time relative to initial reflection */
.HFReference = 5000.0, /* Reference high frequency (hz) */
.HFDecayRatio = 50.0, /* High-frequency to mid-frequency decay time ratio */
.Diffusion = 60.0, /* Value that controls the echo density in the late reverberation decay. */
.Density = 100.0, //100.0, /* Value that controls the modal density in the late reverberation decay */
.LowShelfFrequency = 250.0, /* Reference low frequency (hz) */
.LowShelfGain = 0.0, /* Relative room effect level at low frequencies */
.HighCut = 10000.0, /* Relative room effect level at high frequencies */
.EarlyLateMix = 50.0, /* Early reflections level relative to room effect */
.WetLevel = -12.0, //-6.0, /* Room effect level (at mid frequencies) */
};
cfmod(reverb->setProperties(&rprops));
}