OpenASR / idiolect

🎙️ Handsfree Audio Development Interface
https://arxiv.org/pdf/2305.03089.pdf
Apache License 2.0
93 stars 10 forks source link

LineUnavailableException: line with format PCM_SIGNED 16000.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian not supported #37

Closed nalbion closed 6 years ago

nalbion commented 7 years ago
INFO: Recognized: okay google
Exception in thread "ASR Thread" 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 com.jetbrains.idear.recognizer.CustomMicrophone.<init>(CustomMicrophone.kt:43)
    at com.jetbrains.idear.recognizer.CustomMicrophone$Companion.recordFromMic(CustomMicrophone.kt:68)
    at com.jetbrains.idear.asr.ASRControlLoop.getWebSpeechResult(ASRControlLoop.kt:355)
    at com.jetbrains.idear.asr.ASRControlLoop.fireGoogleSearch(ASRControlLoop.kt:344)
    at com.jetbrains.idear.asr.ASRControlLoop.applyAction(ASRControlLoop.kt:185)
    at com.jetbrains.idear.asr.ASRControlLoop.run(ASRControlLoop.kt:45)
    at java.lang.Thread.run(Thread.java:748)
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:121)
    at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:413)
    at com.jetbrains.idear.recognizer.CustomMicrophone.<init>(CustomMicrophone.kt:33)
    ... 6 more
breandan commented 7 years ago

I seem to recall this happens when another application does not release the microphone (try killing Skype, Hangouts, etc.). Otherwise, there might be two instances of idear running.

breandan commented 7 years ago

Actually this is caused by #16. It's a known issue with CMUSphinx, and we use their implementation of a Microphone. Might be worth fixing separately, if we're going to abstract over the ASR providers.

nalbion commented 7 years ago

I've tried to run gradlew runIde on Windows and this exception has come up when IntelliJ starts up

scottlahay commented 6 years ago

Getting this stack trace, which looks to be the same problem

java.lang.ExceptionInInitializerError at org.openasr.idear.VoiceRecordControllerAction.actionPerformed(VoiceRecordControllerAction.kt:26) at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:220) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:237) at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:195) at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:153) at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:346) at java.awt.Component.processEvent(Component.java:6306) at java.awt.Container.processEvent(Container.java:2237) at java.awt.Component.dispatchEventImpl(Component.java:4897) at java.awt.Container.dispatchEventImpl(Container.java:2295) at java.awt.Component.dispatchEvent(Component.java:4719) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467) at java.awt.Container.dispatchEventImpl(Container.java:2281) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4719) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764) at java.awt.EventQueue.access$500(EventQueue.java:98) at java.awt.EventQueue$3.run(EventQueue.java:715) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) at java.awt.EventQueue$4.run(EventQueue.java:737) at java.awt.EventQueue$4.run(EventQueue.java:735) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:734) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:646) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) 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:121) at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:413) at org.openasr.idear.recognizer.CustomMicrophone.(CustomMicrophone.kt:35) at org.openasr.idear.recognizer.CustomMicrophone$Companion.recordFromMic(CustomMicrophone.kt:54) at org.openasr.idear.asr.cmusphinx.CustomLiveSpeechRecognizer.startRecognition(CustomLiveSpeechRecognizer.kt:32) at org.openasr.idear.asr.cmusphinx.CMUSphinxASR.startRecognition(CMUSphinxASR.kt:39) at org.openasr.idear.asr.ASRControlLoop.startRecognition(ASRControlLoop.kt:21) at org.openasr.idear.asr.ASRControlLoop.start(ASRControlLoop.kt:15) at org.openasr.idear.asr.ASRService.(ASRService.kt:14)

ststeiger commented 3 years ago

This can also occur if you disabled Microphone access for applications (Settings/Privacy/Microphone)