3 # Bulk conversion of WAV to MFCC files
4 # Only converts files that do not yet exist in the target directory
6 form Convert sounds to MFCC
7 word source_dir ../wordlists/MandarinSounds
8 word target_dir ../wordlists/MandarinSounds/mfcc
9 positive number_of_Coefficients 12
17 Create Strings as file list... SourceList 'source_dir$'/*.'sourceExt$'
18 numberOfFiles = Get number of strings
20 # printline 'source_dir$'/*.'sourceExt$' 'numberOfFiles'
22 for i from 1 to numberOfFiles
23 select Strings SourceList
24 inFile$ = Get string... 'i'
25 outputFile$ = replace_regex$(inFile$, sourceExt$+"$", targetExt$, 1)
27 if not fileReadable("'target_dir$'/'outputFile$'")
28 Read from file... 'source_dir$'/'inFile$'
30 noprogress To MFCC... 'number_of_Coefficients' 0.015 0.001 100.0 100.0 0.0
31 Write to short text file... 'target_dir$'/'outputFile$'
39 select Strings SourceList