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

It looks like this, so the same apart from the chime TTS mp3s URL option.
I tried to amend it to include the “/config/”, but when I save, it switches it back!

Chime SAY works but Chime Say URL does not. But the logs are misleading because they say things are being saved which are not.

Working:

2024-03-25 15:44:08.690 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called. Version v0.13.1-beta13 -----
2024-03-25 15:44:08.691 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-03-25 15:44:08.691 DEBUG (MainThread) [custom_components.chime_tts.helpers] ``` is_say_url = False
2024-03-25 15:44:08.693 DEBUG (MainThread) [custom_components.chime_tts.helpers] ----- General Parameters -----
2024-03-25 15:44:08.693 DEBUG (MainThread) [custom_components.chime_tts.helpers] * entity_ids = ['media_player.vlc_telnet']
2024-03-25 15:44:08.693 DEBUG (MainThread) [custom_components.chime_tts.helpers] * cache = False
2024-03-25 15:44:08.694 DEBUG (MainThread) [custom_components.chime_tts.helpers] * offset = 450.0
2024-03-25 15:44:08.694 DEBUG (MainThread) [custom_components.chime_tts.helpers] * final_delay = 0.0
2024-03-25 15:44:08.694 DEBUG (MainThread) [custom_components.chime_tts.helpers] * message = Shamone!
2024-03-25 15:44:08.694 DEBUG (MainThread) [custom_components.chime_tts.helpers] * tts_platform = google_translate
2024-03-25 15:44:08.694 DEBUG (MainThread) [custom_components.chime_tts.helpers] * tts_playback_speed = 100.0
2024-03-25 15:44:08.695 DEBUG (MainThread) [custom_components.chime_tts.helpers] * announce = False
2024-03-25 15:44:08.695 DEBUG (MainThread) [custom_components.chime_tts.helpers] * volume_level = -1.0
2024-03-25 15:44:08.695 DEBUG (MainThread) [custom_components.chime_tts.helpers] * join_players = False
2024-03-25 15:44:08.695 DEBUG (MainThread) [custom_components.chime_tts.helpers] * unjoin_players = False
2024-03-25 15:44:08.698 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters:
2024-03-25 15:44:08.698 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = 'google_translate'
2024-03-25 15:44:08.698 DEBUG (MainThread) [custom_components.chime_tts] * message = 'Shamone!'
2024-03-25 15:44:08.699 DEBUG (MainThread) [custom_components.chime_tts] * tts_playback_speed = 100.0
2024-03-25 15:44:08.699 DEBUG (MainThread) [custom_components.chime_tts] * cache = False
2024-03-25 15:44:08.699 DEBUG (MainThread) [custom_components.chime_tts] * language = 'None'
2024-03-25 15:44:08.699 DEBUG (MainThread) [custom_components.chime_tts] * options = {}
2024-03-25 15:44:09.367 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio completed in 668.8570000000001 ms
2024-03-25 15:44:09.367 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /media/sounds/temp/chime_tts/...
2024-03-25 15:44:09.555 DEBUG (MainThread) [custom_components.chime_tts.helpers] - File saved to path: /media/sounds/temp/chime_tts/_jvu5x_c.mp3
2024-03-25 15:44:09.555 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated: {'audio_duration': 1.152, 'local_path': '/media/sounds/temp/chime_tts/_jvu5x_c.mp3', 'public_path': None}
2024-03-25 15:44:09.556 DEBUG (MainThread) [custom_components.chime_tts] - 1 Standard media player detected. Calling `media_player.play_media` service
2024-03-25 15:44:09.556 DEBUG (MainThread) [custom_components.chime_tts] Calling media_player.play_media with data:
2024-03-25 15:44:09.556 DEBUG (MainThread) [custom_components.chime_tts] - media_content_type: music
2024-03-25 15:44:09.556 DEBUG (MainThread) [custom_components.chime_tts] - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/_jvu5x_c.mp3
2024-03-25 15:44:09.556 DEBUG (MainThread) [custom_components.chime_tts] - entity_id: ['media_player.vlc_telnet']
2024-03-25 15:44:09.557 DEBUG (MainThread) [custom_components.chime_tts] Waiting 1.152s for audio playback to complete...
2024-03-25 15:44:10.719 DEBUG (MainThread) [custom_components.chime_tts.helpers] - Waiting until media_player.vlc_telnet is no longer = playing...
2024-03-25 15:44:14.948 DEBUG (MainThread) [custom_components.chime_tts.helpers] ...media_player.vlc_telnet is now idle
2024-03-25 15:44:14.949 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Completed in 6257.627 ms -----

Not working:-

2024-03-25 15:47:08.912 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say URL Called. Version v0.13.1-beta13 -----
2024-03-25 15:47:08.913 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-03-25 15:47:08.913 DEBUG (MainThread) [custom_components.chime_tts.helpers] ``` is_say_url = True
2024-03-25 15:47:08.914 DEBUG (MainThread) [custom_components.chime_tts.helpers] ----- General Parameters -----
2024-03-25 15:47:08.914 DEBUG (MainThread) [custom_components.chime_tts.helpers] * entity_ids = []
2024-03-25 15:47:08.914 DEBUG (MainThread) [custom_components.chime_tts.helpers] * cache = False
2024-03-25 15:47:08.914 DEBUG (MainThread) [custom_components.chime_tts.helpers] * offset = 450.0
2024-03-25 15:47:08.915 DEBUG (MainThread) [custom_components.chime_tts.helpers] * final_delay = 0.0
2024-03-25 15:47:08.915 DEBUG (MainThread) [custom_components.chime_tts.helpers] * message = Awooga!
2024-03-25 15:47:08.915 DEBUG (MainThread) [custom_components.chime_tts.helpers] * tts_platform = google_translate
2024-03-25 15:47:08.915 DEBUG (MainThread) [custom_components.chime_tts.helpers] * tts_playback_speed = 100.0
2024-03-25 15:47:08.915 DEBUG (MainThread) [custom_components.chime_tts.helpers] * announce = False
2024-03-25 15:47:08.915 DEBUG (MainThread) [custom_components.chime_tts.helpers] * volume_level = -1.0
2024-03-25 15:47:08.915 DEBUG (MainThread) [custom_components.chime_tts.helpers] * join_players = False
2024-03-25 15:47:08.916 DEBUG (MainThread) [custom_components.chime_tts.helpers] * unjoin_players = False
2024-03-25 15:47:08.916 DEBUG (MainThread) [custom_components.chime_tts] - Generating new TTS audio with parameters:
2024-03-25 15:47:08.916 DEBUG (MainThread) [custom_components.chime_tts] * tts_platform = 'google_translate'
2024-03-25 15:47:08.916 DEBUG (MainThread) [custom_components.chime_tts] * message = 'Awooga!'
2024-03-25 15:47:08.917 DEBUG (MainThread) [custom_components.chime_tts] * tts_playback_speed = 100.0
2024-03-25 15:47:08.917 DEBUG (MainThread) [custom_components.chime_tts] * cache = False
2024-03-25 15:47:08.917 DEBUG (MainThread) [custom_components.chime_tts] * language = 'None'
2024-03-25 15:47:08.917 DEBUG (MainThread) [custom_components.chime_tts] * options = {}
2024-03-25 15:47:09.606 DEBUG (MainThread) [custom_components.chime_tts] ...TTS audio completed in 689.3399999999999 ms
2024-03-25 15:47:09.606 DEBUG (MainThread) [custom_components.chime_tts] - Saving mp3 file to folder: /www/chime_tts/...
2024-03-25 15:47:09.793 DEBUG (MainThread) [custom_components.chime_tts.helpers] - File saved to path: /www/chime_tts/z5p0l_ze.mp3
2024-03-25 15:47:09.800 DEBUG (MainThread) [custom_components.chime_tts] - Saving data to chime_tts storage:
2024-03-25 15:47:09.801 DEBUG (MainThread) [custom_components.chime_tts] - key: "fd67b1d08f43e83b402a01f18b05c91da8f3ba0043e238cdd4e04665a39fd950"
2024-03-25 15:47:09.801 DEBUG (MainThread) [custom_components.chime_tts] - value: "{'public_path': '/www/chime_tts/z5p0l_ze.mp3', 'audio_duration': 1.008}"
2024-03-25 15:47:09.873 DEBUG (MainThread) [custom_components.chime_tts] - Chime TTS audio generated: {'audio_duration': 1.008, 'local_path': None, 'public_path': '/www/chime_tts/z5p0l_ze.mp3'}
2024-03-25 15:47:09.874 DEBUG (MainThread) [custom_components.chime_tts] Final URL = /www/chime_tts/z5p0l_ze.mp3
2024-03-25 15:47:09.874 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say URL Completed in 960.592 ms -----

The editor in HASS is wierd - try prepending the /www/chime_tts parameter with /config THEN press TAB. should take you to the next line without clearing your entry.
Then you should be able to save it.

also I’m puzzled by the line from your log output that says:

media_content_id: media-source://media_source/local/sounds/temp/chime_tts/_jvu5x_c.mp3

the media_content_id: should be a ip address or FQN do you have any network connection to your hass server from outside your network? Is media_source a network name?

this is what I get from mine:

https://xxxxxhome.duckdns.org:443/local/chime_tts/_75web41.mp3

not sure, might be because I’m using the VLC Media Player Telnet application as a target just to get it to generate the TTS MP3?

Sadly not. Might have to do this? chime_tts.say_url default save folder doesn't seem to exist, but works with modifications · Issue #86 · nimroddolev/chime_tts · GitHub Seems strange that only some of us have this issue.

But also the folder paths aren’t consistent - the /media/ one really is ‘above’ the ‘config’ directory but the ‘www’ one is beneath it.

I know that when I starting using this package, I had some false starts. I’ve completely deleted the whole thing including going to the /custom_components folder an making sure that there weren’t any residual pieces laying about. Then reinstalling from HACS and entering the values in the configuration as they are now.

Might be something to try.

I’ve been working on a substantial release which includes quite a few new features and bugfixes which include issues with the default folder paths for both chime_tts.say and chime_tts.say_url.

It’s not quite ready, and the documentation isn’t complete yet, but I would be grateful for feedback whether these issues persist for you in the new version or have been addressed so I have released a beta (v0.14.0-beta1).

To install the beta version:

  1. Open the Chime TTS repository in HACS

  2. Click on the button in the top right

  3. Select the ↻ Redownload option

  4. Enable the Show beta versions option (it may take a moment to update the list)

  5. Select version v0.14.0-beta1 from the updated version drop-down list

  6. Restart Home Assistant

1 Like

So far…
When trying to change the default TTS service the config doesn’t seem to take anything and throws an error. I’ve tried Piper, tts.piper tts.elevenlabs_tts, All with the same results.

When trying to create a new message using chime_tts:say no pull-down selection for tts.elevenlabs_tts. But just adding it by typing it in does work.

Thank you! This fixed the issue for me!

1 Like

Thank you @dbullendsl for the feedback.

I resolved both issues in a new beta release: v0.14.0-beta2.

I’ve updated to latest beta and the config panel does accept a default tts platform. Although even tho it’s configured when I try to create a call to ctts:say the platform still requires a value to be input for the platform - shouldn’t it be pre-filled for the default value?

Also, the issue I raised earlier about the volume not reverting to previous now seems resolved.

Haven’t discovered anything else.

I’m glad to hear those issues seem to be resolved.

Unfortunately Home Assistant doesn’t allow for editing service UI elements, so I have no way of changing the TTS Platform dropdown options list.

so then, why bother having a default ?

It is used when tts_platform is null

hi,
does the goole cast devices like nest hub 2 and and the nest mini 2 support the ‘annouce’.
thank you in advance

Hi @BENZAKOUR86. I don’t own either of those devices so unfortunately I can’t confirm. When enabling the announce parameter in the latest version, chime_tts.say checks whether the feature is supported by the media_player platform, and if not, it fades out & pauses any currently playing music and then after the announcement is completed it resumes the music and fades it back in.

If the feature doesn’t work as expected I would be happy to troubleshoot with you and see if there’s a way I can add support for these platforms.

hi @Nimrod_Dolev,
Thank you for your response. I can confirm that I’ve tested the announce feature on both Google Nest Hub 2 and Nest Mini 2, and unfortunately, it does not work as expected on these devices. Despite enabling the announce parameter in the latest version, the feature does not function properly.

I appreciate your willingness to troubleshoot and potentially add support for these platforms. If there’s any further information I can provide or if you need assistance with testing, please let me know.

Problem w Alexa in v1.0.0 ? --I installed v1.0.0 yesterday, and ever since my Chime TTS announcements have not been working over Alexa – they play the starting chime OK, then announce that they’re having difficulty with the Simon Says skill --which I do not think I’ve ever enabled in my Alexa account

My automations send message to a persistent notif. in HA, then a notif. to my iPhone, then Chime TTS targeting 3 Amazon Echo units w most options not selected --just chime path, volume level, join players & unjoin players, cache, announce, & gender= female. Using Nabu Casa Cloud for TTS option.

Has been working REALLY well (v0.13.0), with only minor occasional hiccups (maybe timing glitches, maybe with cloud services). But after v1.0.0, I don’t think it has played properly even once. (Can’t test right now, due to sleeping folks in house.)

Hi @tim.plas, I’m sorry to hear you’ve been having issues with the new version.

In your comment you mentioned using using the gender parameter, which has been deprecated. There is a new beta version of Chime TTS which replaced gender with voice. Could you please upgrade to the beta and let me know if it fixes your issues?

To install the new beta version:

  1. Open the Chime TTS repository in HACS
  2. Click on the button in the top right
  3. Select the ↻ Redownload option
  4. Enable the Show beta versions option (it may take a moment to update the list)
  5. Select version v1.0.1-beta2 from the updated version drop-down list
  6. Restart Home Assistant

Another possible cause might be that you don’t have an external URL configured in your configuration.yaml file. Can you please add the following YAML to configuration.yaml ?

homeassistant:
  external_url: "https://YOUR_UNIQUE_ADDRESS.ui.nabu.casa/"
  internal_url: "http://192.168.X.X:8123/"

If you’re still having issues, can you please share your debug logs so that I might get a better idea of what else might be causing the problem?

To enable debug logging:

  1. Turn on debug logging:

    service: logger.set_level
    data:
      custom_components.chime_tts: debug
    
  2. Call the service chime_tts.say again.

  3. Check your log messages in Home Assistant:

    https://{YOUR_HOME_ASSISTANT_ADDRESS}:8123/config/logs?filter=chime_tts
    

    and click LOAD FULL LOGS

Thanks so much for the swift and informative reply! I will check those things in the AM. Will let you know then. Thanks much!

Hello Nim. Thanks for the suggestions.

I upgraded to v1.0.1-beta2 then built & ran a quick new automation for testing.
Unfortunately the issue was still present after the upgrade.
I did not know what to put into the “voice” parameter, so didn’t use that at all.

I then updated configuration.yaml as you suggested to include internal & external URLs.
Unfortunately still had the same difficulty.

The exact voice message I’m getting from Alexa Echo is “Sorry I’m having trouble accessing your Simon Says xxxx skill right now.” --I can’t quite catch the word right after Simon Says; it sounds something like “Simon Says noss skill”.

I tried to enable debug logging, but am unsure where to put the YAML lines you suggested? When I tried putting that into configuration.yaml it failed the “Check Configuration” in Developer Tools.

I can certainly try again for debugging info, if I find out what I’m missing about setting up debug log.

Thanks.