我正在尝试从 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);
}