cipnt
April 25, 2023, 3:21pm
1
I was looking for a text-to-speech TTS voice generator alternative that is better than the default google_translate which frankly is quite poor quality/sounds very robotic.
After some googling and testing various online demos and checking how they call the service in the backend using Chrome dev tools, I came across murph.ai which not only is very natural sounding and high quality, but also uses a very simple URL request method.
Examples:
https://murf.ai/Prod/anonymous-tts/audio?name=en-US-nate
https://murf.ai/Prod/anonymous-tts/audio?name=en-UK-hazel
https://murf.ai/Prod/anonymous-tts/audio?name=en-CA-ethan
My question now is how do I enable caching for this, similar to how google_translate caches files in the TTS folder, so that I do not make a request to their servers every time? As it is, without caching, this would probably not work without an internet connection and it risks putting too much load on their servers and potentially closing this method / api.
You can try it yourself in the Dev Tools – Services
service: media_player.play_media
target:
entity_id: media_player.[your_media_player]
data:
media_content_id: "https://murf.ai/Prod/anonymous-tts/audio?name=en-CA-ethan&text=Hello.%20I%20can%20say%20anything%20you%20want"
media_content_type: provider
metadata:
title: Hello. I can say anything you want
thumbnail: "https://brands.home-assistant.io/_/homeassistant/logo.png"
media_class: app
cipnt
April 28, 2023, 3:43pm
2
Unfortunately, the above is not sustainable long-term without a caching solution.
So what I ended up doing is to continue using the default google_translate TTS in automations and manually replace the cache files stored in /config/tts
These don’t seem to ever be overwritten/refreshed so looks safe long term and it’s a straightforward drop-in replacement from murf.ai (ie no need to convert the files)
Hope this helps anyone looking for better voice alerts
Suggestions on how to enable caching are still welcome
So where did you get the voices to put into the folder ? Did you have to purchase Murf.ai first ? A step by step would be nice
cipnt
April 27, 2024, 6:15pm
4
You don’t need a subscription, you can use the Murf.ai preview tool to generate the files:
Go to murf.ai/text-to-speech
Before anything else, open the Developer Tools of your browser, go to Network tab and clear the results
Type in your desired text into the Murf preview page and chose your language and hit play
In the Network tab of Dev Tools an audio/media file should be logged; right click it and choose Open in new tab
from there you should be able to save your audio file
Alternatively, you can simply edit the url of the media file to whatever text you desire, just replace spaces with %20
https://murf.ai/Prod/anonymous-tts/audio?name=en-US-nate&text=Hi %20there! %20What %20would %20you %20like %20me %20to %20say?
Nick4
(Nick)
April 27, 2024, 8:03pm
5
What about HA’s own Piper (Wyoming)
bbcelly
(Pavel Cvetler)
December 8, 2024, 10:14am
6
Hello,
thanks for sharing. I just created Custom Murf TTS integration using this anonymous endpoint. Feel free to check it out.
The MurfAI TTS component for Home Assistant makes it possible to use the MurfAI API to generate spoken audio from text. This can be used in automations, assistants, scripts, or any other component ...
1 Like
cediqqu
(César Díaz Cueva)
December 8, 2024, 2:16pm
7
Hello,
How to set another Language like Spanisch?
Thanks!!
cipnt
December 8, 2024, 5:53pm
8
Great stuff!
Instead of creating different entities for each AI voice model, couldn’t this be an option in the service call?
Yzord
(Yzord)
March 7, 2025, 4:08pm
9
I have integrated this, but when i want to select it as my TTS service it is grayed out. Also i don’t see where i can paste my API key.
Teiruzu
(Teiruzu)
March 17, 2025, 10:26pm
11
Did you find a way to do it?