Skip to content

Support for custom audio (MP3) files #3163

Description

@Steveiwonder

I'm trying to play short custom MP3 clips (hosted by Home Assistant) on
my Echo devices from automations via alexa_media_player.

Right now this is quite confusing and fragile:

  • Using media_player.play_media with media_content_type: "music"
    causes Alexa to respond with "Direct music streaming isn't
    supported"
    .
  • Using notify.alexa_media with SSML <audio src="..."> and
    type: tts works only if I manually build a fully public, SSL URL
    that Amazon's cloud can reach (e.g. via Nabu Casa), and even then
    the YAML structure is easy to get wrong and error messages are not
    very clear.
  • From the HA side it looks like I should be able to play a local
    /local/foo.mp3 the same way I can with Google/Chromecast, but
    Alexa's restrictions and the extra URL requirements aren't obvious.

The end result is: I'm always fighting the integration just to play a
simple "alert" sound MP3 for my automations, and it's not obvious what
is actually supported vs. blocked by Alexa.


Describe the solution you'd like

I'd love a first-class way in Alexa Media Player to play short custom
MP3s
that are already in Home Assistant's /local (or media) folder,
without having to hand-craft SSML and external URLs.

Concretely, something like:

  • A dedicated service or notification type (e.g. type: sound or
    type: mp3) that:
    • Accepts either a local path (/local/my_file.mp3 or a media
      source) or a relative filename.
    • Automatically rewrites this to an Alexa-compatible, publicly
      reachable URL (using the configured external URL / Nabu Casa
      URL).
    • Wraps it in the correct SSML <audio src="..."/> and uses the
      right notify.alexa_media semantics under the hood.
  • Clear handling of "what Alexa can/can't do" for custom audio.
  • A simple documented example.

Describe alternatives you've considered

  • Plain TTS via type: tts (Alexa voice only).
  • Amazon built-in sound library (amzn_sfx_...).
  • media_player.play_media with local MP3 URL (results in error).
  • Third-party services like VoiceMonkey.
  • Writing a custom Alexa Skill.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions