Chime TTS - Play audio before/after TTS audio lag free

That was a good hint. I always used one of the tts models of the drop down list in the GUI. When using tts.google… it worked with my Squeezebox Radio media player. And also with a Sonos Roam. First problem solved.

But, next problem: every attempt with an Alexa echo device resultet in a “having trouble accessing your Simon says EU skill right now” liked mentioned here: Alexa : having trouble accessing your Simon says EU skill right now.

The action / service “notify.alexa_media…” works perfect. But I want an action to reach my Squeezebox, my google device and my alexa devices. Anyone knows how to get my Alexa devices to cooperate? I only have one tts integration: Google translate. Maybe that’s the problem?

Update: I just found that on the chime TTS homepage:
Alexa media_player entities require MP3 files be publicly accessible from outside your local network. If you do not hear playback from Chime TTS on these media players, you may need to ensure that:

  1. Your Home Assistant’s configuration.yaml file includes your external_url. For example:configuration.yaml:
homeassistant:  external_url: "https://YOUR_NABU_CASA_ADDRESS.ui.nabu.casa/"  internal_url: "http://192.168.X.X:8123/"
  1. You have enabled the public facing /www directory.
  2. Your chime_tts.say_url folder exists inside of your /www directory.

So without an external_url there it’s not possible to use Alexa devices then? I have no Nabu Casa subscription.

Happy to hear you got past the first obstacle :+1:

In terms of the Alexa playback issue, have you read the documentation for additional requirements for Alexa devices on the Chime TTS site?

Just updated my message…

That’s correct. Amazon’s Alexa speakers can only play custom sound files that are 1: encoded in a specific way and 2: be externally/publicly accessible on the internet.
This isn’t a Chime TTS or Home Assistant requirement but an Amazon one.

Thank you Nim.
So the Alexa Media Player Integration has found a different way to handle that?

I don’t know for sure but as I understand it, TTS playback is handled differently than playing back a media file.

1 Like

Hey @Nimrod_Dolev , not sure if you recall but I was having issues with volume_level with Sonos speakers. Looks like @matthewcbyington trick to set announce: true seems to remedy the issue. Is it possible to take a closer look at this bug with this new info?

1 Like

Hello. This a great automation! I’m having a problem with the volume on my Amazon Echo Show. In my automation I set the Chime TTS Volume Level to .75 to ensure I can hear the announce regardless of what the volume was previously. However, the volume level doesn’t return to the previous volume setting. How can I return the volume to the previous setting?

Any thoughts? I tried disabling the Volume Level .75, but the volume still gets and stays loud on the echo show.

Is there a way to have 2 mp3 files play then the TTS?

Hi @littlemaui. Yes - you can add multiple MP3 files before the TTS audio by using message segments, to mix & match different TTS and chime audio:

action: chime_tts.say
target:
  entity_id: media_player.kitchen_speaker
data:
  tts_platform: google_translate
  message:
    - chime: drumroll
    - chime: /config/media/sounds/my_chimes/hooray.mp3
    - tts: Welcome home

Thank you. Is there a way to do random mp3’s? I’d like to have 5 or 6 songs to choose from randomly when the doorbell rings for example.

Hi, can I first say Chime TTS is a brilliant addition to Home Assistant? Thanks! It’s saved me a lot of hassle creating some funky announcements.

I’m working on a parameterised script to broadcast a message, over a random reduced volume jingle, to one of my smart speakers.

action: chime_tts.say
metadata: {}
data:
  tts_platform: tts.elevenlabs
  join_players: true
  unjoin_players: true
  announce: true
  cache: true
  fade_audio: false
  volume_level: "{{ volume }}"
  message:
    - chime: >-
        {%- set jingle =
        ("jingle1.mp3","jingle2.mp3","jingle3.mp3") | random
        -%} {{ "/config/clips/" ~ jingle }}
      audio_conversion: Volume 50%
    - tts: It's time for bed, and it's breakfast club before school tomorrow!
      offset: -7000
  voice: Lily
target:
  entity_id:
    - media_player.dining_room

This works great.

The only tweak I’d like to investigate is to try to align the start of the message more precisely with the start of the jingle, ideally two seconds after the jingle begins.

Not all of the jingles are the same length, so the negative offset can result in the message starting earlier or later than intended. Ideally, I’d like to offset from the start of the jingle rather than the end.

Is there an option to do that from within Chime TTS? I’ve looked a little into how to determine the length of the jingle programmatically, and if I can crack that I could calculate the negative offset in real time, but it would be a whole lot simpler just to offset from the start.

I’ve just set up chime to see if I could get “audio ducking” working correctly for my morning wake up call.

I’m using piper, and a Google Home Mini speaker.

I want to start playing a playlist, then say the time, and the weather.

The song just stops when the announcement starts. Then, whenever the announcement is complete, it just skips to the next song in the playlist instead of resuming.

Another thing is that is I can run an announcement while NOT playing any music, but there’s a queue, and it will start playing music once the tts speech is over. That’s annoying.

My original way of doing it was just have piper.tts say my time/weather, wait 25 seconds then start my music. That -usually- is long enough to not interrupt the weather announcement.

So I decided to give chime a try and simplify my automation a bit.

But, as stated above, it no workie.

Thanks, Chuck

Hi @d6mck. Glad to hear you’ve benefitted from the integration :pray:

You can achieve what you’re trying to do by adding a delay segment before your TTS audio. For example, the following YAML will play the jingle audio, and overlay the TTS audio after one second:

action: chime_tts.say
target:
  entity_id: media_player.kitchen
data:
  message:
    - delay: 1000
    - tts: This message played one second after the jingle began playback.
    - chime: https://cdn.pixabay.com/audio/2022/02/26/audio_7797a61d18.mp3
      offset: -1000000

is it possible the default and fallback provider function would do this?