Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Looking for control Foobar2000 by TCP (can be telnet) or http commands (Read 1587 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Looking for control Foobar2000 by TCP (can be telnet) or http commands

Hi, thanks for your precious suggestions!
searching around I've found foo_controlserver (https://github.com/audiohead/foo_controlserver) but this plugin seams old and not working with 2.1.6 32bit, do you have any solution? Thank you a lot!

My goal is to drive Foobar by Node Red, load a playlist and play it, adjust volume


Re: Looking for control Foobar2000 by TCP (can be telnet) or http commands

Reply #2
thanks! Looks good, I?ve to test it. Reading API I haven't found how to change volume, you know?


Re: Looking for control Foobar2000 by TCP (can be telnet) or http commands

Reply #4
I haven't used the API directly, but as the webclient has a volume control, the plugin appears to have an API. Also: https://github.com/hyperblast/beefweb/blob/master/docs/player-api.yml#L752-L764

Mate, thank you for your kind help :) actually I?m not good with http commands and I have no ide how to send such parameter by node red, can you please give me an idea?
I've found out how to clear a playlist and play/stop, but I also I need to know how add a playlist.. I've tried with http://127.0.0.1:8880/api/playlists/0/add/:radio_alternative.m3u: but didn't work. Thanks

 

Re: Looking for control Foobar2000 by TCP (can be telnet) or http commands

Reply #5
I hope somebody can help me, thanks :)

Re: Looking for control Foobar2000 by TCP (can be telnet) or http commands

Reply #6
I am totally unfamiliar with Node Red.

I am totally guessing that below info might help to fill out the Node Red screenshot you posted.

1. Method = POST
2. URL = http://111.222.111.222:8880/api/player             (please change to the correct IP & Port)
3. Header = {'Content-Type': 'application/json'}
4. Body = { volume: -90, isMuted: false }                           (in this example, the volume is -90dB)

If I remember correctly, you cannot POST volume increment/decrement. Need to read the current volume, do the math, then POST the absolute volume. It has been a few months since I did the java scripting. You might also wanna try asking ChatGPT to help. ChatGPT was quite useful to me for JavaScript.

Alternatively, you might want to try my "read only" remote controller to control the volume.
https://hydrogenaud.io/index.php/topic,126264.0.html

Re: Looking for control Foobar2000 by TCP (can be telnet) or http commands

Reply #7
Hi mate, thank you! you solved my problem :)
For who may like to do the same, with Node Red is just necessary to send to HTTP rrequest node an msg.payload object with values:
payload: object
volume: -2.5
isMuted: false
Be careful as the volume values are expressed on dB, -3 means about 90% of signal
To get info from Foobar and know the playng volume you'll need to send a msg.payload with property volume, in my case "volume":true worked to get a full answer about the status of player, you will better parse result on JSON, you will have a msg.player.volume.value data.

There is a way to change volume sotfly? or we need a routine and send increasing/decreasing values?

Re: Looking for control Foobar2000 by TCP (can be telnet) or http commands

Reply #8
https://bitbucket.org/oblikoamorale/foo_httpcontrol/wiki/Home

Re: Looking for control Foobar2000 by TCP (can be telnet) or http commands

Reply #9
Thanks for link, I've spent some time on beefweb and I'll stay on that one.
I've learned how to play a playlist entry, simply open the link:
http://127.0.0.1:8880/api/player/play/p1/1
where p1 is playlist 1 (it may start from zero, discover it from an output, to get the output I used the volume:true as described above), and 1 is the second track (the first is 0).