Question

Alexa Audio Directives

  • 17 November 2017
  • 5 replies
  • 755 views

I'm a developer at a company who has an Alexa skill that supports Alexa's Audio Directive Interface for audio output via supported Echo devices. The device context that gets passed to a skill when a user is using it is quite generic and the _only_ way to know if a device supports audio playback is via the supportedInterfaces object. If the object reports AudioPlayer: {} that means it supports the AudioDirectives and I can feed it an audio stream rather than give the user a graceful failure.

The Sonos One is reporting to skills that it follow the Audio Directive Interface when it in fact ignores audio requests. If a user asks my skill to play something it appears to the end user that it works but no audio actually starts playing from the device. So I don't actually know what kind of device is interacting with my skill outside of the supportedInterfaces object I have no way of gracefully failing in this scenario and telling the user that the current device is unsupported.

Is this intentional?

This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

5 replies

Userlevel 7
Badge +21
I don't work for Sonos, so I can't provide any kind of official feedback... however, Amazon's own Flash Briefing and Sports Update functions used to operate the same (it would appear to work, but no audio would be heard), before they changed the message to say that it doesn't work with this device. So I would imagine that Amazon has some way to determine the device capabilities that isn't yet published, though they (Amazon and/or Sonos) may also be making changes so that it functions in a similar manner to the intended interface. I would imagine that we'll find out when flash briefings start working, which will hopefully be by 11/22.
Unless you work for one of the big speaker manufacturers, you won’t have access to the docs for the AVS Connected Speaker APIs, which Sonos and its rivals are using. I imagine the hooks you need are documented therein.

https://developer.amazon.com/blogs/alexa/post/7c9343ce-425b-4baa-ae63-49c36afb5341/giving-device-makers-more-ways-to-bring-voice-forward-music-experiences-to-their-products
The APIs should be available here https://developer.amazon.com/docs/alexa-voice-service/audioplayer-overview.html

The problem isn't really that they don't support 3rd party audio. The problem is their implementation is telling 3rd party skills that they do and it's causing breaking or unexpected behavior. They need to properly use the `supportedInterfaces` API so skills can gracefully fail on unsupported devices.
From what I've seen, Amazon skills that control Sonos audio do so my taking a command from Alexa and then sending the command to Sonos through Sonos own API. Not surprising, since the Amazon API makes sense. However, I can see why you would want to route back through the new Amazon API, since you won't need to know anything about the speaker being commanded, or maintain anything.

All that said, I get the feeling that the Amazon API is still rather buggy. Maybe on the Amazon side as well as Sonos. Have you gotten your skill to work with non-sonos speakers.
Oh yeah we're in production with a skill that supports Audio Directives. Amazon has done a fairly outstanding job with the Alexa API.