clangen / musikcube

a cross-platform, terminal-based music player, audio engine, metadata indexer, and server in c++
https://musikcube.com
BSD 3-Clause "New" or "Revised" License
4.22k stars 295 forks source link

Suggestion : Synced Lyrics #543

Open Decapitater opened 2 years ago

Decapitater commented 2 years ago

Mostly application in android like Oto music provide sync lyrics ,

Is it possible ?

Decapitater commented 2 years ago

@clangen any thoughts ?

clangen commented 2 years ago

@Decapitater this is something I'd like to support, and even have hooks for in the console client, but I can't find a lyrics database that is free to use, and I'm not currently willing to pay for commercial licenses.

Are you aware of any APIs or services that are free for open source projects?

Decapitater commented 2 years ago

@Decapitater this is something I'd like to support, and even have hooks for in the console client, but I can't find a lyrics database that is free to use, and I'm not currently willing to pay for commercial licenses.

Are you aware of any APIs or services that are free for open source projects?

I do think such dataset or base is publically available as I have seen the application of oto music do that . There is also an oto music desktop derivative on GitHub that could be contacted for further investigation

clangen commented 2 years ago

Thanks for the info! I took a quick look, and that project seems to be using this: https://github.com/vookav2/songlyrics

I spent a few minutes looking through the sources, and it appears to scrape HTML results from unofficial sources. I'll do a bit more thinking, but I'm not sure I want to bring in an entire HTML parsing library to do this in the app itself, as it'll add a bunch of bloat and will be prone to break as the third-party websites are updated.

Strawberry, a fork of the Clementine player, seems to do something similar, but also seems to have figured out a set of regular expressions to extract the data instead of trying to parse the HTML: https://github.com/strawberrymusicplayer/strawberry/tree/master/src/lyrics ... however, this still has an issue where site changes can break functionality.

A happy medium may be to figure out how to define a new plugin interface for lyrics, and piggy-back on (i.e. copy) Strawberry's functionality. I want to make sure anything that's baked into the app proper is relatively future proof; adding this functionality to a plugin will make it easier to jettison in the future if there is severe breakage.

Decapitater commented 2 years ago

@clangen

That sounds good ,

Can we get to see it in a future release ?

clangen commented 2 years ago

Only if I can find a way to do it without scraping web results. For what it's worth, AudD lyric fetching support is already built into the app, but I don't have an API key I can distribute.

If you're curious you can get an API token (go to https://audd.io/, scroll down to the bottom, and press the Get An API Token button). Once you have an API token, you can enter it into the "advanced preferences" section of musikcube:

image

Then, when music is playing, you can press CTRL+L to get into the lyrics view. It'll look like this:

image

Decapitater commented 2 years ago

@clangen I have made some interesting discoveries recently , I found an application named deemix-gui which downloads Irc files for sync , i also found an old application named MiniLyrics that was working like 6-10 yrs ago . I think its technique is different than the modern ones

chermy commented 2 years ago

How about .lrc file support ;)

r0bis commented 1 year ago

The idea would be - I guess - how to either embed the lyrics into your music files, or how to store them in local files or DB so that each time you do Ctrl+L there is not a new request to any lyrics database. That would also allow some users just put correctly formatted lyrics files (e.g. .lrc) and name them according to a known scheme.

r0bis commented 1 year ago

BTW I entered the aud.io api key but lyrics lookup is not happening. I gather that the key would not work even on trial basis, unless you pay $5 a month, is that right? Which is why it would be great to have a mechanism to store lyrics locally.

Or perhaps it could be that I am running musikcube not from Gnome Terminal or the like, but from a proper TTY terminal - i.e. my home DLNA server is in the kitchen and I just added speakers and an old monitor to it - works great. Of course - themes don't work and a few other things, but it is great overall.

Decapitater commented 1 year ago

The idea would be - I guess - how to either embed the lyrics into your music files, or how to store them in local files or DB so that each time you do Ctrl+L there is not a new request to any lyrics database. That would also allow some users just put correctly formatted lyrics files (e.g. .lrc) and name them according to a known scheme.

I use an application that allows you to embed synced-lyrics from online and uses triggers of some sort to play them with time

Decapitater commented 1 year ago

@clangen I found something , checkout vimusic

They are using a website kugou.com to pull synced lyrics that are either saved in cache or goes away

VeryHolyCheeeese commented 10 months ago

Using spotdl(https://github.com/spotDL/spotify-downloader) can easily download songs along with their metadata and lyrics, Synced lyrics is one of the lyrics provider. From a quick glance i saw that it uses the "syncedlyrics library". Some support for the synced lyrics downloaded using the synced provider on spotdl would be cool.