mirror of
https://github.com/rakuri255/UltraSinger.git
synced 2026-11-30 09:13:57 +09:00
- try getting additional data from musicbrainz database
This commit is contained in:
1 parent
9eeb22e4d1
commit
e11df8467d
3 files changed
+32
-2
No files matched your search
@@ -57,6 +57,7 @@ from modules.Ultrastar import (
|
||||
)
|
||||
from modules.Ultrastar.ultrastar_txt import UltrastarTxt
|
||||
from Settings import Settings
|
||||
from modules.musicbrainz_client import get_music_infos
|
||||
|
||||
settings = Settings()
|
||||
|
||||
@@ -332,6 +333,9 @@ def run():
|
||||
)
|
||||
os_helper.create_folder(cache_path)
|
||||
|
||||
# Get additional data for song
|
||||
get_music_infos(basename_without_ext)
|
||||
|
||||
# Separate vocal from audio
|
||||
audio_separation_path = separate_vocal_from_audio(
|
||||
basename_without_ext, cache_path, ultrastar_audio_input_path
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import musicbrainzngs
|
||||
|
||||
def get_music_infos(search_string):
|
||||
print("Searching song in musicbrainz...")
|
||||
#https://python-musicbrainzngs.readthedocs.io/en/v0.7.1/usage/#searching
|
||||
|
||||
musicbrainzngs.set_useragent("UltraSinger", "0.1", "https://github.com/rakuri255/UltraSinger")
|
||||
|
||||
artists = musicbrainzngs.search_artists(search_string)
|
||||
artist = artists['artist-list'][0]['name']
|
||||
release_groups = musicbrainzngs.search_release_groups(search_string, artist=artist)
|
||||
|
||||
release = release_groups['release-group-list'][0]
|
||||
print(f"title: {release['title']}")
|
||||
print(f"artist: {artist}")
|
||||
print(f"artist-credit-phrase: {release['artist-credit-phrase']}")
|
||||
print(f"first-release-date: {release['first-release-date']}")
|
||||
genre = []
|
||||
for tag in release['tag-list']:
|
||||
genre.append(tag['name'])
|
||||
print(f"genre: {genre}")
|
||||
|
||||
#release_id = release['id']
|
||||
#data = musicbrainzngs.get_image_list(release_id)
|
||||
+4
-2
@@ -1,5 +1,5 @@
|
||||
crepe==0.0.13
|
||||
librosa==0.9.2
|
||||
crepe~=0.0.12
|
||||
librosa~=0.9.1
|
||||
pretty_midi==0.2.9
|
||||
pydub==0.25.1
|
||||
Levenshtein==0.20.9
|
||||
@@ -19,3 +19,5 @@ Pillow~=9.5.0
|
||||
isort==5.12
|
||||
black==23.3
|
||||
pylint==2.17
|
||||
|
||||
musicbrainzngs~=0.7.1
|
||||
Reference in new issue
Block a user