本文整理汇总了C#中AssetManager.FindSample方法的典型用法代码示例。如果您正苦于以下问题:C# AssetManager.FindSample方法的具体用法?C# AssetManager.FindSample怎么用?C# AssetManager.FindSample使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AssetManager
的用法示例。
在下文中一共展示了AssetManager.FindSample方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SampleGenerator
public SampleGenerator(GeneratorDescriptor description, AssetManager assets)
: base(description)
{
SampleDataAsset sample = assets.FindSample(IOHelper.GetFileNameWithoutExtension(description.AssetName));
if (sample == null)
throw new Exception("Could not find asset: (" + description.AssetName + ").");
data = sample.SampleData;
freq = sample.SampleRate;
if (end < 0)
end = sample.End;
if (start < 0)
start = sample.Start;
if (loopEnd < 0)
{
if (sample.LoopEnd < 0)
loopEnd = end;
else
loopEnd = sample.LoopEnd;
}
if (loopStart < 0)
{
if (sample.LoopStart < 0)
loopStart = start;
else
loopStart = sample.LoopStart;
}
if (genPeriod < 0)
genPeriod = 1;
if (root < 0)
{
root = sample.RootKey;
if (tuneCents == 0)
tuneCents = sample.Tune;
}
//check sample end and loop end for consistency
if (end > data.Length)
end = data.Length;
if (loopEnd > end)
loopEnd = end;
}