How to add lyrics (karaoke) files?
#1
I try to add .lrc file to my audio list:

Code:
# add mp3 record
listitem = xbmcgui.ListItem(PrepareString(listTitle))
listitem.setInfo(type='Music', infoLabels={'title': a.get('title') or '',
                                           'artist': a.get('artist') or '',
                                           'album': a.get('artist') or '',
                                           'duration': a.get('duration') or 0})
listitem.setProperty('mimetype', 'audio/mpeg')
xbmcplugin.addDirectoryItem(self.handle, url, listitem, False)

# add according lyrics record
url = 'http://example.com/filename.lrc'
listitem = xbmcgui.ListItem(PrepareString(listTitle))
listitem.setInfo(type='Music', infoLabels={'title': a.get('title') or '',
                                           'artist': a.get('artist') or '',
                                           'album': a.get('artist') or '',
                                           'duration': a.get('duration') or 0})
listitem.setProperty('mimetype', 'application/octet-stream')

xbmcplugin.addDirectoryItem(self.handle, url, listitem, False)

But .lrc file is displayed just as another music file. Do I use incorrect mimetype (Kodi source doesn't have .lrc value defined)?
Does Kodi verifies actual filenames? In my case mp3 file name could have one value (for ex., http://server1.com/abcd.mp3, when lyrics file will be named totally different (for ex., http://example.com/folder/filename.lrc)).

P.S. Karaoke is enabled (and yes, I use old version of Kodi, which supports Karaoke).
Reply
#2
To me it looks like you indeed add the lyrics as a second listitem. That is probably not thw way to do it - assuming this lyrics file is not playable. I would suspect you need to add it to another property similar to 'title'. Perhaps 'lyrics' but i dont know.

Are there no skins supporting it in which you can digg for the code? I know digging through python is a bitch.
Reply
#3
Thanks. I've tried to do:
Code:
[code]lyrics = '[00:11.9]Test[00:12.4]sample[00:12.7]lyrics [00:12.71]'
# lyrics = '/Users/me/test.lrc'
listitem.setInfo(type='Music', infoLabels={'title': a.get('title') or '',
                                           'artist': a.get('artist') or '',
                                           'album': a.get('artist') or '',
                                           'duration': a.get('duration') or 0,
                                           'genre': 'Karaoke',
                                           'lyrics': lyrics})
It doesn't work - Kodi doesn't treat this as Karaoke file (standard music player is started instead of Karaoke player).
I tried to assign genre equal to 'Karaoke' as found in Kodi source code, also tried to assign 'karaokenumber', give file path instead of lyrics as lyrics value, give mimetype equal to `music/x-karaoke`. Nothing works - just music is played.

Upd. Looking at karaokelyricsfactory.cpp it seems that Kodi tries to find according files and doesn't look for 'lyrics' item value.
Reply
#4
Oh, can somebody please tell me (if you are sure) that it is impossible to do with addon and then I will stop my research...
Reply
#5
Seems like nobody knows sadly.
Reply
#6
I've just got another idea - can I run Karaoke window (GUI) manually passing all parameters needed? Then my addon will do it.
Or, probably PlayMedia can help me?
Reply
#7
wasn't karaoke removed?

The karaoke feature in Kodi has been removed for the upcoming Kodi v16 "Jarvis".


http://kodi.wiki/view/Karaoke
Reply
#8
Please read last sentence in my first post Wink
Reply
#9
O, well it was removed because not even the devs knew how it worked!!!! Wink So good luck!
Reply

Logout Mark Read Team Forum Stats Members Help
How to add lyrics (karaoke) files?0