sevenlayercookie / abs-alexa

Alexa Skill for interfacing with Audiobookshelf
2 stars 0 forks source link

Alexa Fails to Play Audiobook via Skill 😭 #1

Closed Metimol1 closed 4 days ago

Metimol1 commented 5 days ago

Issue: Alexa Fails to Play Audiobook via Skill

Description

Thank you for creating this skill! I have been looking forward to such functionality for a long time. However, Alexa cannot play my audiobook. Instead, she responds with the following message:

"There was a problem with the requested skill response."

I have reviewed the server logs, which I am including below for your reference.

Server Logs

2024-11-27T21:09:31.839Z
INIT_START Runtime Version: nodejs:16.v64   Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:[redacted]

2024-11-27T21:09:33.096Z
START RequestId: 2f78aecb-c040-4667-866e-[redacted] Version: 4

2024-11-27T21:09:33.111Z
INFO ~~~ LOGGED AT END OF LaunchRequestHandler 

2024-11-27T21:09:33.130Z
END RequestId: 2f78aecb-c040-4667-866e-[redacted]
REPORT RequestId: 2f78aecb-c040-4667-866e-[redacted] Duration: 34.11 ms Billed Duration: 35 ms Memory Size: 512 MB Max Memory Used: 104 MB Init Duration: 1254.11 ms    

2024-11-27T21:09:48.068Z
START RequestId: f798cb44-2941-4ea2-8113-[redacted] Version: 4

2024-11-27T21:09:51.348Z
INFO Response {
  statusCode: 200,
  headers: { [redacted] },
  url: '[redacted]'
}

2024-11-27T21:09:51.351Z
INFO Playing: [redacted]

2024-11-27T21:09:51.429Z
END RequestId: f798cb44-2941-4ea2-8113-[redacted]
REPORT RequestId: f798cb44-2941-4ea2-8113-[redacted] Duration: 3361.26 ms Billed Duration: 3362 ms Memory Size: 512 MB Max Memory Used: 116 MB

2024-11-27T21:02:55.450Z
ERROR Error during SessionEndedRequestHandler: TypeError: Cannot read properties of undefined (reading 'startOffset')
    at calculateCurrentTime (/var/task/index.js:177:34)
    at Object.handle (/var/task/index.js:2842:31)
    at GenericHandlerAdapter.execute (/var/task/node_modules/ask-sdk-runtime/dist/dispatcher/request/handler/GenericHandlerAdapter.js:25:24)
    at GenericRequestDispatcher.dispatchRequest (/var/task/node_modules/ask-sdk-runtime/dist/dispatcher/GenericRequestDispatcher.js:95:38)
    at async GenericRequestDispatcher.dispatch (/var/task/node_modules/ask-sdk-runtime/dist/dispatcher/GenericRequestDispatcher.js:45:22)
    at async CustomSkill.invoke (/var/task/node_modules/ask-sdk-core/dist/skill/CustomSkill.js:68:26)

2024-11-27T21:02:55.489Z
INFO ~~~~ Error handled: {}

I changed all confidential information to [redacted] just in case 😊

The link to the RSS channel is generated, then the link to the chapter is generated. I checked this, opened the links through the browser. All mp3 files created for Alexa were easily opened and played in the browser.

sevenlayercookie commented 4 days ago

Audiobookshelf had some API changes that broke ABS-Alexa, plus I had an error with handling float values. I've corrected those issues. Try giving it another shot.

It almost looks like the Alexa Session is ending prematurely -- I've added extra logging to print the "reason" for termination if it continues to happen.

Metimol1 commented 4 days ago

Everything works. Thank you so much ❤️🔥

Thanks to your project my dream came true and I can listen to my audiobooks from my raspberry pi 4 on Alexa 😍

sevenlayercookie commented 4 days ago

Thanks for the feedback! I'm glad it's working for you. I hadn't heard from anyone else if they had gotten it to work or not, so it's nice to hear that someone else is getting some use out of it as well