Album cover artwork of mp3 to image c#
Hello, can you help me please? How can i getting Album Artwork from mp3 file? I'm already used TagLib plugin for getting string album from file, but how can i convert into image for sprite? And i'm already tried posted the query to spotify service but i don't understand what i need to do next.
var audioFile = TagLib.File.Create(PlayList[idx_A]);
string search = audioFile.Tag.Album;
StartCoroutine(FindCover(search));
IEnumerator FindCover(string coverName)
{
string escName = WWW.EscapeURL(coverName);
Texture2D texture = new Texture2D(1, 1);
WWW www = new WWW("https://api.spotify.com/v1/search?q="+ escName + "&type=artist");
yield return www;
www.LoadImageIntoTexture(texture);
print(escName);
}
Answer by Jessespike · May 26, 2016 at 08:16 PM
After downloading the image, assign it to a material or ui component.
public UnityEngine.UI.RawImage _UiRawImage;
IEnumerator FindCover(string coverName)
{
...
_UiRawImage.texture = texture;
}
You'll need to create a UI Raw Image in the scene and assign it to this script.
thanks for reply, but i know how to assign texture, i don't know how can i get this image from mp3 file.
Your answer
Follow this Question
Related Questions
mp3 audio does not play in preview? 0 Answers
Audio Clipping Problem 0 Answers
Abrupt parameter change with fmod integration 0 Answers
Best practices for playing lots of audios 1 Answer
Unity Sound Glitched up (in 2D) 0 Answers