Cov txheej txheem:

Teem Sij Hawm Streaming Audio Recordings hauv Ubuntu: 5 Kauj Ruam
Teem Sij Hawm Streaming Audio Recordings hauv Ubuntu: 5 Kauj Ruam

Video: Teem Sij Hawm Streaming Audio Recordings hauv Ubuntu: 5 Kauj Ruam

Video: Teem Sij Hawm Streaming Audio Recordings hauv Ubuntu: 5 Kauj Ruam
Video: Data Science with Python! Extracting Metadata from Images 2024, Hlis ntuj nqeg
Anonim
Teem caij Streaming Audio Recordings hauv Ubuntu
Teem caij Streaming Audio Recordings hauv Ubuntu

Yog tias koj zoo li kuv, koj tus thawj coj xav kom koj ua haujlwm thaum ua haujlwm, thiab tsis txhob zaum mloog koj lub xov tooj cua nyiam uas koj nyiam. Hauv cov lus qhia no, kuv yuav qhia yuav ua li cas kaw ib lub suab kwj tau siv mplayer, ceg tawv thiab cron kom teem sijhawm ua haujlwm.

Kauj ruam 1: Tau Ubuntu, Tsim Cov Ntawv Teev Npe

Tau Ubuntu, Tsim Cov Ntawv Teev Npe
Tau Ubuntu, Tsim Cov Ntawv Teev Npe

Rau cov lus qhia no, koj yuav tsum muaj Ubuntu Linux. Kuv khiav 7.04, tab sis qhov no yuav ua haujlwm rau lwm yam ntxiv thiab. Yog tias tib neeg zoo li txaus siab, Kuv yuav sau cais qhia qhia pom yuav ua li cas nrog Windows Yog tias koj twb tau khiav Ubuntu, tsuas yog yam koj xav tau yog muaj pub dawb los ntawm apt. Siv cov lus txib hauv qab no ntawm lub davhlau ya nyob twg los teeb tsa Lame, Mplayer thiab KCron.sudo apt-get install lame mplayer kcronType hauv koj tus password thiab paub meej tias teeb tsa. Siv cov lus txib hauv qab no los tsim cov ntawv koj yuav xav tau.sudo mkdir /scriptsmkdir /home /username /Music /NameOfShow Thiab cov lus txib no los ua tswv cuab ntawm cov npe uas koj nyuam qhuav tsim: sudo chown YourUserName /scripts

Kauj ruam 2: Tsim Streamrecord Script

Tsim Streamrecord Script
Tsim Streamrecord Script

Cov theem rau tsab ntawv peb tab tom siv yog raws li hauv qab no: 1. Qhib mplayer, taw tes rau suab kwj ntawm Internet2. Sau cov kwj rau wav cov ntaub ntawv hauv /tmp directory3. Tua tus txheej txheem mplayer thaum ua yeeb yam xaus 4. Hloov /tmp/mystream.wav rau mp3 cov ntaub ntawv, npe nws nrog hnub no hnub no thiab txav nws mus rau ntau 'cov neeg siv nyiam' phau ntawv teev npe nyob hauv cov neeg siv nplaub tshev. 5. Rho tawm cov ntawv wav hauv /tmp phau ntawv teev npe kom ua tiav qhov no, koj yuav tsum xub nrhiav pom qhov URL ntawm cov kwj uas koj tab tom nkag mus. Piv txwv li, Kuv yuav siv CSPAN xov tooj cua tshaj tawm, thiab sau cia thaum nruab nrab ntawm tav su thiab 2 teev tsaus ntuj hnub Monday txog Friday. Nov yog cov ntawv ntawm tsab ntawv:#!/Bin/shNOW = $ (hnub +"%b-%d-%y") mplayer "mms: //rx-wes-sea20.rbn.com/farm/pull/tx -rbn -sea34: 1259/wmtencoder/cspan/cspan/wmlive/cspan4db.asf "-ao pcm: file =/tmp/mystream.wav -vc dummy -vo null; lame -ms /tmp/mystream.wav -o" /home/shawn/Music/CSPAN/My Show - $ NOW.mp3 "; rm /tmp/mystream.wav; Luam cov ntawv no rau hauv cov ntawv tsis siv Gedit lossis Vi, thiab txuag nws li" streamrecord ". Koj yuav tsum tau kho cov cheeb tsam ntawm tsab ntawv hauv cov ntawv qaij, vim cov no tsis siv rau koj. Cov ntawv tom qab mplayer yog URL rau kwj uas koj xav sau, qhov no yuav tsum tau hloov nrog koj cov kwj URL, uas tuaj yeem pom yooj yim los ntawm kev mus rau kwj hauv Firefox, cia lub mplayer plugin pib, tom qab ntawd nyem-thiab xaiv "Luam URL".

Kauj Ruam 3: Txuag Tsab Ntawv, Ua Pkill Tsab Ntawv thiab Ua Cov Ntawv Sau

Txuag Tsab Ntawv, Ua Pkill Tsab Ntawv thiab Ua Cov Ntawv Sau
Txuag Tsab Ntawv, Ua Pkill Tsab Ntawv thiab Ua Cov Ntawv Sau

Tom ntej no, peb yuav khaws tsab ntawv mus rau /phau ntawv sau npe. Thaum tau txais kev cawmdim, mus rau ntu ntu ntu thiab ntaus cov hauv qab no:

cd /scripts chmod 700 streamrecord (Qhov no ua rau tsab ntawv koj nyuam qhuav tsim rau hauv cov ntawv ua tiav.) Tsim ib daim ntawv ntxiv hauv /cov ntawv sau. Qhov no yuav raug hu ua pkill, thiab yuav yog koj tus ntaus. Ntawd yog, nws yuav tua tus txheej txheem mplayer txhawm rau tso cai thawj tsab ntawv txuas ntxiv nrog kev hloov npe thiab nkag mus rau hauv cov kwj uas tau ntes. Cov ntawv sau tag nrho ntawm pkill tsab ntawv yog raws nraim hauv qab no: pkill mplayer Tam sim no, qhov no ua txhaum kev sau ntawv tsis raug cai, los ntawm tsis muaj #!/Bin/sh rau saum, tab sis nws ua haujlwm rau kuv. Thaum koj tau khaws cov ntaub ntawv pkill hauv /phau ntawv sau npe, siv chmod hais kom rov ua qhov no kom ua tiav. Koj yuav tsum tau nyob hauv ntu ntu ntu, hauv /phau ntawv sau ua ntej, tom qab ntawv ntaus: chmod 700 pkill Kev nrawm "ls" yuav qhia koj cov ntaub ntawv uas koj nyuam qhuav tsim, tam sim no nyob rau hauv qhov ntxim nyiam ntsuab tsis siv tus qauv dub.

Kauj ruam 4: Siv KCron los teem sijhawm rau koj txoj haujlwm

Siv KCron los teem sijhawm rau koj txoj haujlwm
Siv KCron los teem sijhawm rau koj txoj haujlwm
Siv KCron los teem sijhawm rau koj txoj haujlwm
Siv KCron los teem sijhawm rau koj txoj haujlwm

Cron, qhov zoo tab sis tsis meej pem me ntsis cov ntawv me me thiab cov kev pabcuam cuam tshuam tsim nyog tau txais tag nrho cov lus qhia rau nws tus kheej. Txhawm rau ua kom yooj yim dua, peb yuav siv KCron (uas peb tau teeb tsa ua ntej) hloov chaw. Yog tias kev teeb tsa mus raws li tau npaj tseg, koj yuav tsum pom KCron hauv Cov Ntawv Thov Cov Cuab Yeej Cuab Yeej. Hloov pauv, txoj haujlwm tuaj yeem pib los ntawm lub davhlau ya nyob twg los ntawm kev ntaus "kcron". Siv Ctrl+N los tsim txoj haujlwm tshiab, thiab teeb tsa txoj haujlwm raws li qhia hauv daim duab. Hauv daim duab koj tuaj yeem pom kuv teeb tsa qhov program /scripts /streamrecord kom ua haujlwm txhua lub hlis, mon-fri thaum 12 teev tsaus ntuj nrog 0 feeb.

Tsab ntawv thib ob uas koj tau ua, hu ua 'pkill' yog qhov ua tiav mplayer thiab tso cai thawj tsab ntawv txuas mus ntxiv. Koj yuav tsum teeb tsa lwm txoj haujlwm cron los ua cov ntawv ntawd ib yam. Rau kuv tus piv txwv, Kuv xaus nrog ob txoj haujlwm hauv KCron. (saib daim duab 2)

Kauj ruam 5: Koj nyob hauv Kev Lag Luam

Koj nyob hauv Kev Lag Luam!
Koj nyob hauv Kev Lag Luam!

Qhov ntawd yog txhua yam rau nws, txhawm rau tshuaj xyuas koj tes haujlwm koj tuaj yeem nyem txoj haujlwm ua haujlwm hauv cov ntaub ntawv hauv Kcron, xaiv 'khiav tam sim no' thiab tshawb xyuas mystream.wav hauv koj /tmp phau ntawv teev npe. Yog tias nws nyob ntawd (thiab loj hlob sai), khiav cov haujlwm pkill thiab koj yuav tsum pom sai sai no mystream.wav ploj ntawm koj /tmp phau ntawv teev npe, thiab cov ntaub ntawv.mp3 tshiab hauv cov npe koj tau teev tseg thaum koj hloov tsab ntawv. Yog tias koj kaw cov yeeb yaj kiab ntev, nco ntsoov tias nws yuav siv sijhawm zoo los teev koj cov ntaub ntawv.wav Ntawm ib qho 3 teev qhia kuv kaw, nws siv sijhawm kwv yees li 10 feeb los hloov kho rau mp3. Yog tias koj muaj teeb meem tau txais qhov no los ua haujlwm, tsis txhob tso kuv kab.

Khoom P. S. Kuv paub kuv cov txheej txheem yog qhov nyuab me ntsis, vim tias muaj tej zaum zoo tshaj plaws-kev coj ua uas kuv tsis ua raws hauv qee yam ntawm kuv cov kauj ruam, yog li thov tsis txhob kawm kuv ntawm Linux 101, qhov no tsuas yog txoj kev nrawm thiab qias neeg kom tsis txhob nco koj nyiam suab kwj.

Pom zoo: