idiolect icon indicating copy to clipboard operation
idiolect copied to clipboard

Error com.google.gson.JsonSyntaxException on ListeningState

Open Halleck45 opened this issue 2 years ago • 4 comments

Hi!

Thanks for your work!

I have this error when I click on the Idiolect button. I don't know how to fix it.

Thanks for your help

2023-06-01 07:50:31,674 [1148013]   INFO - #org.openasr.idiolect.asr.ListeningState - ListeningState -> STARTED
2023-06-01 07:50:36,488 [1152827]   WARN - #org.openasr.idiolect.asr.AsrControlLoop - Failed to process utterance: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected ':' at line 3 column 33 path $.alternatives[0].124054
	at com.google.gson.internal.Streams.parse(Streams.java:61)
	at com.google.gson.JsonParser.parseReader(JsonParser.java:102)
	at com.google.gson.JsonParser.parseReader(JsonParser.java:70)
	at com.google.gson.JsonParser.parseString(JsonParser.java:51)
	at org.openasr.idiolect.asr.vosk.VoskAsr.parseVosk(VoskAsr.kt:207)
	at org.openasr.idiolect.asr.vosk.VoskAsr.tryParseResult(VoskAsr.kt:202)
	at org.openasr.idiolect.asr.vosk.VoskAsr.waitForSpeech(VoskAsr.kt:193)
	at org.openasr.idiolect.asr.AsrControlLoop.run(AsrControlLoop.kt:86)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: com.google.gson.stream.MalformedJsonException: Expected ':' at line 3 column 33 path $.alternatives[0].124054
	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1659)
	at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:539)
	at com.google.gson.stream.JsonReader.peek(JsonReader.java:433)
	at com.google.gson.internal.bind.TypeAdapters$28.read(TypeAdapters.java:786)
	at com.google.gson.internal.bind.TypeAdapters$28.read(TypeAdapters.java:725)
	at com.google.gson.internal.Streams.parse(Streams.java:49)
	... 8 more

on Ubuntu 22.04

Halleck45 avatar Jun 01 '23 05:06 Halleck45

Hi @Halleck45 , we haven't tested this on Ubuntu - we use Windows and OSX. @breandan may have more luck reproducing the problem. My guess is that Vosk is returning an error message that we've not seen before.

I'm currently working on speech to text using Whisper. For now you could try the idiolect-azure plugin

nalbion avatar Jun 01 '23 06:06 nalbion

Hi,

I have the same issue after installation of idiolect-azure. Plugin is configured and enabled, and speech service is enabled on the Azure portal.

Capture d’écran du 2023-06-01 09-08-45

Halleck45 avatar Jun 01 '23 07:06 Halleck45

I did come across an issue the other day where alternative Speech Recognition providers were not being activated properly. I've just pushed the fix for that to the develop branch. Hopefully I'll have a new release available in the IntelliJ marketplace in about a week with better off-line speech recognition and support for switching between tabs.

nalbion avatar Jun 01 '23 07:06 nalbion

Now with the latest update:

java.lang.AbstractMethodError: Receiver class org.openasr.idiolect.asr.azure.AzureAsr does not define or inherit an implementation of the resolved method 'abstract boolean startRecognition()' of interface org.openasr.idiolect.asr.AsrProvider.
	at org.openasr.idiolect.asr.AsrControlLoop.startRecognition(AsrControlLoop.kt:32)
	at org.openasr.idiolect.asr.AsrService.activate(AsrService.kt:127)
	at org.openasr.idiolect.actions.VoiceRecordControllerAction.actionPerformed(VoiceRecordControllerAction.kt:28)
	at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:228)
	at com.intellij.openapi.actionSystem.impl.ActionButton.lambda$performAction$2(ActionButton.java:207)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:356)
	at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:207)
	at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:518)
	at java.desktop/java.awt.Component.processEvent(Component.java:6421)
	at java.desktop/java.awt.Container.processEvent(Container.java:2266)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2804)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:790)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:731)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:763)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:761)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:760)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:667)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:615)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:570)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:68)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:349)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:348)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:343)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:995)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:995)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$4(IdeEventQueue.kt:343)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:385)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Thanks !

Halleck45 avatar Jun 12 '23 08:06 Halleck45