本文整理汇总了Java中net.beadsproject.beads.data.SampleManager.sample方法的典型用法代码示例。如果您正苦于以下问题:Java SampleManager.sample方法的具体用法?Java SampleManager.sample怎么用?Java SampleManager.sample使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.beadsproject.beads.data.SampleManager
的用法示例。
在下文中一共展示了SampleManager.sample方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSampleBank
import net.beadsproject.beads.data.SampleManager; //导入方法依赖的package包/类
private RealizedInstrument createSampleBank(Instrument instr) {
RealizedInstrument info = instrMap.get(instr);
if (info == null) {
SampleBankUGen sb = new SampleBankUGen(ac);
for (Map.Entry<Integer, SampleInfo> entry : instr.getSampleMap().entrySet()) {
SampleInfo sampleInfo = entry.getValue();
Sample sample = SampleManager.sample(sampleInfo.fileName);
if (sampleInfo.startMs >= 0.0) {
// Range is specified
SampleRange sr = new SampleRange(sampleInfo.startMs, sampleInfo.endMs);
sb.addSample(sampleInfo.note, sample, sampleInfo.gain, sr);
} else {
// Play entire sample
sb.addSample(sampleInfo.note, sample, sampleInfo.gain);
}
}
info = new RealizedInstrument(sb, ac);
instrMap.put(instr, info);
}
return info;
}
示例2: Audio
import net.beadsproject.beads.data.SampleManager; //导入方法依赖的package包/类
public Audio(String file) {
lastPlayStart = 0;
audioFile = file;
ac = new AudioContext();
samp = SampleManager.sample(file);
sp = new SamplePlayer(ac, samp);
gain = new Gain(ac, 1, 0.1f);
gain.addInput(sp);
ac.out.addInput(gain);
stop();
typeManager = new SegmentTypeManager();
segments = new HashSet<Segment>();
selectedRegionStart = -1;
selectedRegionEnd = -1;
}