3

i'm trying to use batch script code for emobase configuration using the commands

cd "cd\Users\Admin\Desktop\recording\angry"

for %%i in (*) do "C:\Users\Admin\Desktop\openSMILE\openSMILE-2.1.0\bin\Win32\SMILExtract_Release.exe" -c "C:\Users\Admin\Desktop\openSMILE\openSMILE-2.1.0\config\emobase2010.conf" -i %%i -O "C:\Users\Admin\Desktop\DataSample_for_Emobase2010.arff" -classlabel 1

when i run it it will say %%i was unexpected at this time. How do i solve this problem?

I am new to programming and i don't know if what's inside the folder is important but what's inside is a bunch of files in .arff format. I'm suppose to turn all the files inside into a single .arff file. i thought maybe the file inside is need to be .wav format so i tried doing it to a folder full of .wav file but its still showing the same problem. i'm using openSMILE to configure it by the way, and will use the end pruduct to be run on weka

Sazer Job
  • 33
  • 4

1 Answers1

0

Create a test.bat with this code.

switch out the two GOTO lines to see which works best for you BY COMMENTING THEM OUT WITH ":: " GOTO TEST1 :: GOTO TEST2

I don't have this program so it is untested. Hope this helps give you some ideas on how you can utilize the for command.

:: RESTART SCRIPT WITH ADMIN RIGHTS AND IN A MAXIMIZED WINDOW IF NOT ALREADY SO
@ECHO OFF
IF NOT "%1"=="MAX" (powershell -WindowStyle Hidden -NoProfile -Command {Start-Process CMD -ArgumentList '/D,/C' -Verb RunAs} & START /MAX CMD /D /C %0 MAX & EXIT /B)

:------------------------------------------------------------------------------------------------------

:: BASIC BATCH SCRIPT TEMPLATE

@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
COLOR 0A
TITLE EMOBASE CONFIGURATION

SET WorkingDir=C:\Users\Admin\Desktop\recording\angry
SET SMILE=C:\Users\Admin\Desktop\openSMILE\openSMILE-2.1.0\bin\Win32\SMILExtract_Release.exe
SET FNAME1=C:\Users\Admin\Desktop\openSMILE\openSMILE-2.1.0\config\emobase2010.conf
SET FNAME2=C:\Users\Admin\Desktop\DataSample_for_Emobase2010.arff

:: CHANGE DIRECTORY
PUSHD "%WorkingDir%"
:: OR USE THIS IF IT WORKS TO CHANGE THE DIRECTORY
PUSHD "%USERPROFILE%\Desktop\recording\angry" 

GOTO TEST1
:: GOTO TEST2

:TEST1
:: METHOD 1
:: REMOVE ECHO BELOW WHEN READY TO RUN
FOR %%G IN (*.*) DO (
ECHO "%SMILE%" -c "%FNAME1%" -i "%%G" -O "%FNAME2%" -classlabel 1
)

:TEST2
:: METHOD 2
:: REMOVE ECHO BELOW WHEN READY TO RUN
FOR %%G IN (*.*) DO (
SET FILES=%%~fG
ECHO "%SMILE%" -c "%FNAME1%" -i "!FILES!" -O "%FNAME2%" -classlabel 1
)

ECHO.
TITLE Done! EMOBASE CONFIGURATION
PAUSE
EXIT
slyfox1186
  • 301
  • 1
  • 13