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

v0.11.0 not playing custom chime sounds, only tts #69

Closed jchristianj closed 10 months ago

jchristianj commented 10 months ago

Checklist

Is your feature request related to a problem? Please describe.

After updating from v0.10.2 to v0.11.0 no custom chime sound is played any longer; tts message consists of the spoken text only. Did not change any setting or path. HA log entry is similar "could not play file None", do not remember exactly.

Preset sounds are played, only custom sounds do not work.

Went back to v0.10.2 and all is fine again.

Describe the solution you'd like

Custom sounds should be played.

Describe alternatives you've considered

went back to previous version, all is fine again.

Additional context

image

nimroddolev commented 10 months ago

Hi @jchristianj, Iā€™m sorry the new release has caused issues for you.

Is the screenshot you included from the configuration in the new version? Do the paths to the custom paths appear when you downgraded to the previous version?

There is a fix in a new beta version which might address your issue. Could you please upgrade to it and let me know if it works for you?

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
  5. Select version v0.11.1-beta2 from the updated version drop-down list
Wummeke commented 10 months ago

Same issue here. I have a file in /media/sounds called DB-Regio.mp3. This is the service call:

service: chime_tts.say
target:
  entity_id:
    - media_player.esp_muse_luxe
data:
  tts_platform: tts.piper
  message: Hallo welt!
  cache: false
  chime_path: /media/sounds/DB-Regio.mp3

but the chime is not played. The tada chime from the examples works fine. The error in the log:

2024-01-07 21:30:14.385 WARNING (MainThread) [custom_components.chime_tts] Unable to find audio file None

I am on version v0.11.1-beta2 by the way.

jchristianj commented 10 months ago

Hi @nimroddolev thanks for your quick response. The screenshot is from the old version v0.10.2 after I reverted back to it.

However, the suggested beta2 unfortunately does not work. After going back to to v0.10.2 it's working again.

I am attaching two debug logs, one for the beta2 (not working) and one for v0.10.2 directly after going back (working). Both logs show the same script executed, nothing changed except the version in between.

If you need any further information please contact me. Thanks!

old_version_working_home-assistant_chime_tts_2024-01-07T20-33-22.399Z.log beta2_not_working_home-assistant_chime_tts_2024-01-07T20-27-51.984Z.log

Wummeke commented 10 months ago

I noticed it does work when I add the mp3 file as Custom 1 to the settings. However, according to the wiki the way I tried it before should work: https://github.com/nimroddolev/chime_tts/wiki/chime_tts.say#chime_path I tried to add another mp3 from the same folder (/media/sounds) as Custom 2, but that doesn't work: Invalid custom chime path detected I can't edit Custom 1 either, that fails with the same error. (Invalid custom chime path detected )

nimroddolev commented 10 months ago

Hi @jchristianj and @Wummeke,

Thank you both for the additional information. Unfortunately from my own testing I can't replicate the problem you are experiencing. I reviewed my changes since the previous version and nothing jumps out as the potential cause. I have some follow up questions and troubleshooting I would like to ask you to kindly work through with me. I appreciate your help and your patience šŸ‘

@Wummeke: it might prove useful to have access to your debug logs. Could you please provide them? To enable debug logs:

  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
  4. Click LOAD FULL LOGS

Also, you mentioned that:

it does work when I add the mp3 file as Custom 1 to the settings. However, according to the wiki the way I tried it before should work

  1. How did you add the mp3 file as Custom 1?
  2. What do you mean by "the way I tried it before"?

@jchristianj - I see from your debug logs of the service call to v0.11.1-beta2 that the custom chime was not found at the path /media/sounds/a320_tritone-ding-dong.mp3. At first I thought perhaps the issue is with the path being relative (not originating from the root folder on the filesystem) but further down in the logs I see the final mp3 is saved successfully with the same root folder.


To try to understand the cause of issue I have some basic troubleshooting steps I'd like to ask you both to please try. Please go through them (even if they seem obvious) and let me know what your results are:

  1. Make sure to be running Chime TTS v0.11.1-beta2
  2. Please test and confirm that using the preset chimes from the drop-down UI work
  3. Download one of those preset chime mp3 files (you can download them from here) and save it to your media folder, add it as one of your custom chime slots in the integration's configuration dialog, and try to use it as a custom chime.
  4. In the configuration dialog, check that the file path to the custom chime that won't play is exactly the same as the actual file path on the filesystem (pay attention to uppercase & lowercase letters, etc.).
  5. Are you able to add the same chime file that won't play to another custom chime slot? If so, does it play when selected?
  6. Please make a copy of the chime file that won't play and rename it so that it has no special characters, eg: "mychime.mp3" (I noticed that you both have dashes in the chime filenames).
jchristianj commented 10 months ago

@nimroddolev I really appreciate your support. I will go through the steps tomorrow and inform about the results. Briefly reviewing the logs and your troubleshooting steps just now, one thing I noticed: The actual file name of the custom chime is

A320_tritone-ding-dong.mp3

In the non-working logs the file is named a320_tritone-ding-dong.mp3 (with lower-case letter a in the beginning) In the working logs the file is named A320_tritone-ding-dong.mp3 (upper-case letter A in the beginning, as it is actually named) Could this already be the culprit?

nimroddolev commented 10 months ago

I also noticed the lowercase change when reviewing my code changes, and thought about it being the case, but I tested two custom chimes (both the same mp3 but one named with capitals and the other all lowercase) and they both worked.

However: perhaps your setup is more case sensitive than mine? You can try the same approach and see if there's any difference with lowercase files.

jchristianj commented 10 months ago

However: perhaps your setup is more case sensitive than mine? You can try the same approach and see if there's any difference with lowercase files.

This, somehow, seems to be the case. Simply created a copy of A320_tritone-ding-dong.mp3 in same location but only with lowercase letters a320_tritone-ding-dong.mp3, installed v0.11.0 (non-beta) and now it is working when chime path is set to chime_path: /media/sounds/a320_tritone-ding-dong.mp3

nimroddolev commented 10 months ago

Great news!

I just released a new beta version, v0.11.1-beta3, which includes a fix for the lowercase bug. It would be great if you and @Wummeke could download the new version and report back if everything is working again.

Wummeke commented 10 months ago

Just tested it with Version v0.11.1-beta3 and got mixed results, which i can't explain.

I have 2 files in /media/sounds:

So, I'm all good now with your latest beta version! Thanks for your support and keep up the good work (y)

home-assistant_2024-01-08T18-36-03.665Z.log

nimroddolev commented 10 months ago

You can leave the corner šŸ¤£ I'm just glad it all worked out! Thank you both too for your help on this šŸ‘