Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
<?php
// hier den Pfad zu deinem Verzeichnis mit den Jingles angeben
$path = '/home/stream/Music/Jingle/';
// ab hier nichts mehr ändern!!!!!
// =======================
$dir = @opendir($path);
$filelist = array();
while(($file = readdir($dir)) !== false)
{
$cur_file = $path . $file;
if (is_file($cur_file))
{
array_push($filelist, $cur_file);
}
}
$rnd = array_rand($filelist, 1);
echo $filelist[$rnd];
?>
#!/usr/bin/php /home/stream/random.php
playlistfilename_0=jingles
playlistfilepath_0=/pfad/zur/jingle.lst
<event type="playlist">
<playlist loopatend="0" shuffle="0" priority="2" >jingles</playlist>
<calendar starttime="00:00:00" duration="00:05:00 timeoffset="00:00:00" repeat="128" />
</event>
<event type="playlist">
<playlist loopatend="0" shuffle="0" priority="2" >jingles</playlist>
<calendar starttime="00:00:00" duration="00:05:00 timeoffset="00:30:00" repeat="128" />
</event>
#!/bin/bash
find [B]<hier den Pfad zu den Jingles rein>[/B] -name \*.mp3 |sort -R |tail -n 1 |while read file; do
echo $file
done
#!/bin/bash [B]<Pfad zur random.sh>[/B]
<event type="playlist">
<playlist loopatend="0" shuffle="0" priority="2" >jingles</playlist>
<calendar starttime="01:00:00" duration="00:05:00" timeoffset="00:00:00" repeat="128" />
</event>
<event type="playlist">
<playlist loopatend="0" shuffle="0" priority="2" >jingles</playlist>
<calendar starttime="01:00:00" duration="00:05:00" timeoffset="00:20:00" repeat="128" />
</event>
<event type="playlist">
<playlist loopatend="0" shuffle="0" priority="2" >jingles</playlist>
<calendar starttime="01:00:00" duration="00:05:00" timeoffset="00:40:00" repeat="128" />
</event>
;; VU Images
vuimagedirectory=D:\Programme\SHOUTcast-Auto-DJ\testui
Daher dürfte das mit Bash nicht so ohne weiteres klappen. Allerdings versthe ich dann nicht, warum nicht eine vollwertige radio Automation zum Einsatz kommt, wenn man schon auf Windows arbeitet. Damit könnte man solche Rotationen erheblich schöner planen.;;;; LOGGING OPTIONS:
;where does the log file go
logfile=c:\sc_trans1.log
; 1 to do screen logging else 0
screenlog=1
Der Beitrag ist zwar schon etwas her aber es stimmt nicht ganz. Statt PHP würde ich die Bash benutzen da man dann nicht das Problem mit der php.ini open_basedir hat. Die PHP muss in dem Fall ja im Webspace liegen. Man kann sich z.B. eine random.sh ins Verzeichnis vom sc_trans packen mit folgenden Inhalt. Diese muss ausführbar für den User sein, der auch den sc_trans startet:
php /path/to/phpsctipt.php
/usr/bin/php /path/to/phpscript.php
; NOTE: for any relative paths specified are relative to
; sc_trans and not to where the conf file is being stored
; here we will setup where the log and other related files
; will be stored. make sure that these folders exist else
; sc_trans will throw an error and will close itself down.
logfile=logs/sc_trans.log
; we use the sc_trans_basic.conf configuration file as the
; base configuration to work from for enabling DJ support
include=sc_trans_basic.conf
; this is needed otherwise sc_trans will not allow DJ joins
; to be allowed to connect to the sc_trans instance.
calendarrewrite=0
calendarfile=calendar.xml
playlistfilename_1=jingles
playlistfilepath_1=playlists/jingles.lst
playlistfilename_2=main
playlistfilepath_2=playlists/playlist.lst
shuffle = 1
xfade=2
xfadethreshold=20
; for testing we will only setup a single encoder though it
; is easy to add in additional encoder configurations and
; we are using an aac plus encoder as the default due to
; the licensing requirements for mp3 encoding as detailed
; in sc_trans.txt - section 2.5).
encoder_1=mp3
channels_1=2
outprotocol_1=1
bitrate_1=128000
samplerate_1=44100
serverip_1=xxxxx
serverport_1=xxxx
password_1=xxxxx
unlockkeyname=xxxxx
unlockkeycode=xxxxxx
; here you would provide any information to fill in details
; provided to clients about the stream. it us upto you what
; is entered though do not do anything which will annoy, etc
streamtitle=xxxxxx
streamurl=http://www.xxxx
genre=Misc