This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import difflib | |
| def fuzzy_insert(words, new_word, threshold=0.6): | |
| # 1️⃣ Calculate similarity scores | |
| similarities = [ | |
| (i, difflib.SequenceMatcher(None, new_word, w).ratio()) | |
| for i, w in enumerate(words) | |
| ] | |
| # 2️⃣ Find best match |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| import torchaudio | |
| import numpy as np | |
| import soundfile as sf | |
| from speechbrain.pretrained import SpeakerRecognition | |
| from scipy.spatial.distance import cosine | |
| # ============================ | |
| # CONFIG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sounddevice as sd | |
| import soundfile as sf | |
| import numpy as np | |
| import queue | |
| import datetime | |
| import os | |
| # ============================== | |
| # CONFIG | |
| # ============================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import webrtcvad | |
| import collections | |
| import sys | |
| import wave | |
| import contextlib | |
| from pydub import AudioSegment | |
| def read_wave(path): | |
| with contextlib.closing(wave.open(path, 'rb')) as wf: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import collections | |
| import sys | |
| import wave | |
| import time | |
| import webrtcvad | |
| import pyaudio | |
| # Audio settings | |
| FORMAT = pyaudio.paInt16 | |
| CHANNELS = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Most compatible way – use .loc / .iat if DataFrame, indexing if ndarray | |
| loudness = float(features['loudness_sma3_amean'].item() | |
| if hasattr(features, '__getitem__') and 'loudness_sma3_amean' in features | |
| else features[smile.feature_names.index('loudness_sma3_amean')]) | |
| voicing_key = 'voicingProb_sma3nz_amean' | |
| voicing = 0.0 | |
| if voicing_key in smile.feature_names: | |
| idx = smile.feature_names.index(voicing_key) | |
| voicing = float(features[voicing_key].item() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pyaudio | |
| import numpy as np | |
| import opensmile | |
| import time | |
| import datetime | |
| import collections | |
| import soundfile as sf # pip install soundfile | |
| # ================= Configuration ================= | |
| SAMPLE_RATE = 16000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>VerbVibe - Trilingual Master</title> | |
| <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap" rel="stylesheet"> | |
| <style> | |
| :root { | |
| --primary-blue: #A2D2FF; |