def load_core_dev_files(timit): core = set([l.strip().lower() for l in open("core_test")]) return [f for f in timit.utterances() if f.split("-")[1].split("/")[0] not in core and "sa1" not in f and "sa2" not in f][:200]
def load_brugnara_files(timit): brugnara = set([l.strip() for l in open("corpus")]) return [f for f in timit.utterances() if f.split("-")[1].split("/")[0] in brugnara and "sa1" not in f and "sa2" not in f]
def load_training_files(timit): #brugnara = set([l.strip() for l in open("corpus")]) return [f for f in timit.utterances() if "sa1" not in f and "sa2" not in f]
engine.load(df) # Compute the set of all phoneme types. phoneme_map = {} phoneme_set = speech.PhonemeSet() for i, p in enumerate(set(timit.phones())): phoneme = phoneme_set.phonemes.add() phoneme.id = i phoneme.name = p phoneme_map[p] = i print i, p # All the male utterances of a region. brugnara = set([l.strip() for l in open("corpus")]) #f.startswith("dr1-f") utterance_names = [f for f in timit.utterances() if f.split("-")[1].split("/")[0] in brugnara and "sa1" not in f and "sa2" not in f] print len(utterance_names) utterance_set = speech.UtteranceSet() all_features = [] #for utterance_file in utterance_names: for utterance_file in utterance_names: #for utterance_file in [ u for u in utterance_names if u == "dr8-mbcg0/sx57"]: # extract features from an audio file using AudioFileProcessor afp = AudioFileProcessor() afp.processFile(engine, timit.abspath(utterance_file + ".wav")) phone_times = timit.phone_times(utterance_file) print phone_times last = float(phone_times[-1][2]) features = engine.readAllOutputs()