Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,16 @@

Pysync can be used using the command line. Setup the environment using conda and make sure that `whisper` and `spleeter` are installed. Then you can use this via the command line, providing an mp3 of the song and text file with lyrics you want to sync. The program will produce a .lrc file with timestamps which can be used by various lyric display programs.

`python pysync [-h] [--output_file OUTPUT_FILE] music lyrics`
`python pysync [-h] [--output_file OUTPUT_FILE] music lyrics`

## Installation

Install [Anaconda3](https://www.anaconda.com/download) and open the Anaconda Prompt.

1. Move to your Projects directory. (You can switch drive letters by just entering e.g. `F:` and hitting enter for the drive letter F.)
2. Create an environment: `conda create --name lyrics python=3.10.12`
3. Activate the environment: `conda activate lyrics`
4. Install `whisper` and `spleeter`: `pip install spleeter openai-whisper`
5. Download [ffmpeg](https://ffmpeg.org/download.html) and put the ffmpeg.exe into your project directory within Anaconda (Seems like having it in PATH doesn't work on windows...)

Now you're good to go, just execute it from within Anaconda Prompt. Every time you close the Anaconda Prompt you should repeat step 1 and 3 before executing the script.
7 changes: 5 additions & 2 deletions pysync/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse
import separate
import sync
import os

def cli():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
Expand All @@ -10,13 +11,15 @@ def cli():

args = parser.parse_args().__dict__

filename = os.path.basename(args['music'])

if args['output_file']:
output_file = args['output_file']
else:
output_file = args['music'][0:args['music'].find('.')] + '.lrc'
output_file = filename[0:filename.find('.')] + '.lrc'

temp_file = separate.separated_vocals(args['music'])
vocal_file_name = temp_file.name + '/' + args['music'][0:args['music'].find('.')] + '/vocals.wav'
vocal_file_name = temp_file.name + '/' + filename[0:filename.find('.')] + '/vocals.wav'

print(vocal_file_name)

Expand Down