Skip to content

Commit

Permalink
adding demucs denoiser
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanthganta182 committed Mar 29, 2024
1 parent 28eab81 commit ef86773
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ def handler(job):

print("Downloading song from s3")
s3.download_file('auto-karaoke', f'{song_name}/vocals.mp3', 'vocals.mp3')
s3.download_file('auto-karaoke', f'{song_name}/base_song.mp3', 'base_song.mp3')

s3.download_file('auto-karaoke', f'{song_name}/lyrics.txt', 'lyrics.txt')

with open('lyrics.txt', 'r') as f:
lyrics = f.read()

result = model.align('vocals.mp3', lyrics, 'English')
# result = model.align('vocals.mp3', lyrics, 'English')
result = model.align('base_song.mp3', lyrics, 'English',denoiser="demucs", vad=True)
model.refine('audio.mp3', result)
# audio = stable_whisper.load_audio("vocals.mp3")
# print("transcribing audio")
# result = stable_whisper.transcribe(model, audio, language="en")
Expand All @@ -48,7 +52,7 @@ def handler(job):
from fastapi import FastAPI
import json

model = stable_whisper.load_model("tiny")
model = stable_whisper.load_model("large-v3")
app = FastAPI()

@app.get("/")
Expand Down

0 comments on commit ef86773

Please sign in to comment.