We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
speaker_to_voice_type_path = os.path.join(folder, 'speaker_to_voice_type.json') if os.path.exists(speaker_to_voice_type_path): with open(speaker_to_voice_type_path, 'r', encoding='utf-8') as f: speaker_to_voice_type = json.load(f) return speaker_to_voice_type
speaker_to_voice_type = {} speaker_folder = os.path.join(folder, 'SPEAKER') voice_types = {} if not os.path.exists('voice_type'): get_available_speakers() for file in os.listdir('voice_type'): voice_type = file.replace('.wav', '') voice_types[voice_type] = np.load(f'voice_type/{file.replace(".wav", ".npy")}') for file in os.listdir(speaker_folder): if not file.endswith('.wav'): continue speaker = file.replace('.wav', '') wav_path = os.path.join(speaker_folder, file) embedding = generate_embedding(wav_path) # find the np.save(wav_path.replace('.wav', '.npy'), embedding) speaker_to_voice_type[speaker] = sorted(voice_types.keys(), key=lambda x: 1 - cosine(voice_types[x], embedding))[0]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
speaker_to_voice_type_path = os.path.join(folder, 'speaker_to_voice_type.json')
if os.path.exists(speaker_to_voice_type_path):
with open(speaker_to_voice_type_path, 'r', encoding='utf-8') as f:
speaker_to_voice_type = json.load(f)
return speaker_to_voice_type
The text was updated successfully, but these errors were encountered: