本文整理汇总了C++中MarSystem::clone方法的典型用法代码示例。如果您正苦于以下问题:C++ MarSystem::clone方法的具体用法?C++ MarSystem::clone怎么用?C++ MarSystem::clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MarSystem
的用法示例。
在下文中一共展示了MarSystem::clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: textract_trainAccumulator
void textract_trainAccumulator(string sfName, mrs_natural offset, mrs_natural duration, mrs_real start, mrs_real length, mrs_real gain, mrs_natural label, string pluginName, string wekafname, mrs_natural memSize, string extractorStr, TimeLine& tline)
{
MarSystemManager mng;
MRSDIAG("sfplay.cpp - sfplay");
// default
if (extractorStr == EMPTYSTRING)
extractorStr = "STFT";
// Find proper soundfile format and create SignalSource
MarSystem *src = mng.create("SoundFileSource", "src");
src->updctrl("mrs_string/filename", sfName);
src->updctrl("mrs_natural/inSamples", MRS_DEFAULT_SLICE_NSAMPLES);
if (tlineName == EMPTYSTRING)
{
mrs_natural hops = src->getctrl("mrs_natural/size")->to<mrs_natural>() * src->getctrl("mrs_natural/nChannels")->to<mrs_natural>() / 2048 + 1;
tline.regular(100, hops);
}
MarSystem *dest_;
dest_ = mng.create("AudioSink", "dest");
MarSystem *series = mng.create("Series", "playbacknet");
series->addMarSystem(src);
series->addMarSystem(dest_);
series->updctrl("AudioSink/dest/mrs_natural/nChannels",
series->getctrl("SoundFileSource/src/mrs_natural/nChannels")->to<mrs_natural>());
// Calculate duration, offset parameters if necessary
if (start > 0.0f)
offset = (mrs_natural) (start
* src->getctrl("mrs_real/israte")->to<mrs_real>()
* src->getctrl("mrs_natural/nChannels")->to<mrs_natural>());
if (length != 30.0f)
duration = (mrs_natural) (length
* src->getctrl("mrs_real/israte")->to<mrs_real>()
* src->getctrl("mrs_natural/nChannels")->to<mrs_natural>());
// accumulate feature vectors over 30 seconds
MarSystem* acc = mng.create("Accumulator", "acc");
acc->updctrl("mrs_natural/nTimes", 100);
// Calculate windowed power spectrum and then
// calculate specific feature sets
MarSystem* spectralShape = mng.create("Series", "spectralShape");
spectralShape->addMarSystem(mng.create("Windowing", "hamming"));
spectralShape->addMarSystem(mng.create("Spectrum","spk"));
spectralShape->addMarSystem(mng.create("PowerSpectrum", "pspk"));
spectralShape->updctrl("PowerSpectrum/pspk/mrs_string/spectrumType","power");
// Spectrum Shape descriptors
MarSystem* spectrumFeatures = mng.create("Fanout", "spectrumFeatures");
if (extractorStr == "STFT")
{
spectrumFeatures->addMarSystem(mng.create("Centroid", "cntrd"));
spectrumFeatures->addMarSystem(mng.create("Rolloff", "rlf"));
spectrumFeatures->addMarSystem(mng.create("Flux", "flux"));
}
else if (extractorStr == "STFTMFCC")
{
spectrumFeatures->addMarSystem(mng.create("Centroid", "cntrd"));
spectrumFeatures->addMarSystem(mng.create("Rolloff", "rlf"));
spectrumFeatures->addMarSystem(mng.create("Flux", "flux"));
spectrumFeatures->addMarSystem(mng.create("MFCC", "mfcc"));
}
else if (extractorStr == "MFCC")
spectrumFeatures->addMarSystem(mng.create("MFCC", "mfcc"));
else if (extractorStr == "SCF")
spectrumFeatures->addMarSystem(mng.create("SCF", "scf"));
else if (extractorStr == "SFM")
spectrumFeatures->addMarSystem(mng.create("SFM", "sfm"));
mng.registerPrototype("SpectrumFeatures", spectrumFeatures->clone());
spectralShape->addMarSystem(mng.create("SpectrumFeatures", "spectrumFeatures"));
mng.registerPrototype("SpectralShape", spectralShape->clone());
// add time-domain zerocrossings
MarSystem* features = mng.create("Fanout", "features");
features->addMarSystem(mng.create("SpectralShape", "SpectralShape"));
if (extractorStr == "STFT")
features->addMarSystem(mng.create("ZeroCrossings", "zcrs"));
mng.registerPrototype("Features", features->clone());
// Means and standard deviation (statistics) for texture analysis
MarSystem* statistics = mng.create("Fanout","statistics");
statistics->addMarSystem(mng.create("Mean", "mn"));
statistics->addMarSystem(mng.create("StandardDeviation", "std"));
mng.registerPrototype("Statistics", statistics->clone());
// weka output
MarSystem *wsink = mng.create("WekaSink","wsink");
// Build the overall feature calculation network
MarSystem* featureNetwork = mng.create("Series", "featureNetwork");
//.........这里部分代码省略.........