Supergiovane / node-red-contrib-tts-ultimate

This node transforms a text into a speech audio. You can hear the voice natively through Sonos or external players.
MIT License
22 stars 5 forks source link

Route message through node and filename issue #54

Closed ttww closed 2 years ago

ttww commented 2 years ago

Hello,

when using this node to generate only files (to send it later to Homepods via node_airtunes2) it would be nice to pass through message parts to the output (eg. msg.myProperty is transferred to output#1, additionally to the fileArray). This would allow to transfer information to attached nodes.

Input:

{
   "payload":"Hello World",
   "myProperty":"AAAAAAAAA",
}

Output Pin 1:

{
   "payload":true,
   "myProperty":"AAAAAAAAA",
   "filesArray":[
      {
         "file":"/home/nodered/.node-red/sonospollyttsstorage/hailingpermanentfiles/Hailing_ComputerCall.mp3"
      },
      {
         "file":"/home/nodered/.node-red/sonospollyttsstorage/ttsfiles/Hello World-EN.mp3"
      },
   ],
   "_msgid":"8b6b22a45dfd5236"
}

Remark: It would be better to mask the filename because of special characters. Spaces (" ") inside the text makes it really ugly to pass it to the exec-node (beside from maybe security related issues). I suggest to replace all none ASCII with "_" and add a checksum to the end. This should keep the file name readable and safe:

      {
         "file":"/home/nodered/.node-red/sonospollyttsstorage/ttsfiles/Hello_World-EN.AF543F8012.mp3"
      },

Remark II: Great node, thanks for your work!

Supergiovane commented 2 years ago

Ciao, i'm working on that. Should be out as soon as finished. Please star my node if you find it useful. Thanks.

Supergiovane commented 2 years ago

V. 1.0.40 is out. The README on github has been updated as well.