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

Canceling the script execution causes the service to stop working until restart #181

Closed hertzg closed 2 months ago

hertzg commented 3 months ago

System Health details

System Information

version core-2024.9.0.dev0
installation_type Unsupported Third Party Container
dev true
hassio false
docker true
user vscode
virtualenv true
python_version 3.12.5
os_name Linux
os_version 6.5.0-44-generic
arch aarch64
timezone Europe/Berlin
config_dir /workspaces/hassio-core/config
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | pending
Dashboards dashboards | 2 -- | -- resources | 0 views | 1 mode | storage
Recorder oldest_recorder_run | August 23, 2024 at 5:41 AM -- | -- current_recorder_run | August 23, 2024 at 6:14 PM estimated_db_size | 1.29 MiB database_engine | sqlite database_version | 3.40.1

Checklist

Describe the issue

When calling the .say service from a script, if somehow the script execution is canceled, the sound plays one last time and any consecutive calls will just fill up the queue.

The only workaround is to restart homeassistant.

Here's a video demonstrating the issue:

https://github.com/user-attachments/assets/fdae8ab8-16ee-49f4-8151-d99b5aa87d9e

Reproduction steps

  1. Create a sample script
    alias: myscript
    sequence:
    - action: chime_tts.say
    target:
      entity_id: media_player.aux_kiosk
    data:
      chime_path: choir
    description: ""
    mode: single
  2. Bring up the more info modal for the script
  3. Run the script
  4. ⚠️ Before the script finishes on it's own, cancel the script
  5. The sound will still play one last time but next calls will just fill up the queue

Debug logs

2024-08-23 14:14:35.810 INFO (MainThread) [homeassistant.core] Starting Home Assistant
2024-08-23 14:14:35.893 DEBUG (MainThread) [homeassistant.config_entries] Config entry 'Radio Browser' for radio_browser integration not ready yet: Could not connect to Radio Browser API; Retrying in 10 seconds
2024-08-23 14:14:35.897 INFO (MainThread) [asyncio] <Server sockets=(<asyncio.TransportSocket fd=20, family=2, type=1, proto=6, laddr=('172.17.0.4', 40000)>,)> is serving
2024-08-23 14:14:37.829 WARNING (MainThread) [asyncio] Executing <Task pending name='Task-95' coro=<RequestHandler._handle_request() running at /home/vscode/.local/ha-venv/lib/python3.12/site-packages/aiohttp/web_protocol.py:462> wait_for=<Future pending cb=[Task.task_wakeup()] created at /usr/local/lib/python3.12/asyncio/base_events.py:449> cb=[Task.task_wakeup()] created at /home/vscode/.local/ha-venv/lib/python3.12/site-packages/aiohttp/web_protocol.py:541> took 0.109 seconds
2024-08-23 14:14:46.174 DEBUG (MainThread) [homeassistant.config_entries] Config entry 'Radio Browser' for radio_browser integration not ready yet: Could not connect to Radio Browser API; Retrying in 20 seconds
2024-08-23 14:14:58.816 INFO (MainThread) [homeassistant.components.script.myscript_2] myscript: Running script sequence
2024-08-23 14:14:58.817 INFO (MainThread) [homeassistant.components.script.myscript_2] myscript: Executing step call service
2024-08-23 14:14:58.821 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔════════════════════════════════════════════╗
2024-08-23 14:14:58.821 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.4-beta4 ║
2024-08-23 14:14:58.821 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚════════════════════════════════════════════╝
2024-08-23 14:14:58.829 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-08-23 14:14:59.040 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-08-23 14:14:59.040 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ General Parameters │
2024-08-23 14:14:59.041 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-08-23 14:14:59.041 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids = ['media_player.aux_kiosk']
2024-08-23 14:14:59.041 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = choir
2024-08-23 14:14:59.041 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = False
2024-08-23 14:14:59.041 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = 450.0
2024-08-23 14:14:59.041 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 0.0
2024-08-23 14:14:59.041 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-08-23 14:14:59.041 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-08-23 14:14:59.042 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = False
2024-08-23 14:14:59.042 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-08-23 14:14:59.042 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = -1
2024-08-23 14:14:59.042 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = False
2024-08-23 14:14:59.042 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = False
2024-08-23 14:14:59.042 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-08-23 14:14:59.042 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: entity_id: media_player.aux_kiosk
2024-08-23 14:14:59.043 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: fully_kiosk
2024-08-23 14:14:59.043 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: -1.0
2024-08-23 14:14:59.043 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: -1.0
2024-08-23 14:14:59.043 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: False
2024-08-23 14:14:59.044 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: False
2024-08-23 14:14:59.044 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: False
2024-08-23 14:14:59.044 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭─────────────────╮
2024-08-23 14:14:59.044 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Preparing Audio │
2024-08-23 14:14:59.044 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰─────────────────╯
2024-08-23 14:14:59.046 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local path to chime: /workspaces/hassio-core/config/custom_components/chime_tts/mp3s/choir.mp3
2024-08-23 14:14:59.046 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "/workspaces/hassio-core/config/custom_components/chime_tts/mp3s/choir.mp3"...
2024-08-23 14:14:59.215 DEBUG (MainThread) [custom_components.chime_tts]    ...audio retrieved. Duration: 2.856s
2024-08-23 14:14:59.216 DEBUG (MainThread) [custom_components.chime_tts]  - Saving mp3 file to local folder: /workspaces/hassio-core/config/media/sounds/temp/chime_tts/...
2024-08-23 14:14:59.286 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /workspaces/hassio-core/config/media/sounds/temp/chime_tts/vpzv1hy2.mp3
2024-08-23 14:14:59.286 DEBUG (MainThread) [custom_components.chime_tts] Adding cover art to /workspaces/hassio-core/config/media/sounds/temp/chime_tts/vpzv1hy2.mp3
2024-08-23 14:14:59.287 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] Running FFMpeg operation: "ffmpeg -i /workspaces/hassio-core/config/media/sounds/temp/chime_tts/vpzv1hy2.mp3 -i /workspaces/hassio-core/config/custom_components/chime_tts/cover_art.jpg -c copy -map 0 -map 1 /workspaces/hassio-core/config/media/sounds/temp/chime_tts/vpzv1hy2_converted.mp3"
2024-08-23 14:14:59.426 DEBUG (MainThread) [custom_components.chime_tts]  - Chime TTS audio generated:
2024-08-23 14:14:59.426 DEBUG (MainThread) [custom_components.chime_tts]    * audio_duration = 2.856
2024-08-23 14:14:59.426 DEBUG (MainThread) [custom_components.chime_tts]    * local_path = "/workspaces/hassio-core/config/media/sounds/temp/chime_tts/vpzv1hy2.mp3"
2024-08-23 14:14:59.426 DEBUG (MainThread) [custom_components.chime_tts]    * public_path = None
2024-08-23 14:14:59.426 DEBUG (MainThread) [custom_components.chime_tts]    * media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/vpzv1hy2.mp3"
2024-08-23 14:14:59.426 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-08-23 14:14:59.426 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Chime TTS playback │
2024-08-23 14:14:59.426 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-08-23 14:14:59.426 DEBUG (MainThread) [custom_components.chime_tts]    1 Regular media player detected:
2024-08-23 14:14:59.426 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.aux_kiosk
2024-08-23 14:14:59.426 DEBUG (MainThread) [custom_components.chime_tts]    Calling media_player.play_media with data:
2024-08-23 14:14:59.426 DEBUG (MainThread) [custom_components.chime_tts]      - entity_id: ['media_player.aux_kiosk']
2024-08-23 14:14:59.427 DEBUG (MainThread) [custom_components.chime_tts]      - announce: False
2024-08-23 14:14:59.427 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_type: music
2024-08-23 14:14:59.427 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/vpzv1hy2.mp3
2024-08-23 14:14:59.436 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 2.856s for audio playback to complete...
2024-08-23 14:15:02.299 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]  - Waiting until 1 media_player isn't playing...
2024-08-23 14:15:05.646 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    ✔ media_player.aux_kiosk
2024-08-23 14:15:05.648 DEBUG (MainThread) [custom_components.chime_tts] Removing temporary file:
2024-08-23 14:15:05.649 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Deleting file /workspaces/hassio-core/config/media/sounds/temp/chime_tts/vpzv1hy2.mp3
2024-08-23 14:15:05.650 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭───────────────────────────────────────────╮
2024-08-23 14:15:05.650 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │──── Chime TTS Say Completed in 6.61 s ────│
2024-08-23 14:15:05.650 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰───────────────────────────────────────────╯
2024-08-23 14:15:05.656 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Service call completed successfully
2024-08-23 14:15:05.657 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Queue now empty
2024-08-23 14:15:06.565 DEBUG (MainThread) [homeassistant.config_entries] Config entry 'Radio Browser' for radio_browser integration not ready yet: Could not connect to Radio Browser API; Retrying in 40 seconds
2024-08-23 14:15:08.924 INFO (MainThread) [homeassistant.components.script.myscript_2] myscript: Running script sequence
2024-08-23 14:15:08.924 INFO (MainThread) [homeassistant.components.script.myscript_2] myscript: Executing step call service
2024-08-23 14:15:08.926 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔════════════════════════════════════════════╗
2024-08-23 14:15:08.926 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.4-beta4 ║
2024-08-23 14:15:08.926 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚════════════════════════════════════════════╝
2024-08-23 14:15:08.928 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-08-23 14:15:08.932 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-08-23 14:15:08.932 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ General Parameters │
2024-08-23 14:15:08.932 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-08-23 14:15:08.932 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids = ['media_player.aux_kiosk']
2024-08-23 14:15:08.932 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = choir
2024-08-23 14:15:08.932 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = False
2024-08-23 14:15:08.932 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = 450.0
2024-08-23 14:15:08.932 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 0.0
2024-08-23 14:15:08.932 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-08-23 14:15:08.932 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-08-23 14:15:08.932 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = False
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = -1
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = False
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = False
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: entity_id: media_player.aux_kiosk
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: fully_kiosk
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: -1.0
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: -1.0
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: False
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: False
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: False
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭─────────────────╮
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Preparing Audio │
2024-08-23 14:15:08.933 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰─────────────────╯
2024-08-23 14:15:08.934 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local path to chime: /workspaces/hassio-core/config/custom_components/chime_tts/mp3s/choir.mp3
2024-08-23 14:15:08.934 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "/workspaces/hassio-core/config/custom_components/chime_tts/mp3s/choir.mp3"...
2024-08-23 14:15:09.036 DEBUG (MainThread) [custom_components.chime_tts]    ...audio retrieved. Duration: 2.856s
2024-08-23 14:15:09.036 DEBUG (MainThread) [custom_components.chime_tts]  - Saving mp3 file to local folder: /workspaces/hassio-core/config/media/sounds/temp/chime_tts/...
2024-08-23 14:15:09.105 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /workspaces/hassio-core/config/media/sounds/temp/chime_tts/oymn26l1.mp3
2024-08-23 14:15:09.105 DEBUG (MainThread) [custom_components.chime_tts] Adding cover art to /workspaces/hassio-core/config/media/sounds/temp/chime_tts/oymn26l1.mp3
2024-08-23 14:15:09.105 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] Running FFMpeg operation: "ffmpeg -i /workspaces/hassio-core/config/media/sounds/temp/chime_tts/oymn26l1.mp3 -i /workspaces/hassio-core/config/custom_components/chime_tts/cover_art.jpg -c copy -map 0 -map 1 /workspaces/hassio-core/config/media/sounds/temp/chime_tts/oymn26l1_converted.mp3"
2024-08-23 14:15:09.251 DEBUG (MainThread) [custom_components.chime_tts]  - Chime TTS audio generated:
2024-08-23 14:15:09.251 DEBUG (MainThread) [custom_components.chime_tts]    * audio_duration = 2.856
2024-08-23 14:15:09.251 DEBUG (MainThread) [custom_components.chime_tts]    * local_path = "/workspaces/hassio-core/config/media/sounds/temp/chime_tts/oymn26l1.mp3"
2024-08-23 14:15:09.251 DEBUG (MainThread) [custom_components.chime_tts]    * public_path = None
2024-08-23 14:15:09.251 DEBUG (MainThread) [custom_components.chime_tts]    * media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/oymn26l1.mp3"
2024-08-23 14:15:09.251 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-08-23 14:15:09.251 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Chime TTS playback │
2024-08-23 14:15:09.251 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-08-23 14:15:09.251 DEBUG (MainThread) [custom_components.chime_tts]    1 Regular media player detected:
2024-08-23 14:15:09.251 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.aux_kiosk
2024-08-23 14:15:09.251 DEBUG (MainThread) [custom_components.chime_tts]    Calling media_player.play_media with data:
2024-08-23 14:15:09.251 DEBUG (MainThread) [custom_components.chime_tts]      - entity_id: ['media_player.aux_kiosk']
2024-08-23 14:15:09.251 DEBUG (MainThread) [custom_components.chime_tts]      - announce: False
2024-08-23 14:15:09.252 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_type: music
2024-08-23 14:15:09.252 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/oymn26l1.mp3
2024-08-23 14:15:09.261 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 2.856s for audio playback to complete...
2024-08-23 14:15:12.126 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]  - Waiting until 1 media_player isn't playing...
2024-08-23 14:15:15.881 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    𝘅 media_player.aux_kiosk - Timed out. Current state: playing
2024-08-23 14:15:15.882 DEBUG (MainThread) [custom_components.chime_tts]  - Timed out waiting for playback to complete
2024-08-23 14:15:15.882 DEBUG (MainThread) [custom_components.chime_tts] Removing temporary file:
2024-08-23 14:15:15.883 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Deleting file /workspaces/hassio-core/config/media/sounds/temp/chime_tts/oymn26l1.mp3
2024-08-23 14:15:15.883 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭───────────────────────────────────────────╮
2024-08-23 14:15:15.883 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │──── Chime TTS Say Completed in 6.95 s ────│
2024-08-23 14:15:15.884 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰───────────────────────────────────────────╯
2024-08-23 14:15:15.888 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Service call completed successfully
2024-08-23 14:15:15.888 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Queue now empty
2024-08-23 14:15:16.981 INFO (MainThread) [homeassistant.components.script.myscript_2] myscript: Running script sequence
2024-08-23 14:15:16.984 INFO (MainThread) [homeassistant.components.script.myscript_2] myscript: Executing step call service
2024-08-23 14:15:16.986 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔════════════════════════════════════════════╗
2024-08-23 14:15:16.986 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.4-beta4 ║
2024-08-23 14:15:16.986 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚════════════════════════════════════════════╝
2024-08-23 14:15:16.989 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-08-23 14:15:16.994 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-08-23 14:15:16.994 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ General Parameters │
2024-08-23 14:15:16.994 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-08-23 14:15:16.994 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * entity_ids = ['media_player.aux_kiosk']
2024-08-23 14:15:16.994 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * chime_path = choir
2024-08-23 14:15:16.994 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * cache = False
2024-08-23 14:15:16.994 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * offset = 450.0
2024-08-23 14:15:16.994 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * final_delay = 0.0
2024-08-23 14:15:16.995 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_speed = 100.0
2024-08-23 14:15:16.995 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * tts_pitch = 0
2024-08-23 14:15:16.995 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * announce = False
2024-08-23 14:15:16.995 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * fade_audio = False
2024-08-23 14:15:16.995 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * volume_level = -1
2024-08-23 14:15:16.995 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * join_players = False
2024-08-23 14:15:16.995 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * unjoin_players = False
2024-08-23 14:15:16.995 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]  * media_players_array:
2024-08-23 14:15:16.995 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]    - 0: entity_id: media_player.aux_kiosk
2024-08-23 14:15:16.996 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      platform: fully_kiosk
2024-08-23 14:15:16.996 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      initial volume: -1.0
2024-08-23 14:15:16.996 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      target volume: -1.0
2024-08-23 14:15:16.996 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      now playing: True
2024-08-23 14:15:16.996 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      join supported: False
2024-08-23 14:15:16.996 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers]      announce supported: False
2024-08-23 14:15:16.996 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭─────────────────╮
2024-08-23 14:15:16.996 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Preparing Audio │
2024-08-23 14:15:16.996 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰─────────────────╯
2024-08-23 14:15:16.997 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Local path to chime: /workspaces/hassio-core/config/custom_components/chime_tts/mp3s/choir.mp3
2024-08-23 14:15:16.997 DEBUG (MainThread) [custom_components.chime_tts]  - Retrieving audio from path: "/workspaces/hassio-core/config/custom_components/chime_tts/mp3s/choir.mp3"...
2024-08-23 14:15:17.101 DEBUG (MainThread) [custom_components.chime_tts]    ...audio retrieved. Duration: 2.856s
2024-08-23 14:15:17.101 DEBUG (MainThread) [custom_components.chime_tts]  - Saving mp3 file to local folder: /workspaces/hassio-core/config/media/sounds/temp/chime_tts/...
2024-08-23 14:15:17.170 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] File saved to path: /workspaces/hassio-core/config/media/sounds/temp/chime_tts/a__sf5mq.mp3
2024-08-23 14:15:17.171 DEBUG (MainThread) [custom_components.chime_tts] Adding cover art to /workspaces/hassio-core/config/media/sounds/temp/chime_tts/a__sf5mq.mp3
2024-08-23 14:15:17.171 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] Running FFMpeg operation: "ffmpeg -i /workspaces/hassio-core/config/media/sounds/temp/chime_tts/a__sf5mq.mp3 -i /workspaces/hassio-core/config/custom_components/chime_tts/cover_art.jpg -c copy -map 0 -map 1 /workspaces/hassio-core/config/media/sounds/temp/chime_tts/a__sf5mq_converted.mp3"
2024-08-23 14:15:17.310 DEBUG (MainThread) [custom_components.chime_tts]  - Chime TTS audio generated:
2024-08-23 14:15:17.310 DEBUG (MainThread) [custom_components.chime_tts]    * audio_duration = 2.856
2024-08-23 14:15:17.310 DEBUG (MainThread) [custom_components.chime_tts]    * local_path = "/workspaces/hassio-core/config/media/sounds/temp/chime_tts/a__sf5mq.mp3"
2024-08-23 14:15:17.310 DEBUG (MainThread) [custom_components.chime_tts]    * public_path = None
2024-08-23 14:15:17.310 DEBUG (MainThread) [custom_components.chime_tts]    * media_content_id = "media-source://media_source/local/sounds/temp/chime_tts/a__sf5mq.mp3"
2024-08-23 14:15:17.310 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭────────────────────╮
2024-08-23 14:15:17.310 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │ Chime TTS playback │
2024-08-23 14:15:17.311 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰────────────────────╯
2024-08-23 14:15:17.311 DEBUG (MainThread) [custom_components.chime_tts]    1 Regular media player detected:
2024-08-23 14:15:17.311 DEBUG (MainThread) [custom_components.chime_tts]      - media_player.aux_kiosk
2024-08-23 14:15:17.311 DEBUG (MainThread) [custom_components.chime_tts]    Calling media_player.play_media with data:
2024-08-23 14:15:17.311 DEBUG (MainThread) [custom_components.chime_tts]      - entity_id: ['media_player.aux_kiosk']
2024-08-23 14:15:17.311 DEBUG (MainThread) [custom_components.chime_tts]      - announce: False
2024-08-23 14:15:17.311 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_type: music
2024-08-23 14:15:17.311 DEBUG (MainThread) [custom_components.chime_tts]      - media_content_id: media-source://media_source/local/sounds/temp/chime_tts/a__sf5mq.mp3
2024-08-23 14:15:17.319 DEBUG (MainThread) [custom_components.chime_tts]  - Waiting 2.856s for audio playback to complete...
2024-08-23 14:15:20.185 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]  - Waiting until 1 media_player isn't playing...
2024-08-23 14:15:23.944 DEBUG (MainThread) [custom_components.chime_tts.helpers.media_player_helper]    𝘅 media_player.aux_kiosk - Timed out. Current state: playing
2024-08-23 14:15:23.945 DEBUG (MainThread) [custom_components.chime_tts]  - Timed out waiting for playback to complete
2024-08-23 14:15:23.946 DEBUG (MainThread) [custom_components.chime_tts] Removing temporary file:
2024-08-23 14:15:23.947 DEBUG (MainThread) [custom_components.chime_tts.helpers.filesystem] Deleting file /workspaces/hassio-core/config/media/sounds/temp/chime_tts/a__sf5mq.mp3
2024-08-23 14:15:23.947 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╭───────────────────────────────────────────╮
2024-08-23 14:15:23.947 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] │──── Chime TTS Say Completed in 6.95 s ────│
2024-08-23 14:15:23.947 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╰───────────────────────────────────────────╯
2024-08-23 14:15:23.951 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Queue now empty
2024-08-23 14:15:26.332 INFO (MainThread) [homeassistant.components.script.myscript_2] myscript: Running script sequence
2024-08-23 14:15:26.333 INFO (MainThread) [homeassistant.components.script.myscript_2] myscript: Executing step call service
2024-08-23 14:15:26.336 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔════════════════════════════════════════════╗
2024-08-23 14:15:26.336 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.4-beta4 ║
2024-08-23 14:15:26.336 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚════════════════════════════════════════════╝
2024-08-23 14:15:26.339 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue
2024-08-23 14:15:33.921 INFO (MainThread) [homeassistant.components.script.myscript_2] myscript: Running script sequence
2024-08-23 14:15:33.922 INFO (MainThread) [homeassistant.components.script.myscript_2] myscript: Executing step call service
2024-08-23 14:15:33.927 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔════════════════════════════════════════════╗
2024-08-23 14:15:33.927 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.4-beta4 ║
2024-08-23 14:15:33.927 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚════════════════════════════════════════════╝
2024-08-23 14:15:33.931 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue (behind 1 other)
2024-08-23 14:15:38.737 INFO (MainThread) [homeassistant.components.script.myscript_2] myscript: Running script sequence
2024-08-23 14:15:38.737 INFO (MainThread) [homeassistant.components.script.myscript_2] myscript: Executing step call service
2024-08-23 14:15:38.741 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔════════════════════════════════════════════╗
2024-08-23 14:15:38.742 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.4-beta4 ║
2024-08-23 14:15:38.742 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚════════════════════════════════════════════╝
2024-08-23 14:15:38.746 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue (behind 2 others)
2024-08-23 14:15:42.305 INFO (MainThread) [homeassistant.components.script.myscript_2] myscript: Running script sequence
2024-08-23 14:15:42.306 INFO (MainThread) [homeassistant.components.script.myscript_2] myscript: Executing step call service
2024-08-23 14:15:42.311 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╔════════════════════════════════════════════╗
2024-08-23 14:15:42.311 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ║ Chime TTS Say Called. Version v1.1.4-beta4 ║
2024-08-23 14:15:42.312 DEBUG (MainThread) [custom_components.chime_tts.helpers.helpers] ╚════════════════════════════════════════════╝
2024-08-23 14:15:42.317 DEBUG (MainThread) [custom_components.chime_tts.queue_manager] Adding service call to queue (behind 3 others)
2024-08-23 14:15:46.839 DEBUG (MainThread) [homeassistant.config_entries] Config entry 'Radio Browser' for radio_browser integration not ready yet: Could not connect to Radio Browser API; Retrying in 80 seconds
2024-08-23 14:17:07.050 DEBUG (MainThread) [homeassistant.config_entries] Config entry 'Radio Browser' for radio_browser integration not ready yet: Could not connect to Radio Browser API; Retrying in 80 seconds
2024-08-23 14:18:27.510 DEBUG (MainThread) [homeassistant.config_entries] Config entry 'Radio Browser' for radio_browser integration not ready yet: Could not connect to Radio Browser API; Retrying in 80 seconds
2024-08-23 14:19:47.857 DEBUG (MainThread) [homeassistant.config_entries] Config entry 'Radio Browser' for radio_browser integration not ready yet: Could not connect to Radio Browser API; Retrying in 80 seconds

Diagnostics dump

No response

Might be related to #161

shurli commented 2 months ago

Same Issue for me. Used "say" within an automation in mode restart. So when the automation is triggered twice the first run is canceled while say is running. Then it is broken till homeassistant restart.

My hot fix in my case is that I changed automation mode to single.

Release 1.1.3

nimroddolev commented 2 months ago

Thank you @hertzg for opening the issue. I believe I have found a solution and will include it in the upcoming release.

nimroddolev commented 2 months ago

I released a new beta which includes the fix for this issue. I would like to ask you to please upgrade to the new beta version, v1.1.4-beta5, and let me know if the issue is now resolved.

hertzg commented 2 months ago

The issue seems to be resolved in v1.1.4-beta5, I'll let you know if the dreaded #161 reoccurs, so far so good.