Good day,
It seems that I couldn't get how to realize my idea.

My Behringer USB mixer can play the USB audio from host to master OR capture 
the master to USB. While playing the audio from USB to master there a silence 
on USB capture.
So if there silence on USB Input - we play radio.
If there some signal on USB input - we dump audio to file.

My current script now just detects the silence as it should. I need to play 
radio to ALSA OUT ONLY when silence on ALSA IN detected. When signal on ALSA IN 
detected - I need to dump the signal from ALSA IN to file. I was trying do it 
different ways, but kindly asking for Your help.


set("tag.encodings",["UTF-8"])
set("log.stdout", true)
set("log.file.path","/var/log/liquidsoap/radio.log")
set("log.file",true)
set("log.level",5)
set("init.daemon.pidfile.path","/var/run/liquidsoap/radio.pid")
set("init.daemon",true)

radio = input.http ( "http://stream.creo.net.ua/ecstazi.m3u"; )
radio = mksafe(radio)
usb = input.alsa (device="hw:1,0")
usb = mksafe(usb)

def silence()
        log ("SILENCE")
end

usb = on_blank (silence, usb)

live = radio

output.alsa(device="hw:1,0",live)
output.file(%mp3.fxp, "/tmp/hop.mp3", usb)

BR
Cyril Mamai
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to