garry
Joined: 19 Apr 2005 Posts: 987 Location: switzerland
|
Posted: Mon Apr 28, 2008 9:56 pm Post subject: record radio (small script) |
|
|
record radio in background with a small commandline freeware
record what you hear
(for radios which adress contains :8xxx use streamripper)
| Code: |
MODIFIED=20080428
/*
name radiorecordmixmp3.ahk
usage record what you hear
http://ldb.tpv.ru/
mixmp3.exe with mp3enc.dll
download........ http://mixmp3.tpv.ru/mixmp3alpha.zip
*/
DetectHiddenWindows, ON
setworkingdir,%A_scriptdir%
transform,Q,chr,127
mixmp3=%A_scriptdir%\mixmp3.exe
ifnotexist,%mixmp3%
goto,mixmp3dnl
RU4=c:\_RECORDING
ifnotexist,%RU4%
FileCreateDir,%RU4%
Loop %RU4%,1
SP1= %A_LoopFileShortPath% ;shortpath for DOS command
SM1:=7 ;record Stereo Mix for MP3directCut
SM3:=70 ;volume
soundset,0,master,mute ;SPEAKER=MASTER ON
SoundSet,%SM3%,master ;SPEAKER=MASTER volume
soundset, 0,ANALOG:8,mute ;activate doesn`t work
SoundSet,%SM1%,ANALOG:8 ;Stereo Mix recording work
Gui,1:Color, 000000
Gui,1:Font, S10 CDefault , FixedSys
Gui,1:Show, x300 y0 w230 h300, RADIORECORD
Gui,1:Add,Text,cred x125 y130 h20,<REC 05-40
Gui,1:Add,Slider, x10 y130 w110 h20 vSlider Range5-40 gSliderRel,%SM1%
Gui,1:Add,Edit,cred x10 y152 w110 h20 vEditText1 gEdit1,
Gui,1:Add,Text,cwhite x125 y175 h20,<VOL 00-99
Gui,1:Add,Slider, x10 y175 w110 h20 vVolume Range0-99 gVolumeX,%SM3%
Gui,1:Add,Edit, x10 y197 w110 h20 vEditText2 gEdit2,
Gui,1:Add,Button, x10 y230 w110 h20,MUTE_ON/OFF
Gui,1:Add,Button, x10 y260 w110 h20 gRECORDED,RECORDED
Gui,1:Add,button,x10 y10 w110 h20 gButton4,SUOMI YLE1
Gui,1:Add,Button,x10 y40 w110 h20 gRECORD1,RECORD
Gui,1:Add,Button,x10 y100 w110 h20 gSTOP1,STOP
Gui,1:Font,S8 cwhite, Verdana
Gui,1:Add,Edit, x10 y70 w110 h20 ReadOnly
Gui,1:Add,Edit, x130 y230 w18 h18 ReadOnly ;mute
GuiControl,1:,edittext1,%SM1%
GuiControl,1:,edittext2,%SM3%
return
;-------------------------------------------------------------------------------
SliderRel:
Gui, Submit, NoHide
SoundSet,%slider%,Analog:8
GuiControl,1:, EditText1, %Slider%
Return
Edit1:
Gui, Submit, Nohide
GuiControl,1:, Slider, %EditText1%
Return
;----------------------------------------
VolumeX:
Gui,1:Submit, NoHide
SoundSet,%volume%,master
GuiControl,1:, EditText2,%volume%
Return
Edit2:
Gui,1:Submit, Nohide
GuiControl,1:,volume,%EditText2%
Return
;-----------------------------------------
buttonMUTE_ON/OFF:
soundset,+1,master,mute
V++
M:=mod(V,2)
if M=1
GuiControl,1:Text,Edit4,%Q%
else
GuiControl,1:Text,Edit4,
return
;------------------------------------------
RECORD1:
name1=Suomi_YLE1
ifexist %RU4%\%name1%.mp3
name1=%A_now%_%name1%
;run,%comspec% /c mixmp3 -b 128 %SP1%\%name1%.mp3,,hide ;not hidden
run,%comspec% /c mixmp3 -b 128 -hide -x test44.txt %SP1%\%name1%.mp3,,hide ;hidden
Process,wait,mixmp3.exe
PID2 = %ErrorLevel%
Process,exist,mixmp3.exe
if ErrorLevel<>0
GuiControl,1:Text,Edit3,RECORD
return
;---------------------------------------------
RECORDED:
run,%RU4%
return
;------------------------------------------------------
STOP1:
gui,1:submit,nohide
ControlSend,,{ESCAPE},ahk_pid %PID2% ;close when not hidden
GuiControl,1:Text,Edit3,STOPPED
fileappend,bb,test44.txt ;close when hidden
return
;------------------------------------------------------
BUTTON4:
BX8=Suomi YLE1
BX9=http://akastreaming.yle.fi/vp/fiyle/no_geo/live_i.asx
ifnotexist,%BX8%.wpl
gosub,E1WRITE
run,%BX8%.wpl
return
;----------------- gosub windows media player WPL ----------------------------------------------
E1WRITE:
e1=
(
<?wpl version="1.0"?>
<smil>
<head>
<meta name="Generator" content="Microsoft Windows Media Player -- 10.0.0.3646"/>
<title>Wiedergabeliste1</title>
</head>
<body>
<seq>
<media src="%BX9%"/>
</seq>
</body>
</smil>
)
fileappend,%e1%,%BX8%.wpl
return
;----------------------------
Guiclose:
process,close,%PID2%
exitapp
;================= DOWNLOAD mixmp3.exe with ==========================================
; mixmp3.exe with mp3enc.dll
;download........ http://mixmp3.tpv.ru/mixmp3alpha.zip
MIXMP3DNL:
{
text31=
(
This ahk-script needs mixmp3.exe with mp3enc.dll
Download
-mixmp3.exe
-mp3enc.dll
from
-http://ldb.tpv.ru/
Want you download these small commandline freeware programs ?
)
msgbox, 262180, Start URL,%text31%
ifmsgbox,NO
{
exitapp
return
}
else
{
run,http://mixmp3.tpv.ru/mixmp3alpha.zip
exitapp
return
}
}
return
;============================================================================
|
|
|