0

我正在尝试从 STT 库中运行一个简单的示例草图以进行处理,并且在运行该草图时,我会收到以下提示:

然后我遇到错误“为 ddf.minim 找到重复库”,输出如下:

processing.app.SketchException: Duplicate libraries found for ddf.minim.
at processing.app.Mode.getLibrary(Mode.java:333)
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:434)
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:192)
at processing.mode.java.JavaBuild.build(JavaBuild.java:151)
at processing.mode.java.JavaBuild.build(JavaBuild.java:130)
at processing.mode.java.JavaMode.handleRun(JavaMode.java:120)
at processing.mode.java.JavaEditor$23.run(JavaEditor.java:697)
at java.lang.Thread.run(Thread.java:745)

查看 Processing 的内容,只有一个“最小”库文件夹。

这是我尝试运行的示例代码:

/*
// Using External Microphones with STT
// www.getflourish.com/sst/
//
// Florian Schulz 2013
*/

import com.getflourish.stt.*;
import ddf.minim.*;
import javax.sound.sampled.*;

STT stt;
String result;
String key = "api key goes here";

void setup ()
{
  size(600, 200);
  // Init STT automatically starts listening
  stt = new STT(this, key);
  stt.enableDebug();
  stt.setLanguage("en"); 

  // Display available Inputs with id and name
  Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();

  for(int i = 0; i < mixerInfo.length; i++)
  {
    println("### " + i + ": " + mixerInfo[i].getName());
  }  

  // Set input (e.g. 0)  
  Mixer mixer = AudioSystem.getMixer(mixerInfo[0]);

  // Update the Minim instance that STT is using
  Minim minim = stt.getMinimInstance();
  minim.setInputMixer(mixer);
  println("### Source set to: " + mixerInfo[0]);

}

// Method is called if transcription was successfull 
void transcribe (String utterance, float confidence) 
{
  println(utterance);
  result = utterance;
}
public void keyPressed () {
  stt.begin();
}
public void keyReleased () {
  stt.end();
}

void draw ()
{
  background(0);
}
4

1 回答 1

0

我遇到了同样的问题,您需要删除刚下载的库中的 lib 文件,它会解决问题,另外(不推荐)您可以转到处理文件夹转到 core/library 并从那里删除 lib 文件还请记住,如果您这样做,那么您需要在项目中每次需要它时添加该库文件

于 2017-01-03T01:06:31.267 回答