Hey everyone, I just wanted to share my recent success with customizing the voice for all my TTS notifications in Node-RED. I’ve been trying to figure this out for a while now, and I thought I’d document my process in case anyone else is tackling a similar challenge.
So, the goal was to use a single node to change the voice for all my text-to-speech notifications. I’ve set up TTS already, but I wanted more flexibility in how notifications sounded. I started by experimenting with the Change node to pass different voice parameters into my TTS Call Service node. I tried using both Global and Msg variables, but kept running into issues with the syntax. It was frustrating because I knew the solution was simple, but I just couldn’t get it right.
After a lot of trial and error, I finally figured it out! Here’s what worked for me:
- Using the Change Node: I set up the Change node to modify the
message.payload.voiceproperty. This allows me to dynamically change the voice without hardcoding it in the TTS node. - Testing Different Voices: I tested several voices to see which ones were supported and sounded good. Some voices worked perfectly, while others had unexpected results.
- Global Variables for Consistency: I created a global variable to store the default voice setting. This makes it easy to switch voices across multiple flows without modifying each TTS node individually.
I documented my config below in case anyone wants to replicate this setup. It’s been a game-changer for my notifications, and I love how consistent and customizable everything is now.
If anyone has tips or alternative approaches, I’d love to hear them! Happy coding everyone! ![]()