nimroddolev / chime_tts

A custom Home Assistant integration to play combined audio files before and/or after text-to-speech (TTS) messages
https://nimroddolev.github.io/chime_tts/
MIT License
196 stars 14 forks source link

Unable to play on Google Home mini #189

Closed jesse-kaufman closed 1 month ago

jesse-kaufman commented 1 month ago

System Health details

System Information

version core-2024.9.2
installation_type Unsupported Third Party Container
dev false
hassio false
docker true
user homeassistant
virtualenv true
python_version 3.12.4
os_name Linux
os_version 6.8.0-41-generic
arch x86_64
timezone America/Chicago
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok HACS Data | ok GitHub API Calls Remaining | 4980 Installed Version | 2.0.1 Stage | running Available Repositories | 1421 Downloaded Repositories | 45
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | April 13, 2025 at 7:00 PM relayer_connected | true relayer_region | us-east-1 remote_enabled | true remote_connected | true alexa_enabled | true google_enabled | true remote_server | us-east-1-1.ui.nabu.casa certificate_status | ready instance_id | 70049538375a4c47910056f2728e678a can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Dashboards dashboards | 7 -- | -- resources | 28 views | 44 mode | storage
Recorder oldest_recorder_run | May 27, 2024 at 10:42 AM -- | -- current_recorder_run | September 24, 2024 at 7:38 PM estimated_db_size | 11812.54 MiB database_engine | sqlite database_version | 3.45.3

Checklist

Describe the issue

When trying to play to a Google Home Mini, I get no sound and the error: "Error calling media_player.play_media service: No media content id found"

Playing to only Alexa devices works as expected.

Playing to a group of media players (mostly Alexa, one Google Home mini), I get the same error as above and playback does not work on any device. Google Home Mini is silent and Alexa says she's having problems with my Simon Says skill

Reproduction steps

Call chime_tts.say with the following:

action: chime_tts.say
target:
  entity_id:
    - media_player.dining_room_speaker
data:
  message: The kettle is done
  voice: JennyNeural

Debug logs

2024-09-24 19:42:46.530 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔══════════════════════════════════════╗
2024-09-24 19:42:46.530 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.4 ║
2024-09-24 19:42:46.530 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚══════════════════════════════════════╝
2024-09-24 19:42:46.530 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ General Parameters │
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids = ['media_player.dining_room_speaker']
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = False
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = -200.0
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 0.0
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = The kettle is done
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = False
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = -1
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = False
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = False
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * audio_conversion = -ac 2 -codec:a libmp3lame -b:a 48k -ar 16000 -filter:a volume=1.6
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: entity_id: media_player.dining_room_speaker
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: cast
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.5
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: -1.0
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: False
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: False
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: False
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭─────────────────────╮
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ TTS-Specific Params │
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰─────────────────────╯
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * voice = JennyNeural
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tld = com (default value entered in configuration)
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭─────────────────╮
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Preparing Audio │
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰─────────────────╯
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  - Using default TTS platform: 'cloud'
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts]  - Setting language to 'en-US' for Nabu Casa TTS voice: 'JennyNeural'.
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts]  - Generating new TTS audio with parameters:
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts]     * tts_platform = 'cloud'
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts]     * message = 'The kettle is done'
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts]     * cache = False
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts]     * language = 'en-US'
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts]     * options = {'voice': 'JennyNeural'}
2024-09-24 19:42:46.622 DEBUG (MainThread) [custom_components.chime_tts]    ...TTS audio generated in 90.0ms
2024-09-24 19:42:46.623 DEBUG (MainThread) [custom_components.chime_tts]  - Saving mp3 file to local folder: /config/chime_tts/chimes/...
2024-09-24 19:42:46.678 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /config/chime_tts/chimes/nrirtg9a.mp3
2024-09-24 19:42:46.678 DEBUG (MainThread) [custom_components.chime_tts]   - Performing FFmpeg audio conversion...
2024-09-24 19:42:46.679 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] Running FFMpeg operation: "ffmpeg -i /config/chime_tts/chimes/nrirtg9a.mp3 -ac 2 -codec:a libmp3lame -b:a 48k -ar 16000 -filter:a volume=1.6 /config/chime_tts/chimes/nrirtg9a_converted.mp3"
2024-09-24 19:42:46.731 DEBUG (MainThread) [custom_components.chime_tts]     ...FFmpeg audio conversion completed.
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts]  - Chime TTS audio generated:
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts]    * audio_duration = 2.064
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts]    * local_path = "/config/chime_tts/chimes/nrirtg9a.mp3"
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts]    * public_path = None
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts]    * media_content_id = None
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Chime TTS playback │
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-09-24 19:42:46.816 WARNING (MainThread) [custom_components.chime_tts] Error calling `media_player.play_media` service: No media content id found
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 2.064s for audio playback to complete...
2024-09-24 19:42:48.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]  - Waiting until 1 media_player isn't playing...
2024-09-24 19:42:48.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    ✔ media_player.dining_room_speaker
2024-09-24 19:42:48.881 DEBUG (MainThread) [custom_components.chime_tts] Removing temporary file:
2024-09-24 19:42:48.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Deleting file /config/chime_tts/chimes/nrirtg9a.mp3
2024-09-24 19:42:48.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭───────────────────────────────────────────╮
2024-09-24 19:42:48.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │──── Chime TTS Say Completed in 2.35 s ────│
2024-09-24 19:42:48.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰───────────────────────────────────────────╯
2024-09-24 19:42:46.530 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔══════════════════════════════════════╗
2024-09-24 19:42:46.530 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.4 ║
2024-09-24 19:42:46.530 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚══════════════════════════════════════╝
2024-09-24 19:42:46.530 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ General Parameters │
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids = ['media_player.dining_room_speaker']
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = False
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = -200.0
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 0.0
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * message = The kettle is done
2024-09-24 19:42:46.531 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = False
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = -1
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = False
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = False
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * audio_conversion = -ac 2 -codec:a libmp3lame -b:a 48k -ar 16000 -filter:a volume=1.6
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: entity_id: media_player.dining_room_speaker
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: cast
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: 0.5
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: -1.0
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: False
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: False
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: False
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭─────────────────────╮
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ TTS-Specific Params │
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰─────────────────────╯
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * voice = JennyNeural
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tld = com (default value entered in configuration)
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭─────────────────╮
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Preparing Audio │
2024-09-24 19:42:46.532 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰─────────────────╯
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  - Using default TTS platform: 'cloud'
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts]  - Setting language to 'en-US' for Nabu Casa TTS voice: 'JennyNeural'.
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts]  - Generating new TTS audio with parameters:
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts]     * tts_platform = 'cloud'
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts]     * message = 'The kettle is done'
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts]     * cache = False
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts]     * language = 'en-US'
2024-09-24 19:42:46.534 DEBUG (MainThread) [custom_components.chime_tts]     * options = {'voice': 'JennyNeural'}
2024-09-24 19:42:46.622 DEBUG (MainThread) [custom_components.chime_tts]    ...TTS audio generated in 90.0ms
2024-09-24 19:42:46.623 DEBUG (MainThread) [custom_components.chime_tts]  - Saving mp3 file to local folder: /config/chime_tts/chimes/...
2024-09-24 19:42:46.678 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /config/chime_tts/chimes/nrirtg9a.mp3
2024-09-24 19:42:46.678 DEBUG (MainThread) [custom_components.chime_tts]   - Performing FFmpeg audio conversion...
2024-09-24 19:42:46.679 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] Running FFMpeg operation: "ffmpeg -i /config/chime_tts/chimes/nrirtg9a.mp3 -ac 2 -codec:a libmp3lame -b:a 48k -ar 16000 -filter:a volume=1.6 /config/chime_tts/chimes/nrirtg9a_converted.mp3"
2024-09-24 19:42:46.731 DEBUG (MainThread) [custom_components.chime_tts]     ...FFmpeg audio conversion completed.
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts]  - Chime TTS audio generated:
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts]    * audio_duration = 2.064
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts]    * local_path = "/config/chime_tts/chimes/nrirtg9a.mp3"
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts]    * public_path = None
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts]    * media_content_id = None
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Chime TTS playback │
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-09-24 19:42:46.816 WARNING (MainThread) [custom_components.chime_tts] Error calling `media_player.play_media` service: No media content id found
2024-09-24 19:42:46.816 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 2.064s for audio playback to complete...
2024-09-24 19:42:48.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]  - Waiting until 1 media_player isn't playing...
2024-09-24 19:42:48.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    ✔ media_player.dining_room_speaker
2024-09-24 19:42:48.881 DEBUG (MainThread) [custom_components.chime_tts] Removing temporary file:
2024-09-24 19:42:48.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Deleting file /config/chime_tts/chimes/nrirtg9a.mp3
2024-09-24 19:42:48.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭───────────────────────────────────────────╮
2024-09-24 19:42:48.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │──── Chime TTS Say Completed in 2.35 s ────│
2024-09-24 19:42:48.882 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰───────────────────────────────────────────╯

Diagnostics dump

No response

nimroddolev commented 1 month ago

Hi @jesse-kaufman, sorry you've been having issues with the new release.

Based on your log's message: Error calling media_player.play_media service: No media content id found, it seems the temporary folder path you have configured (/config/chime_tts/chimes/), is not inside your Home Assistant's media folder, which prevents Home Assistant from using it as a media file for playback.

Can you please try changing the temporary folder path to /media/chime_tts/, and see if that resolves the issue? If not, please provide a screenshot of the values you have set in your Chime TTS configuration.

jesse-kaufman commented 1 month ago

Aha, got that fixed and it's working again! Pretty sure that explains some other occasional weirdness I was experiencing, too! Thank you so much!!

nimroddolev commented 1 month ago

Excellent! Glad I could help 👍