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


Java SampleManager类代码示例

本文整理汇总了Java中net.beadsproject.beads.data.SampleManager的典型用法代码示例。如果您正苦于以下问题:Java SampleManager类的具体用法?Java SampleManager怎么用?Java SampleManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SampleManager类属于net.beadsproject.beads.data包,在下文中一共展示了SampleManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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

示例3: onCreatePlayer

import net.beadsproject.beads.data.SampleManager; //导入依赖的package包/类
@Override
protected void onCreatePlayer(Player player) {
	player.setCustomInstrumentFactory(new CustomInstrumentFactoryImpl(
			0, new CustomInstrumentFactoryImpl.CreateCustomInstrument() {
				@Override
				public RealizedInstrument create(AudioContext ac) {
					WeirdSampleBankUGen spu = new WeirdSampleBankUGen(ac);
					// These samples are local to the project - sorry, Github
					spu.addSample(0, SampleManager.sample("samples/torvalds-says-linux-noclip.wav"), 0.7, randFreq());
					spu.addSample(1, SampleManager.sample("samples/torvalds-says-linux-noclip.wav"), 0.9, new SampleRange(3162,  3600)/*, randFreq()*/);
					spu.addSample(2, SampleManager.sample("samples/201571__julien-matthey__jm-fx-boom-01a.wav"), 0.4);

					spu.addSample(3, SampleManager.sample("samples/torvalds-says-linux-noclip.wav"), 0.7, randFreq());
					spu.addSample(4, SampleManager.sample("samples/torvalds-says-linux-noclip.wav"), 0.9, new SampleRange(3162,  3600), randFreq());
					spu.addSample(5, SampleManager.sample("samples/torvalds-says-linux-noclip.wav"), 0.9, new SampleRange(3162,  3600), randFreq());
					
					spu.addSample(6, SampleManager.sample("samples/torvalds-says-linux-noclip.wav"), 0.9, new SampleRange(3162,  3600), randFreq());
					spu.addSample(7, SampleManager.sample("samples/torvalds-says-linux-noclip.wav"), 0.9, new SampleRange(3162,  3600), randFreq());
					spu.addSample(8, SampleManager.sample("samples/torvalds-says-linux-noclip.wav"), 0.9, new SampleRange(3162,  3600), randFreq());
					spu.addSample(9, SampleManager.sample("samples/torvalds-says-linux-noclip.wav"), 0.9, new SampleRange(3162,  3600), randFreq());
					spu.addSample(10, SampleManager.sample("samples/torvalds-says-linux-noclip.wav"), 0.9, new SampleRange(3162,  3600), randFreq());
					spu.addSample(11, SampleManager.sample("samples/torvalds-says-linux-noclip.wav"), 0.9, new SampleRange(3162,  3600), randFreq());

					return new RealizedInstrument(spu, ac);
				}
			}));
}
 
开发者ID:daveho,项目名称:FunWithSound,代码行数:28,代码来源:LinuxTechno2.java


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