Skip to content

Instantly share code, notes, and snippets.

View cometothed4rkside's full-sized avatar
🏠
Working from home

Eren cometothed4rkside

🏠
Working from home
View GitHub Profile
@cometothed4rkside
cometothed4rkside / save_audio_segments.py
Created July 25, 2023 21:29
Otomatik Konuşmacı Ayırma ve Ses Kesitlerini Kaydetme | Automated Speaker Diarization and Saving Audio Segments
import os
from pyannote.audio import Pipeline
import torch
from pydub import AudioSegment
import librosa
def save_audio_segments(audio_file, min_speakers, max_speakers, output_dir):
pipeline = Pipeline.from_pretrained(
"pyannote/speaker-diarization@2.1",
use_auth_token='YOUR HUG FACE TOKEN')