features are extracted and the list of features are made.

This commit is contained in:
yemaozi88 2018-03-28 10:31:33 +02:00
parent c0e131d24e
commit 8514377f7b
3 changed files with 71 additions and 0 deletions

Binary file not shown.

View File

@ -1 +1,66 @@
import os
import sys
import tempfile
import configparser
import subprocess
## ======================= user define =======================
repo_dir = 'C:\\Users\\Aki\\source\\repos\\acoustic_model'
curr_dir = repo_dir + '\\acoustic_model'
config_ini = curr_dir + '\\config.ini'
output_dir = 'd:\\OneDrive\\Research\\rug\\experiments\\friesian\\acoustic_model'
sys.path.append(os.path.join(os.path.dirname(sys.path[0]), curr_dir))
import acoustic_model_functions as am_func
## ======================= load variables =======================
config = configparser.ConfigParser()
config.sections()
config.read(config_ini)
config_hcopy = config['Settings']['config_hcopy']
config_train = config['Settings']['config_train']
FAME_dir = config['Settings']['FAME_dir']
dataset_list = ['devel', 'test', 'train']
## ======================= extract features =======================
##dataset = dataset_list[0]
#for dataset in dataset_list:
# print(dataset)
## make a script file for HCopy
#hcopy_scp = tempfile.NamedTemporaryFile(mode='w', delete=False)
#hcopy_scp.close()
## using the wav_scp in FAME! corpus
#feature_dir = output_dir + '\\mfc\\' + dataset
#am_func.make_hcopy_scp_from_filelist_in_fame(FAME_dir, dataset, feature_dir, hcopy_scp.name)
## extract features
#subprocessStr = 'HCopy -C ' + config_hcopy + ' -S ' + hcopy_scp.name
#subprocess.call(subprocessStr, shell=True)
#os.remove(hcopy_scp.name)
## ======================= make a list of features =======================
##dataset = dataset_list[2]
#for dataset in dataset_list:
# print(dataset)
# feature_dir = output_dir + '\\mfc\\' + dataset
# hcompv_scp = output_dir + '\\scp\\' + dataset + '.scp'
# am_func.make_filelist(feature_dir, hcompv_scp)
## ======================= check the phonemes used in the lexicon =======================
lex_file = FAME_dir + '\\lexicon\\lex.asr'
phonelist = am_func.get_phonelist(lex_file)

View File

@ -22,6 +22,12 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="acoustic_model.py" />
<Compile Include="acoustic_model_functions.py">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="config.ini" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
<!-- Uncomment the CoreCompile target to enable the Build command in