Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (4) </ 1 2 3 [4] >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Little help needed, Bash scripting< Next Oldest | Next Newest >
WDef Offline





Group: Members
Posts: 798
Joined: Sep. 2005
Posted: Feb. 05 2007,12:58 QUOTE

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
Back to top
Profile PM 
Zucca Offline





Group: Members
Posts: 524
Joined: Feb. 2006
Posted: Feb. 13 2007,18:08 QUOTE

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.


--------------
Do you have it? - http://dy.fi/mak
Back to top
Profile PM WEB ICQ MSN 
Zucca Offline





Group: Members
Posts: 524
Joined: Feb. 2006
Posted: Feb. 13 2007,18:13 QUOTE

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... ;)


--------------
Do you have it? - http://dy.fi/mak
Back to top
Profile PM WEB ICQ MSN 
chaostic Offline





Group: Members
Posts: 328
Joined: Mar. 2005
Posted: Mar. 16 2007,06:31 QUOTE

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.
Back to top
Profile PM 
18 replies since Jan. 30 2007,09:45 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (4) </ 1 2 3 [4] >/
reply to topic new topic new poll
Quick Reply: Little help needed

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code