Skip to content

Commit

Permalink
Updated to use latest version of audio-separator with new module stru…
Browse files Browse the repository at this point in the history
…cture and platform-specific extras. FOr now only silicon supported as extra due to Poetry limitations...
  • Loading branch information
beveradb committed Jan 8, 2024
1 parent ee6874d commit 096e499
Show file tree
Hide file tree
Showing 3 changed files with 491 additions and 313 deletions.
8 changes: 5 additions & 3 deletions karaoke_prep/karaoke_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ def download_video(self, youtube_id, output_filename_no_extension):
downloaded_file_name = output_filename_no_extension
actual_file_extension = None

# TODO: fix file extension for example karaoke-prep --log_level debug "Ken Ashcorp" "Dare You To Love Me"

def ydl_progress_hook(d):
nonlocal actual_file_extension
if d["status"] == "finished":
actual_file_extension = d["filename"].split(".")[-1]
actual_file_extension = d["filename"].split(".")[-1]

ydl_opts = {
"quiet": True,
Expand Down Expand Up @@ -318,7 +319,7 @@ def separate_audio(self, audio_file, model_name, instrumental_path, vocals_path)
f"instantiating Separator with model_name: {model_name} instrumental_path: {instrumental_path} and output_format: {self.output_format}"
)

from audio_separator import Separator
from audio_separator.separator import Separator

separator = Separator(
audio_file,
Expand Down Expand Up @@ -579,4 +580,5 @@ def process(self):
return self.process_playlist()
else:
self.logger.info(f"Provided YouTube URL is NOT a playlist, processing single track")
# TODO: Add support for using karaoke-prep with an existing audio file in any format (e.g. FLAC), not just youtube
return [self.prep_single_track()]
Loading

0 comments on commit 096e499

Please sign in to comment.