Discussion:
[Savonet-users] Output status information
Nicholas Vrtis
2017-03-12 23:17:25 UTC
Permalink
This is just a test script, but if I do something like this:

#!/home/liquidsoap/.opam/system/bin/liquidsoap
set("log.file",false)
set("log.stdout",true)
set("server.telnet", true)
# Need to use external address to listen on, so we can talk from external
# set("server.telnet.bind_addr","192.168.0.140")
set("server.telnet.bind_addr","192.168.0.134")
# Don't time out the telnet server
set("server.timeout",-1.0)
alsaDevice = ref "hw: Set"
s = single(id='theSingle',"FirstTest.mp3")
# This will give liquidsoap something to do while we wait for the telnet
commands
thedummy=output.dummy(id='dummyAudio',blank())
thelocal = output.alsa(id='localAudio', device="#{!alsaDevice}",
fallible=true,s)

Then in telnet I have commands which will 'list' all the outputs that have
been created.

I can also issue the telnet commands:
localAudio.status
localAudio.stop
localAudio.start

I have been beating my head trying to find how to get the same information
within a liquidsoap script.

How do I get a list of all the currently created outputs?

How can I tell if they are running or not?

How can I stop/start them (the telnet command localAudio.stop is different
than source.shutdown(thelocal). Shutdown destroys the output, but stop
simply stops sending bits out.

I must be looking at the wrong spots, but I have been pouring over the API
for quite a while and have not found anything to do this.

Thanks. Nick
Romain Beauxis
2017-03-22 18:52:42 UTC
Permalink
Hi Nicholas,
Post by Nicholas Vrtis
#!/home/liquidsoap/.opam/system/bin/liquidsoap
set("log.file",false)
set("log.stdout",true)
set("server.telnet", true)
# Need to use external address to listen on, so we can talk from external
# set("server.telnet.bind_addr","192.168.0.140")
set("server.telnet.bind_addr","192.168.0.134")
# Don't time out the telnet server
set("server.timeout",-1.0)
alsaDevice = ref "hw: Set"
s = single(id='theSingle',"FirstTest.mp3")
# This will give liquidsoap something to do while we wait for the telnet commands
thedummy=output.dummy(id='dummyAudio',blank())
thelocal = output.alsa(id='localAudio', device="#{!alsaDevice}",fallible=true,s)
Then in telnet I have commands which will 'list' all the outputs that have been created.
localAudio.status
localAudio.stop
localAudio.start
I have been beating my head trying to find how to get the same information within a liquidsoap script.
How do I get a list of all the currently created outputs?
How can I tell if they are running or not?
How can I stop/start them (the telnet command localAudio.stop is different than source.shutdown(thelocal). Shutdown destroys the output, but stop simply stops sending bits out.
I must be looking at the wrong spots, but I have been pouring over the API for quite a while and have not found anything to do this.
If you are confident with using the server, then you should be able to
execute the same calls in your script:
server.execute("localAudio.status")
server.execute("localAudio.start")

etc..

Romain
Nicholas Vrtis
2017-03-22 20:04:20 UTC
Permalink
Thank you. ! I didn't connect the server meant the same server that Telnet
uses. This should get me going. Thanks a lot
Post by Romain Beauxis
Hi Nicholas,
Post by Nicholas Vrtis
#!/home/liquidsoap/.opam/system/bin/liquidsoap
set("log.file",false)
set("log.stdout",true)
set("server.telnet", true)
# Need to use external address to listen on, so we can talk from external
# set("server.telnet.bind_addr","192.168.0.140")
set("server.telnet.bind_addr","192.168.0.134")
# Don't time out the telnet server
set("server.timeout",-1.0)
alsaDevice = ref "hw: Set"
s = single(id='theSingle',"FirstTest.mp3")
# This will give liquidsoap something to do while we wait for the telnet
commands
Post by Nicholas Vrtis
thedummy=output.dummy(id='dummyAudio',blank())
thelocal = output.alsa(id='localAudio', device="#{!alsaDevice}",
fallible=true,s)
Post by Nicholas Vrtis
Then in telnet I have commands which will 'list' all the outputs that
have been created.
Post by Nicholas Vrtis
localAudio.status
localAudio.stop
localAudio.start
I have been beating my head trying to find how to get the same
information within a liquidsoap script.
Post by Nicholas Vrtis
How do I get a list of all the currently created outputs?
How can I tell if they are running or not?
How can I stop/start them (the telnet command localAudio.stop is
different than source.shutdown(thelocal). Shutdown destroys the output,
but stop simply stops sending bits out.
Post by Nicholas Vrtis
I must be looking at the wrong spots, but I have been pouring over the
API for quite a while and have not found anything to do this.
If you are confident with using the server, then you should be able to
server.execute("localAudio.status")
server.execute("localAudio.start")
etc..
Romain
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
https://lists.sourceforge.net/lists/listinfo/savonet-users
Continue reading on narkive:
Loading...