Comments (11)
Also, I absolutely love this integration. Thanks again for all your help and for making and maintaining it.
from chime_tts.
Hey @DanDixon, thanks for the kind words π
The chime_tts.say_url
was added specifically to save the generated mp3 file in a publicly facing folder that is accessible form the internet. As you found out, you can change the default path to a local & non-public folder (but that defeats the purpose).
I tried editing the configuration, but that wasn't saving for me (a separate issue).
When you enter a folder path in the configuration, Chime TTS tests to see if it can write to that folder, and if it can't it returns an error. Is this the issue you're having when trying to change the configuration?
If you are not able to save a folder under the /www folder path, then it seems the issue here is that Chime TTS doesn't have access your www
folder specifically.
Have you added a www
folder to your config
folder? See if adding the folder makes a difference.
Otherwise I will need more information. Could you please enable debug logs for Chime TTS? This way I might be able to understand what the issue is and how to solve it.
- Turn on debug logging:
service: logger.set_level
data:
custom_components.chime_tts: debug
-
Call the service chime_tts.say_url again (with the standard default folder path).
-
Check your log messages in Home Assistant:
https://{YOUR_HOME_ASSISTANT_ADDRESS}:8123/config/logs?filter=chime_tts
and click LOAD FULL LOGS
from chime_tts.
When you enter a folder path in the configuration, Chime TTS tests to see if it can write to that folder, and if it can't it returns an error. Is this the issue you're having when trying to change the configuration?
It was flickering and giving me no error, but just reset the text back like it was.
I'm not sure what I did, but this is not happening to me now.
Which I am now, so not sure what happened.
As an asdie:
If you type something into Custom 1 and then try and delete it, it reverts back. Doesn't seem to be a way to reset those back to blank.
If you are not able to save a folder under the /www folder path, then it seems the issue here is that Chime TTS doesn't have access your www folder specifically.
Have you added a www folder to your config folder?
Yes
Unfortunately, I still wasn't able to get it to write to:
/config/www/chime_tts
(I made a folder there)
from chime_tts.
I still think the main issue is that your HA instance can't write to the folder you specified as the public folder for chime_tts.say_url
. Perhaps it has to do with something in your particular setup? Which version of HA are you running and on what hardware?
Regarding the other issue you reported for custom chime paths:
Doesn't seem to be a way to reset those back to blank.
It's an issue with Home Assistant - if the textfield is blank it reverts to using previous value. A workaround is to you use a space " " as the value, which will reset the value. It's not the most elegant solution, but this bug is beyond the scope of Chime TTS. If you like you can open a bug with the Home Assistant developers.
from chime_tts.
The chime_tts.say_url was added specifically to save the generated mp3 file in a publicly facing folder that is accessible form the internet. As you found out, you can change the default path to a local & non-public folder (but that defeats the purpose).
Aside from my original question, I'll share why I'm using say url:
I have a popup that appears on my dashboards when a message is played. Being able to generate the sound file separately from playing it lets me wait to show the popup at the same time as the file is played (instead of showing the popup with the message and there being a several second delay before it starts playing).
Does that use case match your vision for the feature?
I setup a time poem to be read aloud every so often (inspired by this Kickstarter).
But these take about 7 seconds before they start playing. Another use of say_url (that I have yet to implement) would be to generate the files in advance (even 1 minute before) so when it was requested there would be less delay and it could start playing exactly at the start of the event in question.
Here's what my dashboard looks like with a time poem message:
from chime_tts.
I never considered your use case or any other which required delayed/scheduled playback of the audio generated by Chime TTS. The time poem is a nice idea π
I released a new beta, v0.13.1-beta13 (I'm aiming for a record number of beta releases π€¦ββοΈ) which adds support for specifying a local folder path for chime_tts.say_url
generated audio in addition to a public directory. With this change you can now set a local folder path as the public folder path in the configuration, and the url output from chime_tts.say_url
will work for either scenario - adding the external URL prefix for files located inside the public www
folder, or the valid config
local path.
Let me know if it's working for you.
from chime_tts.
Cool. That works.
Although, I don't think I fully understand how the paths work in Home Assistant as I still had to modify the output url in order to make it work:
In v0.13.1-beta13:
In the configuration for chime_tts I set the folder path to:
/media/chime_tts/
Running chime_tts.say_url generates a chime_tts.url that looks like this:
/media/chime_tts/jx9x352u.mp3
And before playing the file to my Google minis I did this in the play script:
variables:
mediafile: |
{{ chime_tts.url | replace('/media/','media-source://media_source/local/') }}
The mediafile variable now looks like this:
media-source://media_source/local/chime_tts/jx9x352u.mp3
I was struggling because I had it like this and it didn't work:
media-source://media_source/local/media/chime_tts/jx9x352u.mp3
And then I play the file like this:
service: media_player.play_media
data:
media_content_id: "{{ mediafile }}"
media_content_type: music
target:
entity_id:
- media_player.minis_linked
Perhaps there's a more elegant solution. Either way, it works, so thank you again!
from chime_tts.
Perhaps the best solution would be for chime_tts.say_url
to return both the local file path and the media_content_id (which is what you did with your script), eg:
media_content_id: media-source://media_source/local/media/chime_tts/f_21f4mz.mp3
filepath: /media/chime_tts/f_21f4mz.mp3
duration: 1.23
success: true
from chime_tts.
That would useful.
I'll note that your example media_content_id:
media-source://media_source/local/media/chime_tts/f_21f4mz.mp3
But, at least in my case it should be:
media-source://media_source/local/chime_tts/f_21f4mz.mp3
Thank you again!
from chime_tts.
Using v1.0.0 2024-04-02
I had to modify my scripts to work with the new changes and this is working great.
(I had to change them to use media_content_id
instead of url
)
Thank you!
from chime_tts.
Happy to hear itβs working for you π
from chime_tts.
Related Issues (20)
- OpenAI TTS API Key HOT 1
- Plays default chime AND custom chime HOT 3
- Add individual volume on each segment HOT 1
- Warnings in Log "Detected blocking call to open inside the event loop by custom integration 'chime_tts' " HOT 1
- not working if template containes round or int or the likes HOT 8
- chime_tts.say_url "...does not support 'response_variable'..." HOT 1
- Error "No TTS platforms were detected" when saving any configuration HOT 3
- Stopped working since a few days HOT 12
- Latest Update ignores volume setting when announce is set true HOT 3
- Every ChimeTTS use through MPD integration results in ban attempt HOT 3
- chime_tts.say_url eventually fails and won't continue until Home Assistant is restarted HOT 18
- Use public URL path with cast and Sonos media_players instead of the media content id HOT 8
- Unable to save reference to cache in v1.1.4-beta4 HOT 3
- Announcements to resume previous playback after chime finishes on Google Cast HOT 1
- Piper voice support HOT 5
- Duplicate keys for cache options in clear_cache services.yaml HOT 1
- Setting the voice only works if also setting the language
- Canceling the script execution causes the service to stop working until restart
- Missing dependency `aiofiles` HOT 2
- Error after Updating to 2024.9.0b1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chime_tts.