question

Srikanth avatar image
Srikanth asked

Unable to configure Amazon Alexa Voice API in Raspberry Pi

Hi, Am following below link to configure alexa Voice API on Raspberry pi. However am seeing an error while trying to start listening. Can you please help with the same. https://github.com/amzn/alexa-avs-raspberry-pi com.amazon.alexa.avs.AVSApp - An error occured creating speech request java.lang.NullPointerException at com.amazon.alexa.avs.AudioCapture.startCapture(AudioCapture.java:74) ~[classes/:?] at com.amazon.alexa.avs.AudioCapture.getAudioInputStream(AudioCapture.java:56) ~[classes/:?] at com.amazon.alexa.avs.AVSController.startRecording(AVSController.java:167) [classes/:?] at com.amazon.alexa.avs.AVSApp$2.actionPerformed(AVSApp.java:204) [classes/:?] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) [?:1.8.0_77] at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) [?:1.8.0_77] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) [?:1.8.0_77] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) [?:1.8.0_77] at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) [?:1.8.0_77] at java.awt.Component.processMouseEvent(Component.java:6535) [?:1.8.0_77] at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) [?:1.8.0_77] at java.awt.Component.processEvent(Component.java:6300) [?:1.8.0_77] at java.awt.Container.processEvent(Container.java:2236) [?:1.8.0_77] at java.awt.Component.dispatchEventImpl(Component.java:4891) [?:1.8.0_77] at java.awt.Container.dispatchEventImpl(Container.java:2294) [?:1.8.0_77] at java.awt.Component.dispatchEvent(Component.java:4713) [?:1.8.0_77] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) [?:1.8.0_77] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) [?:1.8.0_77] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) [?:1.8.0_77] at java.awt.Container.dispatchEventImpl(Container.java:2280) [?:1.8.0_77] at java.awt.Window.dispatchEventImpl(Window.java:2750) [?:1.8.0_77] at java.awt.Component.dispatchEvent(Component.java:4713) [?:1.8.0_77] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) [?:1.8.0_77] at java.awt.EventQueue.access$500(EventQueue.java:97) [?:1.8.0_77] at java.awt.EventQueue$3.run(EventQueue.java:709) [?:1.8.0_77] at java.awt.EventQueue$3.run(EventQueue.java:703) [?:1.8.0_77] at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_77] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) [?:1.8.0_77] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) [?:1.8.0_77] at java.awt.EventQueue$4.run(EventQueue.java:731) [?:1.8.0_77] at java.awt.EventQueue$4.run(EventQueue.java:729) [?:1.8.0_77] at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_77] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) [?:1.8.0_77] at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) [?:1.8.0_77] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) [?:1.8.0_77] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [?:1.8.0_77] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [?:1.8.0_77] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:1.8.0_77] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [?:1.8.0_77] at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [?:1.8.0_77] Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at com.amazon.alexa.avs.AudioCapture.stopCapture(AudioCapture.java:68) at com.amazon.alexa.avs.AVSController.stopRecording(AVSController.java:355) at com.amazon.alexa.avs.AVSApp$2.actionPerformed(AVSApp.java:209) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.AbstractButton.doClick(AbstractButton.java:376) at javax.swing.AbstractButton.doClick(AbstractButton.java:356) at com.amazon.alexa.avs.AVSApp$2$1.onRequestError(AVSApp.java:199) at com.amazon.alexa.avs.AVSController.startRecording(AVSController.java:175) at com.amazon.alexa.avs.AVSApp$2.actionPerformed(AVSApp.java:204) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6535) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6300) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4891) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4713) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) at java.awt.Container.dispatchEventImpl(Container.java:2280) at java.awt.Window.dispatchEventImpl(Window.java:2750) at java.awt.Component.dispatchEvent(Component.java:4713) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) 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) Thanks, Srikanth
alexa voice service
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Eric@Amazon avatar image
Eric@Amazon answered
It appears that the app cannot find your microphone. Try configuring Raspberry Pi settings until it correctly recognizes your mic.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mark Stringer avatar image
Mark Stringer answered
Does running this command: arecord -l show your microphone like this? The AK5370 is the model of my Logitech mic so may differ for you. $ arecord -l **** List of CAPTURE Hardware Devices **** card 1: AK5370 [AK5370], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 I have had issues with having to change the default device back and forth for some reason. See my earlier thread about the microphone stopping working. This file should also show your card: $ cat /proc/asound/cards 0 [ALSA ]: bcm2835 - bcm2835 ALSA bcm2835 ALSA 1 [AK5370 ]: USB-Audio - AK5370 AKM AK5370 at usb-3f980000.usb-1.5, full speed
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.