I have a flow to remind my son to do different things in the morning to get ready for school. At certain times of the morning I have a ChatGPT node create a message. The message is placed into a variable and then set to msg.payload.alexa. Then it is announced through Alexa. Everything works fine but I would like to adjust the voice.
I found an example of how to change the voice. It uses an inject node to start it off and then goes to a template node. The format of the template node is Mustache.
[{"id":"f1a56049.b84ac","type":"tab","label":"SSML","disabled":false,"info":""},{"id":"e504b1c.8fb8e5","type":"inject","z":"f1a56049.b84ac","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":60,"wires":[["92a27055.927e2"]]},{"id":"92a27055.927e2","type":"template","z":"f1a56049.b84ac","name":"Good Morning","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<speak> \n<s><voice name=\"Celine\">Bonjour!</voice></s>\n<s><voice name=\"Hans\">Guten Morgen!</voice></s>\n<s><voice name=\"Amy\">Good Morning!</voice></s>\n<s><voice name=\"Giorgio\">Buongiorno!</voice></s>\n<s><voice name=\"Enrique\">¡Buenos días!</voice></s>\n</speak>","output":"str","x":260,"y":60,"wires":[["e7a8d82e.baf3e8"]]},{"id":"1ce26b01.0359b5","type":"template","z":"f1a56049.b84ac","name":"Effects","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<speak>\n<prosody volume=\"x-loud\">This is louder.</prosody>\n<prosody volume=\"x-soft\">This is quieter.</prosody>\n<prosody rate=\"50%\">This is slow.</prosody>\n<prosody rate=\"150%\">This is fast.</prosody>\n<prosody pitch=\"-33.3%\">This is deep.</prosody>\n<prosody pitch=\"+50%\">This is high.</prosody>\n<amazon:effect name=\"whispered\">This is whispering.</amazon:effect>\n</speak>","output":"str","x":230,"y":100,"wires":[["e7a8d82e.baf3e8"]]},{"id":"c30b0f6f.4a30e","type":"inject","z":"f1a56049.b84ac","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":100,"wires":[["1ce26b01.0359b5"]]},{"id":"e7a8d82e.baf3e8","type":"alexa-remote-routine","z":"f1a56049.b84ac","name":"","account":"","routineNode":{"type":"speak","payload":{"type":"ssml","text":{"type":"msg","value":"payload"},"devices":[]}},"x":460,"y":100,"wires":[[]]},{"id":"f459218f.47a8f","type":"template","z":"f1a56049.b84ac","name":"Time and Date","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<speak>\n Time 08:30.\n Duration <say-as interpret-as=\"time\">12'3\"</say-as>.\n Date <say-as interpret-as=\"date\" format=\"dmy\">28/02/2020</say-as>.\n</speak>","output":"str","x":260,"y":140,"wires":[["e7a8d82e.baf3e8"]]},{"id":"7771dc17.c0ec74","type":"inject","z":"f1a56049.b84ac","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":140,"wires":[["f459218f.47a8f"]]}]
How would I apply these changes to the message?
<speak>
<prosody volume="x-loud">This is louder.</prosody>
<prosody volume="x-soft">This is quieter.</prosody>
<prosody rate="50%">This is slow.</prosody>
<prosody rate="150%">This is fast.</prosody>
<prosody pitch="-33.3%">This is deep.</prosody>
<prosody pitch="+50%">This is high.</prosody>
<amazon:effect name="whispered">This is whispering.</amazon:effect>
</speak>
This is Amazon’s page on how to make changes.