A glimpse under the hood of “Alexa, play Morning Edition”

Nara Kasbergen
Technology at NPR
Published in
7 min readSep 4, 2019

--

This morning, we announced the launch of “Alexa, play Morning Edition”, a new way to listen to NPR content on your Amazon Echo and other Alexa-enabled devices. Previously, we launched “Alexa, play NPR” as an entry-point into our member stations' live streams, an NPR One skill that extends the beloved mobile app experience to voice platforms, and collaborated with VaynerSmart (VaynerMedia’s internet of things division) to bring you Wait Wait Quiz, an interactive game inspired by the popular radio show. With Morning Edition in the mix, we're excited to give our users yet another way to experience NPR content, allowing them to more closely tailor their listening habits to their lifestyle and news consumption needs.

As the technical lead for voice and emerging platforms here at NPR, I wanted to offer a few glimpses under the hood of this new feature and elaborate on the reasons why I thought this project was so exciting.

First, the ability for us to make Morning Edition available on-demand was no small feat. Morning Edition is not like our podcasts because it's designed to be a mix of national and local stories; some segments are produced by our reporters at our headquarters here in DC and at bureaus around the world, while others are produced by your local member station and included in the broadcast at designated intervals throughout the show. We'd intentionally never made Morning Edition available on-demand before because we couldn't figure out how to digitally reproduce a faithful version of the program with local segments included, which would've essentially involved creating 300 or so versions of Morning Edition at any given time. The technology to do that didn't seem to exist, and we didn't have the resources to build it ourselves.

But it turns out that this technology does exist! It's called Omny Studio, and it's a SaaS product built by a startup based out of Melbourne, Australia that was recently acquired by Triton Digital, the global podcasting powerhouse. (You can read more about Omny's story here.) Their easy-to-use, easy-to-configure platform allows us to take our member stations' existing live streams and create recordings of them at specified times — say, 7am to 8am on weekdays, one of the hours when Morning Edition airs in nearly all markets. Once this is configured in their UI (which is intended to be a set-it-and-forget-it process), Omny Studio produces an RSS feed that is automatically updated to include an mp3 of the latest hour of the show, which becomes available within five minutes of that hour's broadcast ending. All our Alexa skill has to do is check the RSS feed associated with the designated NPR member station, find the enclosure URL which represents the location of the mp3, and then use Alexa's built-in AudioPlayer interface to start playback of that file. Easy!

A screenshot of the omnystudio.com interface, using KUOW's broadcast of Morning Edition as an example.

So, that solved the problem of making 300-or-so versions of Morning Edition available to our listeners. But how does a user choose which of these 300-or-so versions to listen to? To answer that question, it's easiest to take a step back and talk a little bit more about how this project began.

When our team was first presented with the idea of making a localized, on-demand version of Morning Edition available for voice platforms, and the invocation phrase had to be “Alexa, play Morning Edition”, we figured that meant that we had to build yet another standalone custom skill. While we didn't object to that outright, we did have concerns that yet another custom skill meant a fairly sharp increase in the maintenance burden for our team: another skill means another code repository that requires periodic SDK upgrades, a thorough suite of unit tests, a working CI/CD pipeline, and good documentation, all of which require regular time and attention, or else tech debt starts to accumulate. As a tech lead, raising awareness about these issues is one of my core responsibilities because stakeholders rarely remember that launching a new product means more than just the initial development cost.

But as our team researched our users' needs and worked through the UX flows of the new skill, we started thinking through the experience for listeners who already use NPR's other skills for Alexa. We realized how much of a burden it would be for them to have to go through the dialogue steps required to choose an NPR member station again (since there is no way to share data or persist user settings across multiple skills without requiring login, something we did not want to have to do). And we recognized that there would be added user value in automatically taking listeners into their station's live stream after they're done listening to the last hour of Morning Edition. The more we talked, the more we felt like the ideal approach would be to build the on-demand Morning Edition experience into the existing “Alexa, play NPR” skill as a feature, rather than building it as a standalone custom skill.

And so, that's what we did! Thanks to a collaboration with Amazon, the invocation “Alexa, play Morning Edition” is just an alias for “Alexa, ask NPR to play Morning Edition”, which is powered by a PlayMorningEditionIntent in our existing NPR skill. Both station streaming and the on-demand Morning Edition experience live in a single codebase, significantly reducing the maintenance burden for our team. And our users benefit because whether they say “Alexa, play NPR” or “Alexa, play Morning Edition”, they only need to choose a member station once, after which that setting will be persisted across both experiences. In fact, anyone who already used the NPR skill to listen to a live stream in the past won't have to choose a station at all (as long as their member station broadcasts Morning Edition and has opted-in to making it available on voice platforms); they can start listening to Morning Edition right away.

Finally, one reason I'm thrilled about this launch is because as part of this project, we managed to remove one other major source of technical debt. Up until about two months ago, our “play NPR” skill was still on v1 of the Alexa Skills Kit SDK. This doesn't seem to be common knowledge for folks who don't work in the voice space, but the team at Amazon released v2 of the ASK SDK in May 2018, and it was a from-the-ground-up-rewrite not unlike what happened with AngularJS & Angular 2. Given the fact that v2 has been out for more than a year, it was high time for us to upgrade, but we were struggling to find a space for the work on our roadmap. After all, this is every stakeholder's least favorite kind of tech debt: the kind where you have to set everything aside to get something done for a month, and in the end there's no new features or direct user benefit; everything works exactly the same way it did before. It's a tough sell.

While there was no immediate technical reason why we needed to upgrade to v2 for this project — everything we did, we could have accomplished using v1 of the SDK — we managed to convince our stakeholders that given the fact that we were building the on-demand Morning Edition experience into the existing skill as a feature, we would ultimately save the team time by upgrading to v2 first. After all, a new feature means additional code that would need to be migrated and regression-tested… versus if we could just build the new feature using v2 immediately and only test it once. So, before we wrote even a single line of code related to Morning Edition, we upgraded the existing skill to v2, regression-tested it, and taking a lesson from the NPR One skill (which we had upgraded to v2 of the SDK back in March, as part of a new feature release there), put those changes through Alexa's certification process and made them live to users. The v2 SDK upgrade went live back in July without a hiccup. And after that, implementing the new Morning Edition feature was smooth sailing.

It's not often that you can say that you launched a new “product” and actually ended up with less technical debt than you started with, so this tech lead is very, very happy. 🙂

I want to take a moment to recognize my team and thank them for all their hard work. Bina Zafar (senior developer) was brand new to Alexa development, yet wrote almost every single line of code powering this new feature. Greg Sauer (QA specialist) and Will Mitchell (audio engineer) painstakingly tested hundreds of station streams multiple times before launch to ensure the experience was polished. Rebecca Rolfe (designer) graciously worked through many changes to the UX flow with us as we started butting into platform limitations. Dan Frohlich (subject matter expert) fine-tuned a thorough analytics plan and similarly accommodated our technical limitations. Anne Li (subject matter expert) was an invaluable resource in helping us understand the editorial team's needs and perspectives. Rakiesha Chase (subject matter expert) anchored us with her treasure trove of knowledge regarding our member stations. Ha-Hoa (product manager) juggled complicated stakeholder conversations throughout the organization and never once led us astray. And last but never least, Tracie Davis (scrum master) ensured our meetings were efficient and productive and always made sure there were snacks for our 5pm calls with the Omny team in Australia.

I hope you all enjoy Morning Edition on Alexa, and please let us know what you think of the experience!

Editor’s note: NPR decided to sunset the Morning Edition on-demand initiative on October 1, 2020. When listeners say “Alexa, play Morning Edition,” they will hear a message that it is no longer available and be redirected to the live Member station stream. As no experiment comes with a guarantee of success, we still came away with valuable insights that will help us continue to build and refine our efforts to bring public radio — and our local/national partnership — into the on-demand space.

--

--

🇳🇱🇮🇩🇨🇳 immigrant married to a 🇰🇷🇺🇸. She/her. INFP. Eng manager looking for a new adventure. Mental health advocate. Foodie. Gamer. ❤️: 💅🏻🍷 & 🐧