2

I'm using Sphinx's hello world jar file & have included the Sphinx4.jar & the WSJ_..._6800Hz.jar...

Code looks like this:

object App {
  def main(args: Array[String]): Unit = {
    edu.cmu.sphinx.demo.helloworld.HelloWorld.main(Array[String]())
  }
}

But I'm getting errors:

SEVERE: couldn't find suitable target audio format
[error] (run-main-1) java.lang.IllegalArgumentException: No line matching interface TargetDataLine is supported.
java.lang.IllegalArgumentException: No line matching interface TargetDataLine is supported.
    at javax.sound.sampled.AudioSystem.getLine(AudioSystem.java:479)
    at edu.cmu.sphinx.frontend.util.Microphone.getAudioLine(Microphone.java:330)
    at edu.cmu.sphinx.frontend.util.Microphone.open(Microphone.java:359)
    at edu.cmu.sphinx.frontend.util.Microphone.startRecording(Microphone.java:435)
    at edu.cmu.sphinx.demo.helloworld.HelloWorld.main(HelloWorld.java:41)
    at example.App$.main(App.scala:10)
    at example.App.main(App.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
[trace] Stack trace suppressed: run last compile:run for the full output.
java.lang.RuntimeException: Nonzero exit code: 1
    at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) Nonzero exit code: 1
[error] Total time: 6 s, completed Aug 29, 2014 11:06:43 PM
5. Waiting for source changes... (press enter to interrupt)

What could I be doing wrong here?

  • Mac OS 10.9.4 (macbook pro)
  • javac 1.8.0_11
  • Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
  • Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)
goo
  • 2,230
  • 4
  • 32
  • 53
  • The exception is more or less self-explaining, your java doesn't support recording in specific format. You need to update your java (sometimes it helps to use Oracle's JVM) or your system configuration. – Nikolay Shmyrev Aug 30 '14 at 07:19
  • I have the latest Java so I'm guessing it's the latter. How can I find out which system configuration needs updating? – goo Aug 30 '14 at 07:50
  • No idea, you didn't even mention what OS are you running. – Nikolay Shmyrev Aug 30 '14 at 08:35
  • You can learn more from http://stackoverflow.com/questions/6002444/java-recording-from-mixer – Nikolay Shmyrev Aug 30 '14 at 08:36
  • @NikolayShmyrev Unfortunately, the link didn't help much.. I edited in more information above – goo Aug 30 '14 at 09:31
  • The link provides you the way to query available audio formats. You can run similar code that to check what is going on. – Nikolay Shmyrev Aug 30 '14 at 10:45

0 Answers0