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


Java FrontEnd.getData方法代码示例

本文整理汇总了Java中edu.cmu.sphinx.frontend.FrontEnd.getData方法的典型用法代码示例。如果您正苦于以下问题:Java FrontEnd.getData方法的具体用法?Java FrontEnd.getData怎么用?Java FrontEnd.getData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.cmu.sphinx.frontend.FrontEnd的用法示例。


在下文中一共展示了FrontEnd.getData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processFile

import edu.cmu.sphinx.frontend.FrontEnd; //导入方法依赖的package包/类
static private void processFile(String inputFile, String outputFile,
        ConfigurationManager cm) throws MalformedURLException, IOException {

    FrontEnd frontend = (FrontEnd) cm.lookup("endpointer");

    AudioFileDataSource dataSource = (AudioFileDataSource) cm
            .lookup("audioFileDataSource");
    System.out.println(inputFile);
    dataSource.setAudioFile(new File(inputFile), null);
    WavWriter wavWriter = (WavWriter) cm.lookup("wavWriter");
    wavWriter.setOutFilePattern(outputFile);

    frontend.initialize();

    Data data = null;
    do {
        data = frontend.getData();
    } while (data != null);
}
 
开发者ID:juanma2268,项目名称:jumbertoTeia2600,代码行数:20,代码来源:Segmenter.java

示例2: main

import edu.cmu.sphinx.frontend.FrontEnd; //导入方法依赖的package包/类
/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {

//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/foo.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noise_only.wav");

//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/clean/sp12.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/clean/sp03.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/clean/sp05.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/clean/sp06.wav");
		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/clean/sp07.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/train_10dB/sp07_train_sn10.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/train_5dB/sp07_train_sn5.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/sp07_train_sn10_long.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/train_10dB/sp12_train_sn10.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/train_5dB/sp12_train_sn5.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/car_10dB/sp12_car_sn10.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/sp12_train_sn10_then_noise_only.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/sp12_train_sn10_preceeding_noise.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/sp12_train_sn10_preceeding_noise_sp12_train_sn10_again.wav");


		AudioFileDataSource audioDataSource = new AudioFileDataSource(3200, null);
		audioDataSource.setAudioFile(path, "in");
		ArrayList<DataProcessor> pipeline = new ArrayList<DataProcessor>();
		pipeline.add(new VQVADPipeline(audioDataSource));
		pipeline.add(new ClassificationResultDumper(path.getFile(), 30, 10, "/tmp/vqvad_classification_result"));

		FrontEnd frontend = new FrontEnd(pipeline);
		Data d;

		do {
			d = frontend.getData();
		} while(d != null && !(d instanceof DataEndSignal));
	}
 
开发者ID:knowledgetechnologyuhh,项目名称:docks,代码行数:39,代码来源:ClassificationTest.java

示例3: main

import edu.cmu.sphinx.frontend.FrontEnd; //导入方法依赖的package包/类
public static void main(String[] args) throws MalformedURLException {
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/foo.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset//noise_only.wav");

//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/clean/sp12.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/clean/sp06.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/clean/sp07.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/train_10dB/sp07_train_sn10.wav");
		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/train_5dB/sp07_train_sn5.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/train_10dB/sp12_train_sn10.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/train_5dB/sp12_train_sn5.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/car_10dB/sp12_car_sn10.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/sp12_train_sn10_then_noise_only.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/sp12_train_sn10_preceeding_noise.wav");
//		URL path = new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/sp12_train_sn10_preceeding_noise_sp12_train_sn10_again.wav");


		AudioFileDataSource audioDataSource = new AudioFileDataSource(3200, null);
		audioDataSource.setAudioFile(path, "in");

		ArrayList<DataProcessor> pipeline = new ArrayList<DataProcessor>();
		pipeline.add(audioDataSource);
		//blocks data into frames
		pipeline.add(new DataBlocker(10));
		//classifies speech frames
		pipeline.add(new SpeechClassifier(10, 0.015, 10, 0));
		pipeline.add(new GapSmoothing(12));
		pipeline.add(new ClassificationResultDumper(path.getFile(), 10, 10, "/tmp/vqvad_classification_result"));

		FrontEnd frontend = new FrontEnd(pipeline);
		Data d;

		do {
			d = frontend.getData();
		} while(d != null && !(d instanceof DataEndSignal));
	}
 
开发者ID:knowledgetechnologyuhh,项目名称:docks,代码行数:37,代码来源:ClassificationTest.java

示例4: main

import edu.cmu.sphinx.frontend.FrontEnd; //导入方法依赖的package包/类
/**
 * @param args
 * @throws IOException
 */
public static void main(String[] args) throws IOException {

	URL[] paths = new URL[]{
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/clean/sp12.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/clean/sp03.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/clean/sp05.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/clean/sp06.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/clean/sp07.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/train_10dB/sp05_train_sn10.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/train_10dB/sp06_train_sn10.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/train_10dB/sp07_train_sn10.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/train_5dB/sp07_train_sn5.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/sp07_train_sn10_long.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/train_10dB/sp12_train_sn10.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/train_5dB/sp12_train_sn5.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/noizeus_train/car_10dB/sp12_car_sn10.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/sp12_train_sn10_then_noise_only.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/sp12_train_sn10_preceeding_noise.wav"),
		new URL("file:///home/nemo/Documents/Studium/Master/study/code/VQVAD/trainset/sp12_train_sn10_preceeding_noise_sp12_train_sn10_again.wav"),
	};

	VQVADPipeline vadpipe = null;
	VQVADModel lastModel = null;

	for (URL path : paths) {
		System.out.println(path);
		AudioFileDataSource audioDataSource = new AudioFileDataSource(3200, null);
		audioDataSource.setAudioFile(path, "in");

		vadpipe = new VQVADPipeline(audioDataSource);

		if (lastModel != null) {
			vadpipe.setStartingModel(lastModel);
		}

		ArrayList<DataProcessor> pipeline = new ArrayList<DataProcessor>();
		pipeline.add(vadpipe);
		pipeline.add(new ClassificationResultDumper(path.getFile(), 30, 10, "/tmp/vqvad_classification_result"));

		FrontEnd frontend = new FrontEnd(pipeline);
		Data d;

		do {
			d = frontend.getData();
		} while(d != null && !(d instanceof DataEndSignal));

		lastModel = vadpipe.getCurrentModel();
	}
}
 
开发者ID:knowledgetechnologyuhh,项目名称:docks,代码行数:54,代码来源:Trainer.java


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