-
Notifications
You must be signed in to change notification settings - Fork 0
/
convertToWav.bat
55 lines (50 loc) · 1.26 KB
/
convertToWav.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@ECHO off
:start
ECHO.
ECHO 1. Save to Desktop
ECHO 2. Save to source directory
ECHO.
set choice=
REM promt the user and asaign variable "choice"
set /p choice=Make your choice:
REM crop the first character
if not '%choice%'=='' set choice=%choice:~0,1%
REM goto places
if '%choice%'=='1' goto desktop
if '%choice%'=='2' goto directory
REM error and restart
ECHO "%choice%" is not valid, try again
ECHO.
goto start
:desktop
ECHO.
ECHO Saving to Desktop
:nextFileDesk
ECHO.
ECHO converting to wav:
REM %1 is the first drag drop parameter. The "~" removes special chracters
ECHO "%~1"
ECHO.
REM % (Variable) ~ (remove special Chars) d (Drive Letter) p (Path) n (Filename) x (Extension)
lame --decode "%~1" "C:\Users\TheDa\Desktop\%~n1.wav"
REM shift %3 tp %2, %2 to %1...
SHIFT
REM check if there is a next parameter:
IF NOT [%1] == [] ( goto nextFileDesk )
goto end
:directory
ECHO.
ECHO Saving to source directory
:nextFileDir
ECHO.
ECHO converting to wav:
REM %1 is the first drag drop parameter. The "~" removes special chracters
ECHO "%~1"
ECHO.
REM % (Variable) ~ (remove special Chars) d (Drive Letter) p (Path) n (Filename) x (Extension)
lame --decode "%~1" "%~dpn1.wav"
REM shift to next file
SHIFT
REM check if there is a next file
IF NOT [%1] == [] ( goto nextFileDir )
pause