Comments (12)
Hi @dbullendsl. I'm sorry to hear you're having issues.
Thank you for the detailed log and the list of your troubleshooting steps!
I think that your issue might be due to an incorrect public mp3 folder path in the integration's configuration.
Can you please check that the public mp3 folder path is a full path and not relative?
You can access the integration's configuration by navigating to Settings
--> Devices & services
--> Chime TTS
--> CONFIGURE
from chime_tts.
I thought of that too and did change it at one time to /homeassistant/www/chime_tts I also changed it to /local/chime_tts but that didn't change anything either.
If I manually create the /www/chime_tts folder and drop a known good mp3 into it I can reference it from the outside with a browser.
I've set things back to the default and here's a screen shot.
'''
'''
I also noticed that even though the chime_tts.play function isn't expected to run with Amazon devices that it also doesn't produce any mp3 output.
from chime_tts.
As I’m not familiar with your setup I can’t know what are the correct paths are but I still think that the lack of mp3 files is due to an issue with the paths, probably for both the service calls.
Note that the MP3s generated from the chime_tts.say
service only persist if the cache parameter is set to true.
from chime_tts.
ok, I'll check that
from chime_tts.
I think I found the problem, by executing the chime_tts:say_url function in the developer's console I get a return result of
url: https://[server.url]/local/chime_tts/zfijllg7.mp3
but I think the result should be https://[server.url]/www/chime_tts/zfijllg7.mp3
Elsewhere in comments in other issues there were instructions to make sure that /local pointed to /media, but that's not a public path for web connections. From running the chime_tts:say fuction with the cache parameter set to true results from the TTS service end up in /media/sounds/temp/chime_tts which is the same as /local/sounds/temp/chime_tts and is not accessible externally. Your code should then move the result to /homeassistant/www/chime_tts which would be accessible as https://[server.url]/www/chime_tts/tts_file.mp3
from chime_tts.
You described exactly what the code does (chime_tts.say
saves to media
and chime_tts.say_url
saves to www
).
In Home Assistant the www
folder is accessible publicly as https://[server.url]/local/ so the URL from your last comment is correct. The issue is that the file is not being saved in the right folder, and therefore cannot be found at that address.
I can confirm that it works correctly in both my docker development environment and my HAOS Raspberry Pi 4 production environment.
It is for these reasons that I feel the problem lies in the public mp3 folder path defined in your configuration.
from chime_tts.
Could you please try setting the public mp3 folder path to: /config/www/chime_tts
?
from chime_tts.
Excellent! That was it.
the intigration is working and I'm getting the mp3 in the www/chime_tts folder, and can paste the URL into a browser and it'll play.
Amazon is still throwing an error but I've seen that before when the audio file didn't match Amazon's specifications, so it's not a problem with the integration.
If you've got any suggestions on fixing that I'd appreciate it. Can the options field be used to do anything like calling ffmpeg to format the output?
from chime_tts.
I’m glad it is now working for you!
I would be happy to add support for encoding with ffmpeg. I can add a checkbox specifically for Amazon’s requirements and also a text field to pass ffmpeg parameters for other use cases.
from chime_tts.
That would be great, meanwhile I do have it working using a shell command to ffmpeg with the parameters specified on Amazon's AWS SML page. I'll post everything here soon.
from chime_tts.
here's my solution, not completely refined, but it works.
It consists of 3 parts, 2 scripts and a shell command.
The set up looks like this:
Edit configuration.yaml to add the following
# Add ffmpeg to the configuration to format audio
# output to play on Amazon Echos
ffmpeg:
shell_command:
amazon_level_up: ffmpeg -i '{{input_url}}' -y -ac 2 -codec:a libmp3lame -b:a 48k -ar 16000 -write_xing 0 '{{output_url}}'
the first script calls chime_tts.say_url, then sends the output to the shell command with another script
alias: aa chime
sequence:
- service: chime_tts.say_url
data:
chime_path: bells
end_chime_path: bells 2
delay: 0
final_delay: 0
tts_playback_speed: 100
message: "{{message}}"
tts_platform: google_translate
cache: false
response_variable: chime_tts
- service: script.aa_ffmpeg_convert
data:
input_url: "{{chime_tts.url}}"
output_url: /config/www/chime_tts/output.mp3
- service: notify.alexa_media
data:
message: |
<audio src="https://[your_server.url]/local/chime_tts/output.mp3"/>
target:
- media_player.office_echo_dot
data:
type: tts
mode: single
fields:
message:
selector:
text: null
name: message
second script:
alias: aa ffmpeg_convert
sequence:
- service: shell_command.amazon_level_up
data:
input_url: "{{input_url}}"
output_url: "{{output_url}}"
mode: single
fields:
input_url:
selector:
text: null
name: input_url
required: true
output_url:
selector:
text: null
name: output_url
required: true
I probably could have gotten by with one script, but I decided to split out the ffmpeg part in case I needed it for some other use case when sending audio to amazon echoes.
the only variables are the input message and the resultant url supplied by chime_tts.say_url, the output.mp3 from the shell command is overwritten each time it's run so is a fixed name. I'll be changing the inputs so that I can supply the sounds to play before / after the announcements. Haven't tried changing the voice yet, but for now this is it.
Thanks for the assistance, great idea.
from chime_tts.
Hey @dbullendsl, I added a new FFmpeg Arguments
parameter to the chime_tts.say
and chime_tts.say_url
services, allowing you to list the conversion parameters you want to use for an FFmpeg conversion on the generated audio:
I created a discussion here, and it would be great if you could please test it out and let me know if it works for your use case.
I created a new beta version with the changes. Please follow these steps to install it:
- Open the Chime TTS repository in HACS
- Click on the
⋮
button in the top right - Select the
↻ Redownload
option - Enable the
Show beta versions
option - Select version
v0.10.2-beta1
from the updated version drop-down list
from chime_tts.
Related Issues (20)
- Chime TTS: Say - Audio cut off HOT 3
- Configuration Screen Causes Home Assistant to Freeze HOT 19
- Setting `cache: true` causing 'NoneType' object has no attribute 'get' error HOT 5
- Warnings in HA Core log on startup HOT 9
- Service call times out. Announce stops working until HA restart. HOT 2
- doesn't play anything HOT 2
- 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 12
- 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 2
- Announcements to resume previous playback after chime finishes on Google Cast
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.