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
25 stars 5 forks source link

Select Main Player via msg #5

Closed TheOlli-knx-forum-de closed 3 years ago

TheOlli-knx-forum-de commented 3 years ago

Hi Massimo, do you think it's possible in one of the next versions to integrate a variable "msg.mainplayer" to select the Player via msg? I would like to use your node in a subflow. Therfore it's neccessary to select the player via the input o the subflow.

BR

Olli

Supergiovane commented 3 years ago

Hi Olli I’ll let you know.

Supergiovane commented 3 years ago

Anyway, for me, subflows are a total no-go. I’ll never use it again.

Supergiovane commented 3 years ago

Hi Olli Are you able to test this file? Please copy the attached zip's content, into .node-red/node_modules/node-red-contrib-tts-ultimate/ttsultimate folder and restart node-red.

Then, put this code into a function node and link it's output to the tts-ultimate, according to your scenario and by changing the IP with your sonos ip:

Node-RED

If you don't have group of players:

var config= {
    setMainPlayerIP:"192.168.1.109" 
};
msg.setConfig = config;
return msg;

If you have group of players:

var config= {
    setMainPlayerIP:"192.168.1.109", 
    setPlayerGroupArray:[
        "192.168.1.110",
        "192.168.1.111",
        "192.168.1.112"
    ]
};
msg.setConfig = config;
return msg;

ttsultimate.js.zip

TheOlli-knx-forum-de commented 3 years ago

 

Hi Massimo,

 

works perfectly for me because I use fixed ip-adresses for all fixed devices.

I've tested it with four different players.

 

 

Thank you!

 

 

 

 

Olli

 

Gesendet: Sonntag, 10. Januar 2021 um 11:27 Uhr Von: "Supergiovane" notifications@github.com An: "Supergiovane/node-red-contrib-tts-ultimate" node-red-contrib-tts-ultimate@noreply.github.com Cc: "TheOlli-knx-forum-de" bodensee@web.de, "Author" author@noreply.github.com Betreff: Re: [Supergiovane/node-red-contrib-tts-ultimate] Select Main Player via msg (#5)

 

Hi Olli Are you able to test this file? Please copy the attached zip's content, into .node-red/node_modules/node-red-contrib-tts-ultimate/ttsultimate folder and restart node-red.

Then, put this code into a function node and link it's output to the tts-ultimate, according to your scenario:

If you don't have group of players:

If you have group of players:

var config= { setMainPlayerIP:"192.168.1.109" }; msg.setConfig = config; return msg;

If you have group of players:

var config= { setMainPlayerIP:"192.168.1.109", setPlayerGroupArray:[ "192.168.1.110", "192.168.1.111", "192.168.1.112" ] }; msg.setConfig = config; return msg;

ttsultimate.js.zip

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Supergiovane commented 3 years ago

Good Olli Tomorrow i’ll roll out the new version an i’ll update the samples.