# Playing audio files on remote machine and use their speakers - not the hosts'

**URL:** https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919
**Category:** General
**Created:** [16 November 2023 12:24 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919 "2023-11-16T12:24:14Z")
**Posts on this page:** 15
**Page:** 2

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [23 November 2023 10:49 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/21 "2023-11-23T10:49:12Z")

</div>

Looks like they are serious and have given fair warning 🙂

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/5/55473e473dc337601afa6f77f74f4ddc64ecf026.png)

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [23 November 2023 10:50 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/22 "2023-11-23T10:50:37Z")

</div>

☹

Drats

But I guess like so many things nowadays:

There are alternatives.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [23 November 2023 10:53 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/23 "2023-11-23T10:53:17Z")

</div>

If this is for TTS - I use the TTS ultimate node

> **[node-red-contrib-tts-ultimate](https://flows.nodered.org/node/node-red-contrib-tts-ultimate)**
>
> Transforms the text in speech and hear it using Sonos player or generate an audio file to be used with third parties nodes. Works with voices from Amazon, Google (without credentials as well), Microsoft TTS Azure, ElevenLabs.io TTS or your own voice....

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [23 November 2023 11:11 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/24 "2023-11-23T11:11:14Z")

</div>

I'm not sure if I can use that as I am not in the `Sonos` environment.

But I'll look at that and see if it may do what I need.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [23 November 2023 11:23 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/25 "2023-11-23T11:23:49Z")

</div>

The Sonos is just a red herring 🙂

Mines configured like this

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/2/d2a482e373f4821179d68c7d060052b96c346908.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/a/9acae65b755dcba16a643aed2a9f160d287608aa.png)

---

<div class="post-metadata">

### Author: ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)
#### Post date: [23 November 2023 11:44 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/26 "2023-11-23T11:44:19Z")

</div>

I note that you have to save the tts output to file before playing to the bluetooth speaker, so how is that file output from node red, as this was Trying\_to Learn's the issue with using Watson?

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [23 November 2023 13:14 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/27 "2023-11-23T13:14:29Z")

</div>

Sorry

here is my flow output

```auto
[{"id":"ded069953e574fc0","type":"ttsultimate","z":"d7c2e97da54dae65","name":"","voice":"en-GB","ssml":false,"sonosipaddress":"","sonosvolume":"20","sonoshailing":"0","config":"abf536dfafd7b1dd","property":"payload","propertyType":{},"rules":[],"playertype":"noplayer","speakingrate":"1","speakingpitch":"0","unmuteIfMuted":true,"x":515,"y":490,"wires":[["a2544bce9b62fd20"],[]],"l":false},{"id":"27d7e4a40f76b2e4","type":"file in","z":"d7c2e97da54dae65","name":"","filename":"filename","filenameType":"msg","format":"","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":780,"y":490,"wires":[["697f8556100b9244","1ad329619dc6e258","20d4ac3f43d3e5f8","61b937d9589ee3df","43b48eeb24035397"]]},{"id":"165dcd9abc84c14d","type":"change","z":"d7c2e97da54dae65","name":"","rules":[{"t":"set","p":"filename","pt":"msg","to":"filesArray[0]file","tot":"msg"},{"t":"set","p":"speech","pt":"msg","to":"filename","tot":"msg","dc":true},{"t":"change","p":"speech","pt":"msg","from":"/home/pi/.node-red/sonospollyttsstorage/ttsfiles/","fromt":"str","to":"","tot":"str"},{"t":"change","p":"speech","pt":"msg","from":"_en-GB01.mp3","fromt":"str","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":635,"y":490,"wires":[["27d7e4a40f76b2e4"]],"l":false},{"id":"a2544bce9b62fd20","type":"switch","z":"d7c2e97da54dae65","name":"payload is true","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":575,"y":490,"wires":[["165dcd9abc84c14d"]],"l":false},{"id":"abf536dfafd7b1dd","type":"ttsultimate-config","name":"TTS Service","noderedipaddress":"127.0.0.1","noderedport":"1980","purgediratrestart":"leave","ttsservice":"googletranslate","limitTTSFilenameLenght":"220"}]

```

---

<div class="post-metadata">

### Author: ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)
#### Post date: [23 November 2023 13:18 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/28 "2023-11-23T13:18:56Z")

</div>

But how does reading the file output it to a bluetooth speaker?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/3/234184e23a555365e577eab18e303d0a6cee65f0.png)

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [23 November 2023 13:30 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/29 "2023-11-23T13:30:24Z")

</div>

OK  
I was only posting to say I use the TTS ultimte node to do the text-to-speech conversion

I wasn't aiming to solve the whole issue 🙂

I'll back away quietly 🙂

---

<div class="post-metadata">

### Author: ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)
#### Post date: [23 November 2023 13:40 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/30 "2023-11-23T13:40:19Z")

</div>

I was wondering whether you had an alternative solution for output. The output from TTS is an mp3 in your flow, can it be output from TTS as a wav?

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [23 November 2023 19:42 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/31 "2023-11-23T19:42:11Z")

</div>

Thanks for the info on that node.

I am a bit stuck with how / where you set the voice though.

I am seeing the node config with the warning **Any changes in this means you have to restart node-red**

This is what I see though:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/9/99c90a8fdba35358f90bb4bdaeb0eaab080eda4a.png)

Which is similar to your second picture.

Thanks.

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [23 November 2023 19:44 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/32 "2023-11-23T19:44:04Z")

</div>

Though I am not at that stage yet, the `player` has other options.

I'm not at that page yet, but there may be options to make that part different and send a WAV or MP3 file out.

---

<div class="post-metadata">

### Author: ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)
#### Post date: [24 November 2023 13:55 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/33 "2023-11-24T13:55:04Z")

</div>

A simple setup using TTS ultimate node and ffplay (included if you have ffmpeg installed) working fine in my test setup. I can send text messages via MQTT and it is played fine on the remote computer

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/1/b178d263135ce3fb1ae5cd6ff67ba767fcad8ec4.png)

```auto
[{"id":"569773ae.930abc","type":"inject","z":"42439796e8ca77fd","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":160,"y":630,"wires":[["e066ce90.46f758"]]},{"id":"e066ce90.46f758","type":"function","z":"42439796e8ca77fd","name":"Via function","func":"// The simplest way\nmsg.payload=\"Benvenuti,Wilkommen,Wellcome!\";\nreturn msg;\n","outputs":1,"noerr":0,"x":300,"y":630,"wires":[["3d9635bc.53c14a"]]},{"id":"c272b47c.41e238","type":"inject","z":"42439796e8ca77fd","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":160,"y":670,"wires":[["2fcffdb7.1c76ea"]]},{"id":"2fcffdb7.1c76ea","type":"function","z":"42439796e8ca77fd","name":"Set volume","func":"// Set the Volume\nmsg.volume=\"60\"; // If not set, will take the volume from setting page\nmsg.payload=\"Benvenuti,Wilkommen,Wellcome!\";\nreturn msg;\n\n","outputs":1,"noerr":0,"x":300,"y":670,"wires":[["3d9635bc.53c14a"]]},{"id":"2bd6fd7f.9b9ae2","type":"inject","z":"42439796e8ca77fd","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":160,"y":710,"wires":[["aa3b6e42.669fc"]]},{"id":"aa3b6e42.669fc","type":"function","z":"42439796e8ca77fd","name":"Array of messages","func":"// Create an array of messages\nvar aMessages=[];\n// Add random messages\naMessages.push({volume:\"50\",payload:\"Benvenuti.\"});\n// Wheater in Italy\naMessages.push({volume:\"40\",payload:\"http://media.ilmeteo.it/audio/2020-12-23.mp3\"});\n// Add random messages\naMessages.push({volume:\"30\",payload:\"Cambia la tua voce nei settaggi.\"});\nreturn [aMessages];\n","outputs":1,"noerr":0,"x":320,"y":710,"wires":[["3d9635bc.53c14a"]]},{"id":"3e0d9b5c.fe01b4","type":"inject","z":"42439796e8ca77fd","name":"Hello World","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Ciao Mondo! Come stai?","payloadType":"str","x":180,"y":590,"wires":[["3d9635bc.53c14a"]]},{"id":"42e6fab4.e8d154","type":"comment","z":"42439796e8ca77fd","name":"Play text on Sonos. Single player or Group of players","info":"","x":290,"y":550,"wires":[]},{"id":"3d9635bc.53c14a","type":"ttsultimate","z":"42439796e8ca77fd","name":"","voice":"en-GB","ssml":false,"sonosipaddress":"192.168.1.109","sonosvolume":"30","sonoshailing":"0","config":"557d8082.eb5a8","property":"payload","propertyType":{},"rules":[],"playertype":"noplayer","speakingrate":"","speakingpitch":"","unmuteIfMuted":false,"elevenlabsStability":"","elevenlabsSimilarity_boost":"","x":540,"y":590,"wires":[["17d1372ec4e2fa56"],[]]},{"id":"11b198c7a57d0ab4","type":"debug","z":"42439796e8ca77fd","name":"debug 6","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1110,"y":750,"wires":[]},{"id":"17d1372ec4e2fa56","type":"switch","z":"42439796e8ca77fd","name":"","property":"filesArray","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":730,"y":660,"wires":[["b6292f5b6fb85a0f"]]},{"id":"b6292f5b6fb85a0f","type":"function","z":"42439796e8ca77fd","name":"function 6","func":"msg.payload = msg.filesArray[0].file;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":890,"y":660,"wires":[["9b644a0b5cb0fbc9"]]},{"id":"9b644a0b5cb0fbc9","type":"exec","z":"42439796e8ca77fd","command":"ffplay -nodisp -autoexit","addpay":"payload","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":1110,"y":660,"wires":[[],["11b198c7a57d0ab4"],[]]},{"id":"172b415bc9693c77","type":"mqtt in","z":"42439796e8ca77fd","name":"","topic":"TTS","qos":"2","datatype":"auto-detect","broker":"e284bf9.3fc124","nl":false,"rap":true,"rh":0,"inputs":0,"x":360,"y":800,"wires":[["3d9635bc.53c14a"]]},{"id":"557d8082.eb5a8","type":"ttsultimate-config","name":"googletranslate","noderedipaddress":"127.0.0.1","noderedport":"1980","purgediratrestart":"leave","ttsservice":"googletranslate","TTSRootFolderPath":""},{"id":"e284bf9.3fc124","type":"mqtt-broker","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

```

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [24 November 2023 20:07 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/34 "2023-11-24T20:07:45Z")

</div>

Thanks.

I seem to be missing a lot of things these days.

So I have `ffmpeg` installed on the machine and I have a similar thing set up so I can send words to be said on the existing `tts` system.

I import your flow and deploy it.  
Press the `Hello world` button. SILENCE.

Sorry, but I'm not understanding why it isn't doing anything.

As a check: I try it on THIS machine (the big / powerful NUC - which also has `ffmpeg` installed)  
Run it and also SILENCE.

The audio on this machine is working also.  
So I don't understand what I am missing.

This is a screenshot of what I see (if the `debug` is active) and I press the button.

(ignore the top few messages shown)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/1/91ffcfb53624da3c9e79813889949071a840e82e.png)

P.S.  
Ok, on one machine I am seeing a `config not set` and it is pointing to the `tts` node.  
But not on the second machine.

# UPDATE:

Changed the `exec` node to the one that was working with the other TTS, and now it is talking to me.

(I'll call it quits here. I fear this has dragged on far too long now.)  
I've got the TTS working - other problems exist but they are outside the scope of this thread.

THANKS TO ALL WHO POSTED!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [8 December 2023 20:08 UTC](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919/35 "2023-12-08T20:08:02Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/playing-audio-files-on-remote-machine-and-use-their-speakers-not-the-hosts/82919.md?page=1)
