File size: 1,500 Bytes
1d8403e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ==================================================================================================
# DEEPFAKE AUDIO - toolbox/utterance.py (Utterance Signature Definition)
# ==================================================================================================
# 
# πŸ“ DESCRIPTION
# This module defines the Utterance data structure used within the toolbox to 
# store speech samples, their corresponding Mel-Spectrograms, and 256D 
# speaker embeddings.
#
# πŸ‘€ AUTHORS
# - Amey Thakur (https://github.com/Amey-Thakur)
# - Mega Satish (https://github.com/msatmod)
#
# 🀝🏻 CREDITS
# Original Real-Time Voice Cloning methodology by CorentinJ
# Repository: https://github.com/CorentinJ/Real-Time-Voice-Cloning
#
# πŸ”— PROJECT LINKS
# Repository: https://github.com/Amey-Thakur/DEEPFAKE-AUDIO
# Video Demo: https://youtu.be/i3wnBcbHDbs
# Research: https://github.com/Amey-Thakur/DEEPFAKE-AUDIO/blob/main/DEEPFAKE-AUDIO.ipynb
#
# πŸ“œ LICENSE
# Released under the MIT License
# Release Date: 2021-02-06
# ==================================================================================================

from collections import namedtuple

# Data Container: Canonical representation of a speech sample in the toolbox
Utterance = namedtuple("Utterance", "name speaker_name wav spec embed partial_embeds synth")

# Functional Overrides: Ensure identity based on filename for set operations
Utterance.__eq__ = lambda x, y: x.name == y.name
Utterance.__hash__ = lambda x: hash(x.name)