[Course] Project 3: Build a Podcast Player


#1

Welcome to our third project-based course about voice app development. In previous courses, we already learned some of the basics of building Alexa Skills and Google Actions. After an initial setup in Project 1: Hello World, we looked at some more advanced routing in Project 2: Adventure Game.


This is a companion discussion topic for the original entry at https://www.jovo.tech/courses/project-3-podcast-player

#2

Another great tutorial! :smile:

Here are a few minor things I noticed

  • Some of the example track URLs are missing .mp3 which causes them to fail to play.

  • The line explaining offset has an inaccurate conversion from milliseconds to seconds.

  • "AMAZON.StopIntent": "CancelIntent" should be "AMAZON.StopIntent": "AMAZON.CancelIntent"

Jovo Debugger doesnā€™t work as intended for Google Assistant

When I test the code at the end of Step 2 in the debugger as Google Assistant, when the first track ends, the LAUNCH intent is triggered instead of the GoogleAction.Finished intent. So, the next track does not play. Instead the action restarts.

When I test in the Actions on Google simulator at the end of Step 3, it DOES go to the next track as expected, however, instead of just Enjoy, it responds with: EnjoySorry, something went wrong. When you're ready, give it another try.

Alexa Playback Finished Inconsistent

Testing on alexa device triggers AUDIOPLAYER.AlexaSkill.PlaybackFinished

Testing on Jovo Debugger triggers AUDIOPLAYER.AlexaSkill.Finished

Testing Previous doesnā€™t work on Google Home Hub device or Action on Google Simulator with Smart Screen selected

Testing on Actions on Google Simulator with Phone selected works as expected when saying ā€œpreviousā€. However, in Smart Screen mode it gives this error:


You cannot use standard Google Assistant features in the Simulator. If you want to try them, use Google Assistant on your phone or other compatible devices.

When trying on Google Home Hub device, no intent is reported in the logs or jovo debugger, but the current audio track restarts.

Oddly, saying ā€œnextā€ works as expected. However, this seems to be because GoogleAction.Finished is triggered, NOT NextIntent.


#3

@curiousdustin since you mentioned it, I am having issues with AMAZON.CancelIntent, changed the mapping config as suggested above by nothing seem to work, also stop and pause in jovo debuger do not work. you still having such issues?

Thank you


#4

No, the above change fixed the cancel behavior for me.


#6

Offset and resume not work


#7

In step 7 when I try to update the language model with the model in the course Iā€™m stuck when I try to deploy. The error is ā€œCannot read property ā€˜languageModelā€™ of undefinedā€.


#8

Hello there. Thanks a lot for developing this course. It helped me a lot. I have one question. Will the next episode play on its own after current episode is over?

Thanks.


#9

Hello, Iā€™m trying to use AMAZON.PauseIntent and AMAZON.ResumeIntent after step 4, but it doesnā€™t work. After clicking the PauseIntent request button in the jovo debugger nothing will happen (response type: ā€œAudioPlayer.Stopā€ but the episode is still playing and AlexaSkill.PlaybackStopped was not called. Offset in db = 0). So AMAZON.ResumeIntent did not have a valid offset value.
Code copied from the course - I still have the same problemā€¦


#10

Hi! Playback functionalities are best tested on an actual Alexa device. Could you try there and see if it works?

Does it work in the debugger if you click the pause button in the play widget?


#11

At the moment I only have the Jovo debugger or Alexa Developer Portalā€¦
If I click the pause button in the play widget, the episode stops and I get AlexaSkill.PlaybackStopped:

    "request": {
     "type": "AudioPlayer.PlaybackStopped",
     "requestId": "amzn1.echo-api.request.0000000-0000-0000-0000-00000000000",
     "timestamp": "2020-04-08T16:12:29.757Z",
     "locale": "en-US",
     "token": "silence",
     "offsetInMilliseconds": 20460
     }

But in the database, the shift does not change.

    {
    "currentEpisode": "..."
    "offset": 0,
    "nextEpisode": "..."
    }

When I use ResumeIntent, the episode plays at an offset = 0, but when I click Play on the widget, the episode plays normally.


#12

Does it make difference to have separate files under Alexa/hendler.js & Actions/handler.js, in the Git example AUDIOPLAYER intents are return in handlers where as here its in app.js. Apart from clean code are their any other benefit, because the filedb canā€™t be accessed under handler.js those steps are not working.


#13

Yes, the main reason for separating the handler (as longer as it gets) into separate files is cleaner code.

As discussed in the other forum thread, the File DB (or any other integration using the Jovo this context) can be accessed from any other file, as long as itā€™s referenced in the right way.


#14

After a calling a this.$googleAction.$mediaResponse.play() the GoogleAction.Finished gets called but after several minutes of complete silence. What could be the issue?


#16

Iā€™m currently working on
https://www.jovo.tech/courses/project-3-podcast-player/step-2-stream-multiple-files#playbacknearlyfinished

The second URI is missing the .mp3 suffix. (Though fixing that wasnā€™t a complete solution; Iā€™m still not advancing automatically to the queued episode.) The missing suffix was mentioned by curiousdustin back in May '19ā€¦ and the online doc is still not fixed?

I have a branched-and-patched version of the doc source. Whatā€™s Jovoā€™s preferred process for me to submit a pull request? Is there a Jira (or other) tracking ticket open on this?

I need to learn about jovo logging, clearly. Iā€™d hope file-not-found would show up there. This also points out that when coding network actions, ALWAYS be prepared for the possibility that they will fail (either hard or soft failure) and handle that gracefully; the server may be down or slow, the network may be down or slow, the resource may have been moved somewhere elseā€¦ A robust app has to be able to tell the user ā€œI canā€™t get that right nowā€ and at least offer the option of retrying or trying something else.


#17

Thanks! Feel free to submit a PR here, thanks for your contribution https://github.com/jovotech/learn-jovo/tree/master/courses/project-3-podcast-player


#18

Just sanity check: Youā€™re using the approach of having us create forks to be merged from, rather than branches, right? (Iā€™m more used to working with branches, but can adapt.)


#19

Yes, a PR from a fork is perfect :slight_smile: Thank you


#20

Still trying to figure out why the simple Step 2 player doesnā€™t advance to episode 55 after playing 56. I see the events appear in the debugger, but playback of 55 does not start as expected.

There were comments in the past that the debugger may not work well with audio playback, so Iā€™m starting to think I should try it on my ā€œrealā€ Alexa. Step 3 describes enabling the audio interface and making sure the ASK CLI is configured, but does not actually say how to publish/activate the app on our Alexa account. Iā€™m guessing you covered this in previous courses, and are assuming we already went through those. But for those of us trying to skip ahead to the functionality we actually want to use (or who may not remember the details) itā€™d be Really Helpful if the doc said something like ā€œThen upload and invoke the player as described in ā€¦ā€

If someone has that pointer handy, Iā€™d appreciate it; otherwise I guess I go digging.

Iā€™m guessing that what I want is jovo deploy. That takes a surprisingly long time to run, but does eventually complete. However, when I try to test it in the Alexa developer console, it tells me Enjoy but pops up the error
Unsupported Directive AudioPlayer is currently an unsupported namespace. Check the device log for more information.

Obviously Iā€™m still missing somethingā€¦?


#21

So it shows the next episode as bot response, but the Debugger doesnā€™t play it?

I always recommend to do additional testing on Alexa. The Debugger just mocks request JSONs and can be seen as ā€œdry runā€ to test the logic. For the actual behavior, itā€™s recommended to test on an actual device.

And yes, the right way to go is using jovo deploy. Seems like there is a problem with the language model, are you using this one? https://github.com/jovotech/jovo-templates/blob/master/podcast-player/javascript/models/en-US.json

Unfortunately, the Alexa simulator doesnā€™t support AudioPlayer requests. Do you have a physical device you can test this on?


#22

Yes, I have physical devices. Of course having to go to those defeats the purpose of both the simulator and the debugger, right?

Can we get the debugger fixed to actually run the course examples? Is there a logfile I can submit that would help you do so? (At some point I may have to dive into the Jovo code myself, but I was hoping to avoid that until after Iā€™d gotten my first app running and had a sense of how the system was supposed to behave.)