当前位置: 首页>>代码示例>>Java>>正文


Java SampleManager.sample方法代码示例

本文整理汇总了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;
}
 
开发者ID:daveho,项目名称:FunWithSound,代码行数:24,代码来源:Player.java

示例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;
}
 
开发者ID:sashavolv2,项目名称:Transcribe,代码行数:20,代码来源:Audio.java


注:本文中的net.beadsproject.beads.data.SampleManager.sample方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。