Skip to content

Commit

Permalink
Simplify recording logic & fix bug with genius_url
Browse files Browse the repository at this point in the history
  • Loading branch information
m-danya committed Apr 3, 2024
1 parent 2313c14 commit 1a5aee9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ the system at `${DEPLOYMENT_HOST}:${DOCKER_FRONTEND_PORT}`.
- Skip banned tracks from album
- Show albums/tracks collection with filters
- Extract TrackLine component to reuse in collection
- Sort by cover colors (just for fun)
- Descriptive error messages on frontend (e.g. for Genius API)
- Add hint for clicking button on the last syllable when recoring (maybe even
color the last syllable of the last word of the line)
- Add paging for albums & tracks
- Put vocals track into "practice mode", mix with karaoke?
- Add router to frontend (to support links like /album/123)
- Show track name in page title
- Download tracks' studio versions (ignore clip versions from YT Music)
- Collection management: order of albums / stars / rating
- Add editing text from frontend (to edit Genius parser's mistakes)
Expand Down
1 change: 1 addition & 0 deletions accompanist/celery/album.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def process_album(search_query: str):
vocals_path, instrumental_path, original_path = process_track(track["videoId"])
track_name = track["title"]
lyrics = None
genius_url = None
try:
lyrics, genius_url = get_lyrics_from_genius(artist.name, track_name)
except Exception:
Expand Down
8 changes: 2 additions & 6 deletions frontend/src/components/RecordTimecodesComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,9 @@ const lyricsLines = props.lyricsText
.filter((line) => line.trim() && !line.trim().startsWith("["));
const lyricsWithTimecodes = reactive([]);
let currentLineIndex = ref(0);
let startTime = 0;
const setupPlayer = () => {
if (audioPlayer.value) {
audioPlayer.value.addEventListener("play", () => {
startTime = audioPlayer.value.currentTime;
});
audioPlayer.value.play();
}
};
Expand All @@ -51,7 +47,7 @@ const recordTimecode = () => {
const endTime = audioPlayer.value.currentTime;
lyricsWithTimecodes.push({
line: lyricsLines[currentLineIndex.value],
end_ts: endTime - startTime,
end_ts: endTime,
});
if (currentLineIndex.value == lyricsLines.length - 1) {
emit("sendRecordedKaraokeLyrics", lyricsWithTimecodes);
Expand All @@ -62,7 +58,7 @@ const recordTimecode = () => {
const recordInterludeEnd = () => {
let interludeText = "[Проигрыш]";
let end_ts = audioPlayer.value.currentTime - startTime;
let end_ts = audioPlayer.value.currentTime;
if (
lyricsWithTimecodes[lyricsWithTimecodes.length - 1]?.line !== interludeText
) {
Expand Down

0 comments on commit 1a5aee9

Please sign in to comment.