Old 29th July 2004, 17:29   #1
Junior Member
Join Date: Jul 2004
Location: Chambersburg, PA
Posts: 17
Can sc_trans execute shell command?

I am starting a station using sc_trans. I really like the program for two obvious reasons:
1. Made by Shoutcast so I know its 100% compatible
2. Crossfade feature not found in other command-line streamers

My one issue however is that I do not plan on using sc_trans playlist feature. I need sc_trans to execute a shell command either before or after every song it plays. The only way I can figure out how to do this is to have a shell script monitor sc_trans.log for activity and act accordingly, obviously this isn't the best solution though. My question is, is there a way sc_trans can execute a shell command.

To give an example of what i'm doing. Let's say I have play.list with two lines... one line is '/home/wbat/music/1.mp3' and second line is '/home/wbat/music/2.mp3' These files are static and the location never changes. However my shell scripts will copy various songs/sweepers/etc. onto either 1.mp3 or 2.mp3. Thus, I have powerful control of the playlist outside of sc_trans. The only issue is how to have sc_trans call a shell script/command?


[Edit --> DJ Egg]
Moved from Winamp Tech to Shoutcast Tech.
More appropriate in there, I think...?! :/
WBAT is offline   Reply With Quote
Old 29th July 2004, 19:04   #2
Junior Member
Join Date: Jul 2004
Location: Chambersburg, PA
Posts: 17
Just to give you an idea, below is the current php shell script I have to run. It stays in a loop and waits for the log to change regarding any "DECODE" of a new mp3 file.

PS- Feel free to use this script if you want.


#!/usr/local/bin/php -q

$n = 1;
$current_entry = "Current";
$last_entry = "Last";

while ($n = 1) {
$last_entry = `cat sc_trans.log | grep DECODE | tail -n 1`;
if ($last_entry == $current_entry) {
} else {
$current_entry = $last_entry;


Although this works, I would idealy want a "built-in" feature for sc_trans. The one main disadvantage to my above script is sc_trans doesn't wait for the script to be done before it moves on. This of course isn't a problem for most mp3 files since they are at least 30 seconds.
WBAT is offline   Reply With Quote
Old 29th July 2004, 20:26   #3
Moderator Alumni
Jay's Avatar
Join Date: May 2000
Location: Next Door
Posts: 8,942
you wouldn't want sc trans waiting on things, trust me that would be a bad thing.

If all you need is something dynamic then just setup a cron job to rewrite a full playlist daily or hourly.
Jay is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump