Programming and Scripting :: Little help needed



Since I have nothing better to do -

Perl gobbles lines at once. Type this in a shell:

Code Sample
perl -ne 'open(FH,$_);while (<FH>){print}' list.txt

I think solution to give mp3 stream to poc via stdin in a simple way is something like this:

loop (read list of files; ramdomize order;) {
cat random mp3
} | poc


Poc must be running all the time or clients listening it will be disconnect.
That's why we cannot do like this:
loop {
 cat random_mp3 | poc
}

But I think best way is to make mpg123 to ouput wav stream to lame and then output newly encoded, (low bitrate) stream to poc.
Advantages: lower bandwidth usage, no need to make script that randomizes playlist.
Disadvantages: more CPU usage.

BTW.
Is there a simple way to grab speaker output?

I would like to do something like this:

cat /dev/speakers | lame <swithches> | poc
Then people could hear what I listen on my computer... ;)

I know I'm way late on this, but saw this during a search and I figured out how to fix your problem with cating filenames with spaces.

Code Sample

cat mp3list.m3u | sed -e 's/ /\\ /g'` > temp.txt && cat 'cat temp.txt' | poc &


This has cat read the m3u, piping it into sed with changes all the spaces to "\ ". Sed then outputs it to standard out which is redirect to the new file temp.txt, which is identical to mp3list.m3u except for the \s. Then, after that command is done, you redo the recursive cat and pipe that to poc. & to background it if needed/wanted.


original here.