Hi there. I created a little program that accepts various format audio files and lets you convert to 5 target formats by drag dropping your file on the correct button.
All done using BASS and many addons. It works great.
I know how to write metadata to most of the 5 output formats, including adding album art, since I've done that before with BASS.
But now i'm stuck at a step I haven't had to deal with before...reading from the input file (which can be .ogg, .mp3, .alac, .wma, .flac, .opus or .wav) to then apply the metadata to the output file.
I've looked at the documentation for ChannelGetTags and it makes no sense to me given that I need to get the Artist, Song, Album Name, Track Name, and Album Art (where present).
No matter what I've tried I'm drawing a blank on how to get useful data that I can get then apply when exporting the file.
Can you point me in a more specific direction than just looking at ChannelGetTags? Maybe a sample?
EDIT: Found the Tags addon and now I can read tags from all these source files. Great! Only thing i'm still struggling with is reading the album art. I'm testing with a file that I know has a large album art. Using the following, I still get a null image placeholder:
EDIT2: I can read and save the album art for .mp3 files. However .flac and .m4a come back as being null even though I know for sure it has album art.
BassTags.ReadPictureTAGs = true;
var album_art = metadata.PictureGetImage(0);
if (album_art != null)
{
album_art.Save(input_file.Replace(input_ext, ".jpg"));
}
TagPicture art = metadata.PictureGet(0);
if (art != null)
{
File.WriteAllBytes(input_file.Replace(input_ext, ".jpg"), art.Data);
}
Thanks!