It looks like the TTS request completes successfully and provides the file path to the .mp3 file, but when Chime TTS tries to access it, it fails to load.
Do you hear the chime sound from your media player?
1 - yes
2 - no, because the config/tts folder didn’t have the file
3 - docker
Its working now, I tried a normal tts.google and it saved the .mp3 in the tts folder, after that the chimeTTS started working ( with .mp3 file in the tts folder)
Strange behavior
But thanks!
looks great, I just need to confirm the announce feature works, if so, it’s perfect
@jreed509 If you are able to play other local media files on this player using the play_media service then I don’t see why it shouldn’t also work for chime_tts. Behind the scenes it uses the same play_media service to play the generated mp3.
You’ve tested the mp3 generated from chime_tts in your browser, so it’s not as issue with the file, but have you tried playing it on your player using HA’s play_media service? Eg:
service: media_player.play_media
data:
media_content_id: <my_hass_hostname>/api/tts_proxy/d3486ae9136e7856bc42212385ea797094475802_en_-_google_translate.mp3
media_content_type: music
target:
entity_id: media_player.kitchen
Hmm yep that seems to be the issue. Calling that service doesn’t result in any sound output and no errors in the logs. Any thoughts on why that would be the case?
I’m running my HA instance on an Raspberry Pi, and I haven’t had the same issue, so maybe there’s a difference when running on proxmox? Perhaps the file path of the temporary mp3 file generated by chime_tts is the issue.
Try calling the play_media service with the temp mp3 file path included in the debug message. If it doesn’t play, perhaps try a few different options for the root folder, maybe that’s the key?
Calling play_media with the temp mp3 file path didn’t work either. As far as I can tell the play_media service doesn’t work for any urls outside of the media_browser or that are accessible from browser.
Is the .mp3 file in the /tmp directory accessible from the browser on your Pi?
I think the issue has to do with playing media files not located inside a media folder. I am working on a fix and will let you know when it will be available.
I released a new version, v0.5.0, that includes a change of the generated audio path to the media folder. Can you please test it and let me know if solves the problem?
@Nimrod_Dolev actually after some more testing, this only seems to be working on Homepods for me now. Using v0.5.0 on my sonos or cast devices results in the same issue as before.
With v0.5.0, I do see the audio files being created in the media browser and I can play them fine to any speaker from there. It looks like the url used by the media browser is media-source://media_source/local/sounds/temp/chime_tts/0qi51w0j.mp3 which appears to be different from what is being used by chime_tts based on the logs.
@jreed509, Thanks for the feedback. I released a hotfix, v0.5.1, which hopefully addresses the problem. I only have a HomePod device, so I can’t test the fix myself. Please update to the new version and let me know if it works for you.
Unfortunately v0.5.1 doesn’t fix the issue for me either. Very strange since copying the url generated from the debug logs and using it in the play_media service works fine - it just doesn’t play when calling the chime_tts.say service to any device other than homepods
I also cannot play media on my player but i get a different error message. I also tried your 0.5.1 update. I am also using google translate platform. Here is my log:
023-07-18 01:36:57.162 DEBUG (MainThread) [custom_components.chime_tts] ----- Chime TTS Say Called -----
2023-07-18 01:36:57.162 INFO (MainThread) [custom_components.chime_tts] Turning on media player entity: "media_player.office_speaker"
2023-07-18 01:36:57.165 WARNING (MainThread) [custom_components.chime_tts] Media player entity "media_player.office_speaker" does not have attributes
2023-07-18 01:36:57.165 DEBUG (MainThread) [custom_components.chime_tts] async_get_playback_audio_path(params={'hass': <homeassistant.core.HomeAssistant object at 0x7f4b0e13f350>, 'chime_path': '', 'end_chime_path': '', 'delay': 450.0, 'tts_platform': 'google_translate', 'tts_playback_speed': 100.0, 'cache': 'False', 'message': 'test', 'language': None, 'tld': None, 'gender': None})
2023-07-18 01:36:57.166 DEBUG (MainThread) [custom_components.chime_tts] Attempting to retrieve generated mp3 file from cache
2023-07-18 01:36:57.166 DEBUG (MainThread) [custom_components.chime_tts] async_get_cache_path('59a8723d8d41df3dea405bfd53affb71306315d438d9535db367daa0e9bd0ab8')
2023-07-18 01:36:57.166 DEBUG (MainThread) [custom_components.chime_tts] - File does not exist in cache.
2023-07-18 01:36:57.166 DEBUG (MainThread) [custom_components.chime_tts] No previously generated mp3 file found
2023-07-18 01:36:57.166 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("", 0, audio)
2023-07-18 01:36:57.166 DEBUG (MainThread) [custom_components.chime_tts] No filepath provided
2023-07-18 01:36:57.166 DEBUG (MainThread) [custom_components.chime_tts] async_get_cache_path('4fe4096bec096563583a4523ba3dc4cfc4ecc249a65f2755c17c2cb604e62b40')
2023-07-18 01:36:57.166 DEBUG (MainThread) [custom_components.chime_tts] Retrieving key/value from chime_tts storage:
2023-07-18 01:36:57.166 DEBUG (MainThread) [custom_components.chime_tts] key: 4fe4096bec096563583a4523ba3dc4cfc4ecc249a65f2755c17c2cb604e62b40
2023-07-18 01:36:57.166 DEBUG (MainThread) [custom_components.chime_tts] value: /config/tts/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3_en_-_google_translate.mp3
2023-07-18 01:36:57.166 DEBUG (MainThread) [custom_components.chime_tts] - async_get_cache_path('4fe4096bec096563583a4523ba3dc4cfc4ecc249a65f2755c17c2cb604e62b40') returned value: '/config/tts/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3_en_-_google_translate.mp3'
2023-07-18 01:36:57.166 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("/config/tts/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3_en_-_google_translate.mp3", 450.0, audio)
2023-07-18 01:36:57.166 WARNING (MainThread) [custom_components.chime_tts] Audio filepath does not exist: "/config/tts/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3_en_-_google_translate.mp3"
2023-07-18 01:36:57.167 DEBUG (MainThread) [custom_components.chime_tts] get_audio_from_path("", 450.0, audio)
2023-07-18 01:36:57.167 DEBUG (MainThread) [custom_components.chime_tts] No filepath provided
2023-07-18 01:36:57.167 ERROR (MainThread) [custom_components.chime_tts] Unable to create audio for playback
I have checked the /config/tts directory and it does not have any cached file in there after running the say command. My devices are google home minis and ive tried a bose with built in google home as well
I can also use the tts.google_say service just fine
I have also just updated to version v0.5.2 and trying to get this to work. The MP3 files are being generated in the TTS folder, but i’m unable to hear the message through the mediaplayer. When using the “tts.google_translate_say” service I can hear the message just fine.
@Nimrod_Dolev I have the following in the log file: The tada.mp3 file does exist, except i’m running Home Assistant Core in an virtual environment. The file that it refers to (7944…mp3" does exist, so it looks like with the paths something is not working in an venc / HA Core setup?
Logger: custom_components.chime_tts
Source: custom_components/chime_tts/__init__.py:142
Integration: Chime TTS (documentation, issues)
First occurred: 13:50:20 (3 occurrences)
Last logged: 13:50:20
Audio filepath does not exist: "custom_components/chime_tts/mp3s/tada.mp3"
Audio filepath does not exist: "/config/tts/7944c5f87770f2710f409032dd78d78b3aeea91d_nl_-_google_translate.mp3"
Audio filepath does not exist: "custom_components/chime_tts/mp3s/bright.mp3"