User:Andre Castro/prototyping/1.2/liquidsoap-noites: Difference between revisions

From XPUB & Lens-Based wiki
Line 106: Line 106:


===Future===
===Future===
Make LS display metadata of the file on the stream!
<b>Make LS display metadata of the file on the stream!</b>
 
Some hints maybe here: http://savonet.sourceforge.net/doc-0.3.8/radio-nova.html

Revision as of 01:27, 14 March 2012

Liquid Soap

http://savonet.sourceforge.net/doc-1.0.0/quick_start.html

Liquidsoap is a programming language for describing multimedia streaming systems


Sources

A stream is built with Liquidsoap by using or creating sources. A source is an annotated audio stream. In a Liquidsoap script, you build source objects


Possible Liquid Soap Setups

Request information on a file

liquidsoap -r http://www.archive.org/download/moonstone_0802_librivox/moonstone_01_collins.ogg

Request resolved.
title="01 - First Period: Chapter I"
temporary="true"
decoder="OGG"
artist="Wilkie Collins"
kind="{audio=0+;video=0+;midi=0+}"
rid="0"
initial_uri="http://www.archive.org/download/moonstone_0802_librivox/moonstone_01_collins.ogg"
status="ready"
filename="/tmp/liq452673.ogg"
album="The Moonstone"
Computing duration: 384.86 sec.

Playlists

LS can play playlists in both .pls and .M3U formats

it can play both local and remote files

.pls playlist

liquidsoap 'out(playlist("playlist.pls"))

[playlist]
numberofentries=2
Title1=File1 - archiveORg
File1=/home/andre/Documents/PZI/prototyping/blind-archive/sf-archive_frech/03actuel.ogg

Title2=File2 - archiveORG2
File2=/home/andre/Documents/PZI/prototyping/blind-archive/sf-archive_frech/04comporte.ogg

Playing mono files

liquidsoap is set to stereo, so does not play mono files!

So what needs to be done is converting the mono into stereo Weĺl do through this .liq script:

#!/usr/bin/liquidsoap

mono_playlist = playlist("/home/andre/Documents/PZI/prototyping/blind-archive/liquidsoap/playlist-blind-remote-mono.pls")

mono_playlist_s = audio_to_stereo(mono_playlist)

out(mono_playlist_s)


SWITCHING PLAYLISTS

  • liquidsoap script that schedules when playlists are to be played (can also allow for mixer jingles, time information, at precise or random intervals)
  • a schedule can be drawn (look at radios timetables!)


( liquid-test-severalPL.liq )

#!/usr/bin/liquidsoap

#based on example: http://savonet.sourceforge.net/doc-1.0.0/complete_case.html

set("log.stdout", true) # Print log messages to the console

p_code = playlist("/home/andre/Documents/PZI/prototyping/blind-archive/liquidsoap/playlist_code.pls")
p_cooking = playlist("/home/andre/Documents/PZI/prototyping/blind-archive/liquidsoap/playlist_cooking.pls")
p_french = playlist("/home/andre/Documents/PZI/prototyping/blind-archive/liquidsoap/playlist_french.pls")
p_news = playlist("/home/andre/Documents/PZI/prototyping/blind-archive/liquidsoap/playlist_news.pls")
 
radio = fallback([ request.queue(id="request"), 
	switch([
		({ 0m-5m }, p_code), ({ 5m-10m }, p_cooking),  ({ 10m-15m }, p_french),  ({ 20m-25m }, p_news) ])  
	])
# switch to given playlis within the minuts estipulated. 
# to switch a unique time: 8h0m0s-8h40m30s  

out(audio_to_stereo((radio:source(*+1,0,0))))

Future

Make LS display metadata of the file on the stream!

Some hints maybe here: http://savonet.sourceforge.net/doc-0.3.8/radio-nova.html