Last active
August 29, 2015 14:22
-
-
Save erzk/b3a88b9322d2a33458ab to your computer and use it in GitHub Desktop.
Annotates and splits a continuous wav file using Speech Filing System
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM define the working directory | |
set location=%cd% | |
REM define the participant | |
set participant=NAME | |
REM define the trial | |
set trial=01 | |
REM define the condition | |
set condition=FAF-Up | |
REM define the file name, e.g. 01-NAME-FAF-Up.wav | |
set filename=%trial%-%participant%-%condition% | |
REM transform wav files into sfs | |
cnv2sfs -i 1 %filename%.wav %filename%.sfs | |
REM define the number of annotations | |
set number_annotations=65 | |
REM label the stem for annotations | |
set stem=aaa | |
REM create annotations http://www.phon.ucl.ac.uk/resource/sfs/help/man/npoint.htm | |
npoint -n %number_annotations% -l %stem%-%participant%-%trial%-%condition% %filename%.sfs | |
REM export annotations to a csv file | |
anlist %filename%.sfs -C > %filename%.csv | |
REM split the continuous wav file into short wav files based on the delimiters created by npoint | |
wordchop -d %location%\%trial%\ %filename%.sfs | |
REM transform all split sfs files in the specified folder into wav files and delete sfs files | |
FOR /R %location%\%trial%\ %%A IN (*.sfs) DO ( | |
sfs2wav "%%A" | |
del "%%A") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment