int flowm_say_text(TCHAR *text) { char *s; int ns; cst_voice *v; if (previous_wave) { delete_wave(previous_wave); previous_wave = NULL; } s = cst_wstr2cstr(text); /* text to synthesize */ v = VoxDefs[flowm_selected_voice].v; /* voice to synthesize with */ feat_remove(v->features,"print_info_relation"); if (flowm_selected_relation == 1) feat_set_string(v->features, "print_info_relation", "Word"); if (flowm_selected_relation == 2) feat_set_string(v->features, "print_info_relation", "Segment"); /* Do the synthesis */ previous_wave = flite_text_to_wave(s,v); ns = cst_wave_num_samples(previous_wave); cst_free(s); audio_flush(fl_ad); audio_close(fl_ad); fl_ad = NULL; return ns; }
void item_unref_contents(cst_item *item) { /* unreference this item from contents, and delete contents */ /* if no one else is referencing it */ if (item && item->contents) { feat_remove(item->contents->relations,item->relation->name); if (feat_length(item->contents->relations) == 0) { delete_features(item->contents->relations); delete_features(item->contents->features); cst_utt_free(item->relation->utterance,item->contents); } item->contents = NULL; } }
int flowm_say_file(TCHAR *tfilename) { int rc = 0; char *filename; cst_voice *v; if (previous_wave) { /* This is really tidy up from Play -- but might say space */ delete_wave(previous_wave); previous_wave = NULL; } if (fl_ad) { MessageBoxW(0,L"audio fd still open",L"SayFile",0); audio_close(fl_ad); fl_ad = NULL; } v = VoxDefs[flowm_selected_voice].v; /* Where we want to start from */ feat_set_int(v->features, "file_start_position", flowm_file_pos); /* Only do print_info in play mode */ feat_remove(v->features,"print_info_relation"); filename = cst_wstr2cstr(tfilename); rc = flite_file_to_speech(filename, v, "stream"); cst_free(filename); audio_flush(fl_ad); audio_close(fl_ad); fl_ad = NULL; return rc; }
int item_feat_remove(const cst_item *i,const char *name) { return feat_remove(item_feats(i),name); }
int flite_feat_remove(cst_features *f, const char *name) { return feat_remove(f,name); }