import os import shutil import struct import sys if __name__ == "__main__": input_file = sys.argv[1] input_name = sys.argv[2] if len(input_file) + len(input_name) < 2: print "not enough arguments" exit(0) output_dir = input_file + "gmms_temp" os.makedirs(output_dir) split_gmm(input_file, output_dir) files = os.listdir(output_dir) files_path = [os.path.join(output_dir, f) for f in files] for f in files_path: rename_gmm(f, input_name) files_path = [os.path.join(output_dir, f) for f in files] merge_gmms(files_path, input_name + ".gmm") os.remove(input_file) shutil.rmtree(output_dir)
# it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # ######################################################################### from voiceid.fm import merge_gmms import shutil import sys if __name__ == '__main__': input_files = sys.argv[1:-1] output_file = sys.argv[-1:] if len(input_files) + len(output_file) < 2: print 'not enough arguments' exit(0) if len(input_files) == 1 and len(output_file) == 1: shutil.copy(input_files[0], output_file[0]) exit(0) output_file = output_file[0] merge_gmms(input_files, output_file)
# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # ######################################################################### from voiceid.fm import merge_gmms import shutil import sys if __name__ == '__main__': input_files = sys.argv[1:-1] output_file = sys.argv[-1:] if len(input_files) + len(output_file) < 2: print 'not enough arguments' exit(0) if len(input_files) == 1 and len(output_file) == 1: shutil.copy(input_files[0], output_file[0]) exit(0) output_file = output_file[0] merge_gmms(input_files, output_file)
import sys if __name__ == '__main__': input_file = sys.argv[1] input_name = sys.argv[2] if len(input_file) + len(input_name) < 2: print 'not enough arguments' exit(0) output_dir = input_file + "gmms_temp" os.makedirs(output_dir) split_gmm(input_file, output_dir) files = os.listdir(output_dir) files_path = [os.path.join(output_dir, f) for f in files] for f in files_path: rename_gmm(f, input_name) files_path = [os.path.join(output_dir, f) for f in files] merge_gmms(files_path, input_name + ".gmm") os.remove(input_file) shutil.rmtree(output_dir)
return name #all_other = gmm.read() if __name__ == '__main__': speakers = {} for f in os.listdir(os.getcwd()): if f.endswith('.gmm'): s = get_speaker(f) if not speakers.has_key(s): speakers[s] = [] if str(f) == str(s + ".gmm"): shutil.move(f, s + "_____.gmm") speakers[s].append(s + "_____.gmm") else: speakers[s].append(f) print speakers for sp in speakers: out = sp + ".gmm" if len(speakers[sp]) == 1: os.rename(speakers[sp][0], sp + ".gmm") else: merge_gmms(speakers[sp], out) for s in speakers[sp]: os.remove(s)
return name # all_other = gmm.read() if __name__ == "__main__": speakers = {} for f in os.listdir(os.getcwd()): if f.endswith(".gmm"): s = get_speaker(f) if not speakers.has_key(s): speakers[s] = [] if str(f) == str(s + ".gmm"): shutil.move(f, s + "_____.gmm") speakers[s].append(s + "_____.gmm") else: speakers[s].append(f) print speakers for sp in speakers: out = sp + ".gmm" if len(speakers[sp]) == 1: os.rename(speakers[sp][0], sp + ".gmm") else: merge_gmms(speakers[sp], out) for s in speakers[sp]: os.remove(s)