@echo Wav2Tap is running...
@rem open console, change to directory
@rem and start batch with "wav2tap FILENAM" (without .wav)
@rem FileToOpen needed: http://www.horstmuc.de/win/wfile.zip

@echo off
if not exist GetFName.cmd (
	%~d0
	cd %~dp0
)
if not exist GetFName.cmd if exist ..\GetFName.cmd cd ..
call SHARPSET
set fnamex=.WAV
set fnamedp=%RECDIR%\
if "%RECDIR%" == "" set fnamedp=%WAVDIR%\
set fnamen=%1
set fnamef=%fnamedp%%fnamen%%fnamex%
set tapex=.tap

Rem Note: Filenames with 1-7 characters are recommended!
if not exist %fnamef% call GetFName %fnamedp% "*%fnamex%" "%1"
if not exist %fnamef% (
             echo Error: File %fnamef% does not exist! - Ctrl+C
             goto end
)
set sharpc2=%SHARPC:~0,2%
if "%sharpc2%" == "15" (
					   set tapex=_B.tap
Rem					   bas: _B.tap, bin: _LM.tap, dat: _D.tap, rsv: _R.tap
)
set sharpc2=

rem @echo on
wav2bin --pc=%SHARPC% --type=tap %fnamef% %TAPDIR%\%fnamen%%tapex% %WAV2OPT% %2 %3
@echo off
if errorlevel 1 goto end


echo ---------------------------------------------
echo.
echo Please read the messages above!
pause
copy %TAPDIR%\%fnamen%%tapex% %ANDDIR%\
Rem pause
echo Rename %TAPDIR%\%fnamen%%tapex% to CSAVENAME%tapex% 
echo Copy %TAPDIR%\%fnamen%%tapex% to your Android device into the app
echo directory %ANDDIR% and import it!
echo.
echo NOTE: 
echo 1. Import %fnamen%%tapex% from %ANDDIR%
echo    (%TAPDIR%),
echo    use the menu inside of your emulator application
echo 2. Start CLOAD "%fnamen%" inside the emulated BASIC Interpreter
echo.
pause
start "%fnamen%" %HEDITOR% %TAPDIR%\%fnamen%%tapex%
goto :EOF
:end
pause