2

Need help how to use Sphinx4 API correctly, i am read from this link : http://cmusphinx.sourceforge.net/wiki/tutorialsphinx4,but when i am run DialogDemo.java i am getting this error :

Exception in thread "main" java.lang.IllegalStateException: javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 16000.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian not supported.
    at edu.cmu.sphinx.api.Microphone.<init>(Microphone.java:38)
    at edu.cmu.sphinx.api.SpeechSourceProvider.getMicrophone(SpeechSourceProvider.java:18)
    at edu.cmu.sphinx.api.LiveSpeechRecognizer.<init>(LiveSpeechRecognizer.java:35)
    at com.mycompany.spechrecognizer.DialogDemo.main(DialogDemo.java:143)
Caused by: javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 16000.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian not supported.
    at com.sun.media.sound.DirectAudioDevice$DirectDL.implOpen(DirectAudioDevice.java:513)
    at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:124)
    at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:416)
    at edu.cmu.sphinx.api.Microphone.<init>(Microphone.java:36)

i have search in google how to fix it and the result : Can't access microphone while running Dialog demo in sphinx4 5prealpha and https://github.com/cmusphinx/sphinx4/issues/33 but i can not understand, can someone explain to me how to use sphinx API step by step correctly?

Community
  • 1
  • 1
syam houng
  • 307
  • 4
  • 14

2 Answers2

0

Yes there is problem with sample DialogDemo.java. But other samples are working without any issue.

g10dras
  • 399
  • 2
  • 11
-1

I proposed a temporary work around for this problem until the API is fixed in the question Can't access microphone while running Dialog demo in sphinx4 5prealpha
what I had done is edited the code of the Microphone and LiveSpeechRecognizer classes,to be able to close the line opened to the microphone resource, so that another instance of the 'LiveSpeechRecognizer' can use the line.

Community
  • 1
  • 1
Ahmed Shariff
  • 793
  • 6
  • 12