@ECHO OFF
SET BATDIR=%~dp0
SET OGGENC2=oggenc2.exe

REM //--------------------------------------------------------------------------
REM // * Tue Aug 23 21:53:38 JST 2016 Naoyuki Sawa
REM // - 1st 儕儕乕僗丅
REM //   僇儗儞僩僼僅儖僟埲壓偵桳傞*.wav僼傽僀儖傪丄慡偰*.ogg僼傽僀儖偵曄姺偡傞僶僢僠僗僋儕僾僩偺悧宆偱偡丅
REM //   幚嵺偵偼丄偙偺僶僢僠僗僋儕僾僩偦偺傑傑偱偁傜備傞働乕僗偵懳墳偡傞帠偼弌棃側偄偲巚偆偺偱丄揔媂僐僺乕偟偰曄峏偟偰壓偝偄丅

REM //--------------------------------------------------------------------------
COLOR C
ECHO 仛仛婋尟仚仚婋尟仛仛婋尟仚仚婋尟仛仛婋尟仚仚婋尟仛仛婋尟仚仚婋尟仛仛婋尟仚仚婋尟仛仛婋尟仚仚婋尟仛仛
ECHO 劆偙偺僶僢僠僗僋儕僾僩偼丄僇儗儞僩僼僅儖僟埲壓偺丄*.ogg僼傽僀儖傪丄慡偰嶍彍偟傑偡丅               劆
ECHO 劆娫堘偭偨僼僅儖僟偱幚峴偡傞偲旕忢偵婋尟側偺偱丄僷僗偑捠偭偨僼僅儖僟偵偼抲偐側偄傛偆偵偟偰壓偝偄丅劆
ECHO 劆僾儘僕僃僋僩偺慺嵽僼僅儖僟撪偵丄偙偺僶僢僠僗僋儕僾僩傪僐僺乕偟偰丄捈愙幚峴偡傞傛偆偵偟偰壓偝偄丅劆
ECHO 仛仛婋尟仚仚婋尟仛仛婋尟仚仚婋尟仛仛婋尟仚仚婋尟仛仛婋尟仚仚婋尟仛仛婋尟仚仚婋尟仛仛婋尟仚仚婋尟仛仛
ECHO.
ECHO 杮摉偵幚峴偡傞側傜偽丄嶰昩屻偵丄壗偐僉乕傪墴偟偰壓偝偄丅
ECHO 傗偭傁傝傗傔傞側傜偽丄僐儅儞僪僾儘儞僾僩傪暵偠偰壓偝偄丅
ECHO.
TIMEOUT /T 3 /NOBREAK
COLOR 7
PAUSE

REM //--------------------------------------------------------------------------
REM //僇儗儞僩僼僅儖僟埲壓偵桳傞丄*.ogg僼傽僀儖傪丄慡偰嶍彍偡傞丅
DEL /S *.ogg

REM //--------------------------------------------------------------------------
REM //僇儗儞僩僼僅儖僟埲壓偵桳傞丄*.wav僼傽僀儖傪丄慡偰曄姺偡傞丅
FOR /F "usebackq" %%i IN (`DIR /B /S *.wav`) DO (
  %OGGENC2% "%%i"
  IF ERRORLEVEL 1 GOTO L_ERR
)

REM //--------------------------------------------------------------------------
ECHO 姰椆偟傑偟偨丅
	TIMEOUT /T 3 /NOBREAK
EXIT /B

REM //--------------------------------------------------------------------------
:L_ERR
ECHO ###僄儔乕偑敪惗偟傑偟偨丅
	PAUSE
EXIT /B 1
