question

newuser-8db982a8-8367-4303-a6d5-d10866cf7c75 avatar image

Cannot create AudioDevice

ERROR com.amazon.alexa.avs.AVSAudioPlayer - An error occurred while trying to play audio javazoom.jl.decoder.JavaLayerException: Cannot create AudioDevice at javazoom.jl.player.FactoryRegistry.createAudioDevice(FactoryRegistry.java:97) ~[jlayer-1.0.1.jar:?] at javazoom.jl.player.Player.<init>(Player.java:97) ~[jlayer-1.0.1.jar:?] at javazoom.jl.player.Player.<init>(Player.java:82) ~[jlayer-1.0.1.jar:?] at com.amazon.alexa.avs.AVSAudioPlayer$5.run(AVSAudioPlayer.java:837) [classes/:?]

alexa voice servicedevices
10 |5000

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

Nick_s@Amazon avatar image
Nick_s@Amazon answered

It looks like the application is unable to use the speaker on your device. In order to help diagnose, would you be able to provide the device type and OS where you're running the java client?

10 |5000

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

dlan avatar image
dlan answered

hello, I'm just encountering the same issue, any idea why?

here is full java backtrace,

btw, I'm using pulseaudio here, and I've tested with 'parecord' (to record the sound), then have no problem to play it back with 'paplay'

$ mvn exec:exec [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Alexa Voice Service Sample Java Client 20160207.2 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- exec-maven-plugin:1.2.1:exec (default-cli) @ sample-java-client --- 17:25:49.526 [AWT-EventQueue-0] ERROR com.amazon.alexa.avs.AVSApp - An error occured creating speech request java.lang.NullPointerException at com.amazon.alexa.avs.AVSController.getMicrophoneInputStream(AVSController.java:304) ~[classes/:?] at com.amazon.alexa.avs.AVSController.startRecording(AVSController.java:282) [classes/:?] at com.amazon.alexa.avs.AVSApp$3.actionPerformed(AVSApp.java:265) [classes/:?] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) [?:1.8.0_112] at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) [?:1.8.0_112] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) [?:1.8.0_112] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) [?:1.8.0_112] at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) [?:1.8.0_112] at java.awt.Component.processMouseEvent(Component.java:6533) [?:1.8.0_112] at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) [?:1.8.0_112] at java.awt.Component.processEvent(Component.java:6298) [?:1.8.0_112] at java.awt.Container.processEvent(Container.java:2236) [?:1.8.0_112] at java.awt.Component.dispatchEventImpl(Component.java:4889) [?:1.8.0_112] at java.awt.Container.dispatchEventImpl(Container.java:2294) [?:1.8.0_112] at java.awt.Component.dispatchEvent(Component.java:4711) [?:1.8.0_112] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) [?:1.8.0_112] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) [?:1.8.0_112] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) [?:1.8.0_112] at java.awt.Container.dispatchEventImpl(Container.java:2280) [?:1.8.0_112] at java.awt.Window.dispatchEventImpl(Window.java:2746) [?:1.8.0_112] at java.awt.Component.dispatchEvent(Component.java:4711) [?:1.8.0_112] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) [?:1.8.0_112] at java.awt.EventQueue.access$500(EventQueue.java:97) [?:1.8.0_112] at java.awt.EventQueue$3.run(EventQueue.java:709) [?:1.8.0_112] at java.awt.EventQueue$3.run(EventQueue.java:703) [?:1.8.0_112] at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_112] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) [?:1.8.0_112] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) [?:1.8.0_112] at java.awt.EventQueue$4.run(EventQueue.java:731) [?:1.8.0_112] at java.awt.EventQueue$4.run(EventQueue.java:729) [?:1.8.0_112] at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_112] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) [?:1.8.0_112] at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) [?:1.8.0_112] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) [?:1.8.0_112] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [?:1.8.0_112] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [?:1.8.0_112] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:1.8.0_112] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [?:1.8.0_112] at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [?:1.8.0_112] 17:25:49.540 [Thread-16] ERROR com.amazon.alexa.avs.AVSAudioPlayer - An error occurred while trying to play audio javazoom.jl.decoder.JavaLayerException: Cannot create AudioDevice at javazoom.jl.player.FactoryRegistry.createAudioDevice(FactoryRegistry.java:97) ~[jlayer-1.0.1.jar:?] at javazoom.jl.player.Player.(Player.java:97) ~[jlayer-1.0.1.jar:?] at javazoom.jl.player.Player.(Player.java:82) ~[jlayer-1.0.1.jar:?] at com.amazon.alexa.avs.AVSAudioPlayer$5.run(AVSAudioPlayer.java:918) [classes/:?] Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at com.amazon.alexa.avs.AVSController.stopRecording(AVSController.java:550) at com.amazon.alexa.avs.AVSApp$3.actionPerformed(AVSApp.java:271) 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$3$1.onRequestError(AVSApp.java:261) at com.amazon.alexa.avs.AVSController.startRecording(AVSController.java:289) at com.amazon.alexa.avs.AVSApp$3.actionPerformed(AVSApp.java:265) 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:6533) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6298) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4711) 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:2746) at java.awt.Component.dispatchEvent(Component.java:4711) 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:80) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) 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:80) 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)

10 |5000

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

Sanjay avatar image
Sanjay answered

Hey Dlan,

Could you provide the device type and OS that you're running the java client on?

Thanks,

Sanjay

10 |5000

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

newuser-d7895b11-e4d9-431e-b13b-ff4fc1e8de41 avatar image
newuser-d7895b11-e4d9-431e-b13b-ff4fc1e8de41 answered

Also have this exact issue

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Alexa Voice Service Sample Java Client 20160207.6
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- exec-maven-plugin:1.2.1:exec (default-cli) @ sample-java-client ---
23:24:29.281 [Thread-28] ERROR com.amazon.alexa.avs.AVSAudioPlayer - An error occurred while trying to play audio
javazoom.jl.decoder.JavaLayerException: Cannot create AudioDevice
	at javazoom.jl.player.FactoryRegistry.createAudioDevice(FactoryRegistry.java:97) ~[jlayer-1.0.1.jar:?]
	at javazoom.jl.player.Player.<init>(Player.java:97) ~[jlayer-1.0.1.jar:?]
	at javazoom.jl.player.Player.<init>(Player.java:82) ~[jlayer-1.0.1.jar:?]
	at com.amazon.alexa.avs.AVSAudioPlayer$5.run(AVSAudioPlayer.java:932) [classes/:?]
23:24:41.724 [Thread-29] ERROR com.amazon.alexa.avs.AVSAudioPlayer - An error occurred while trying to play audio
javazoom.jl.decoder.JavaLayerException: Cannot create AudioDevice
	at javazoom.jl.player.FactoryRegistry.createAudioDevice(FactoryRegistry.java:97) ~[jlayer-1.0.1.jar:?]
	at javazoom.jl.player.Player.<init>(Player.java:97) ~[jlayer-1.0.1.jar:?]
	at javazoom.jl.player.Player.<init>(Player.java:82) ~[jlayer-1.0.1.jar:?]
	at com.amazon.alexa.avs.AVSAudioPlayer$5.run(AVSAudioPlayer.java:932) [classes/:?]

Raspberry Pi 3

Rasbian Jessie

Follow instructions here exactly: https://github.com/alexa/alexa-avs-sample-app/wiki/Raspberry-Pi

The instructions at that url do not work. I've tried start to finish 3 times. Please fix.

10 |5000

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