#! praat # # Bulk conversion of WAV to MFCC files # Only converts files that do not yet exist in the target directory form Convert sounds to MFCC word source_dir wav word target_dir mfcc positive number_of_Coefficients 12 endform sourceExt$ = "wav" targetExt$ = "mfcc" # clearinfo Create Strings as directory list... DirList 'source_dir$'/* numberOfDirs = Get number of strings for dir from 1 to numberOfDirs select Strings DirList currentDir$ = Get string... 'dir' Create Strings as file list... SourceList 'source_dir$'/'currentDir$'/*.'sourceExt$' numberOfFiles = Get number of strings # printline 'source_dir$'/'currentDir$'/*.'sourceExt$' 'numberOfFiles' for i from 1 to numberOfFiles select Strings SourceList inFile$ = Get string... 'i' outputFile$ = replace_regex$(inFile$, sourceExt$+"$", targetExt$, 1) if not fileReadable("'target_dir$'/'currentDir$'/'outputFile$'") Read from file... 'source_dir$'/'currentDir$'/'inFile$' Rename... Source To MFCC... 'number_of_Coefficients' 0.015 0.005 100.0 100.0 0.0 Write to short text file... 'target_dir$'/'currentDir$'/'outputFile$' # Clean up select Sound Source plus MFCC Source Remove endif endfor select Strings SourceList Remove endfor select Strings DirList Remove