Fetching metadata from the HF Docker repository...
-
Update app.py
-
Delete .gitattributes
-
Update README.md
-
Create requirements.txt
-
Create app.py
-
Delete app.py
import streamlit as st
import librosa
import soundfile as sf
import pyrubberband as pyrb
from pydub import AudioSegment, effects
import os
import tempfile
# ===== ฟังก์ชันแยกเสียงร้อง =====
def separate_vocals(input_file):
os.system(f"spleeter separate -p spleeter:2stems -o output {input_file}")
base = os.path.splitext(os.path.basename(input_file))[0]
vocal_path = f"output/{base}/vocals.wav"
accompaniment_path = f"output/{base}/accompaniment.wav"
return vocal_path, accompaniment_path
# ===== Auto-tune =====
def autotune(vocal_file, target_key="C"):
y, sr = librosa.load(vocal_file)
pitches, magnitudes = librosa.piptrack(y=y, sr=sr)
pitch_series = []
for i in range(pitches.shape[1]):
index = magnitudes[:, i].argmax()
if pitches[index, i] > 0:
pitch_series.append(pitches[index, i])
semitones = librosa.hz_to_midi(pitch_series)
shift = - (round(semitones.mean()) - librosa.note_to_midi(target_key))
y_shif… -
Update app.py
-
initial commit
-
Duplicate from gradio-templates/chatbot

WIN821899 +1: pngwn Co-authored-by: Pete <pngwn@users.noreply.huggingface.co>