Advertisement
Guest User

Untitled

a guest
May 30th, 2012
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. @echo off
  2. echo Welcome to V 1.0 of anon's oggchan converter batch file.
  3. ::edit this to set the default quality level
  4. set q=0.0
  5. ::edit this to set the filepath for dBPoweramp, without quotes
  6. set dbpower=C:\Program Files (x86)\Illustrate\dBpoweramp\
  7. setlocal
  8. :start
  9. set /P song=Enter Song Name:
  10. ::sanitize the filename so it works okay
  11. ::convert the song with dbpoweramp
  12. "%dbpower%coreconverter.exe" -infile=%song% -outfile="%CD%\input.ogg" -convert_to="Ogg Vorbis" -q="%q%"
  13. echo Converted %song% to input.ogg
  14. ::Hide our input.ogg temp file so we can find it with dir easily
  15. attrib input.ogg +s +h
  16. ::print the file size so the user can determine whether to continue
  17. call :filesizeSong input.ogg
  18. set /P image=Enter Image Name:
  19. call :filesizeImg %image%
  20. set /a eval=%imgsize%+%musize%
  21. IF [%eval%] GEQ [3000] goto :toobig
  22. IF [%eval%] LSS [3000] echo Combined Filesize of %eval% kB is under 3mb!
  23. set /P call=Enter Call Name:
  24. IF [%call%]==[] echo [1] >> %image%
  25. IF NOT [%call%]==[] echo %call% >> %image%
  26. type input.ogg >> %image%
  27. echo done!
  28. endlocal
  29. goto :eof
  30.  
  31. :dequote
  32. setlocal
  33. rem The tilde in the next line is the really important bit.
  34. set thestring=%~1
  35. endlocal&set ret=%thestring%
  36. goto :eof
  37.  
  38. :filesizeSong
  39. setlocal
  40. set tmp=%~z1
  41. set tmp2=1024
  42. set /a answer= %tmp% / %tmp2%
  43. echo input.ogg is %answer% kB
  44. endlocal&set musize=%answer%
  45. goto :eof
  46. :filesizeImg
  47. setlocal
  48. set tmp=%~z1
  49. set tmp2=1024
  50. set /a answer= %tmp% / %tmp2%
  51. echo %image% is %answer% kB
  52. endlocal&set imgsize=%answer%
  53. goto :eof
  54.  
  55. :toobig
  56. setlocal
  57. echo Uh oh. It looks like the combined filesize of your song and your image would be more than 3 mb.
  58. set /P q=Enter new q value in the form (-)X.Y (minimum -1.0):
  59. goto :start
  60. endlocal
  61. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement