Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Script to run liquid soap from a command line. This will connect to the
- # local icecast server streaming out the line in from the sound card.
- #
- # Line in is passed through liquid soaps compressor and limiter (via jack)
- # before being sent to the stream.
- #
- # We're setting up a mono and stereo feed separately to use as required
- #
- # The Voice Asia 2012 - WMM 07-09-2012
- # Icecast Settings, change as required
- icecastPassword="PASSWORD_GOES_HERE"
- icecastMountPoint="stream"
- icecastMountPointStereo="stereoStream"
- icecastTitle="The Voice Asia"
- icecastPort=9999
- icecastHost="localhost"
- icecastURL="http://www.thevoiceasia.com"
- icecastGenre="Hindi"
- icecastDescription="The Voice Asia, bringing you the best from Bollywood, Bhangra, Gospel and everything in between"
- # Emergency fall back file if theres a silence of more than 5 seconds
- # Amend path as required
- emergencyFile = mksafe(single("/var/audio/emergency/song.mp3"))
- # Encoder quality settings, variables are forbidden in the encoder these are
- # only here as a reference for default script setup:
- # monoBitRate=64
- # stereoBitRate=128
- # encoderSampleRate=44100
- # Change in the icecast output section at the bottom of this script if you
- # need different settings.
- # Liquid Soap inner workings, do NOT change unless
- # you know what you're doing!
- # Change the log file path to somewhere accessible
- set("log.file.path", "/tmp/liquidsoap.log")
- # Function to connect System capture to Liquid Soap
- # Handles mono and stereo
- def jackConnect()
- system("jack_connect system:capture_1 liquidsoapstereo:in_0")
- system("jack_connect system:capture_2 liquidsoapstereo:in_1")
- end
- # Get the input from JACK
- liveStereo = (input.jack(id="liquidsoapstereo"):source(2,0,0))
- # Silence Detection, plays after 5 seconds of silence
- liveStereo = strip_blank(liveStereo, length=5.0)
- liveStereo = fallback(track_sensitive=false, [liveStereo, emergencyFile])
- # Compress it
- liveStereo = compress(ratio=3.0, attack=38.0, release=85.0, threshold=-20.0, knee=0.5, gain=8.0, liveStereo)
- # Limit it
- liveStereo = limit(ratio=3.0, attack=38.0, release=85.0, threshold=-3.0,knee=0.5, liveStereo)
- #Provide Output to JACK for monitoring purposes
- output.jack(liveStereo, id="soapstereo")
- #Output to Local IceCast Server (Mono)
- liveMono = mean(liveStereo) #Convert Live Stereo to Mono
- output.icecast(%mp3(stereo=false, samplerate=44100, bitrate=64),liveMono, description=icecastDescription, genre=icecastGenre, url=icecastURL, name=icecastTitle, mount=icecastMountPoint, host=icecastHost, password=icecastPassword, port=icecastPort, on_start=jackConnect)
- #Output to Local IceCast Server (Stereo)
- output.icecast(%mp3(stereo=true, samplerate=44100, bitrate=128),liveStereo, description=icecastDescription, genre=icecastGenre, url=icecastURL, name=icecastTitle, mount=icecastMountPointStereo, host=icecastHost, password=icecastPassword, port=icecastPort, on_start=jackConnect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement