Open vrdriver opened 4 years ago
Hi,
I don't know too much how the APE tag could be retrieved... we miss a unit test using it here...
I guess if the file you open doesn't contain already an APE field, then no TagLib.TagTypes.Ape
object is created.
However, once a Tag object is available in TagLib#, you should most of the time be able to access custom tags. However, the interface to access those is not "standardized" through TagLib# like the standard tags fields (Title, Description, Artist...) are.
For a TagLib.TagTypes.RiffInfo
object, the methods to access custom tags are GetValuesAsStrings
, GetValueAsUInt
, SetValue
...
Please have a look at file taglib-sharp\src\TagLib\Riff\ListTag.cs
to see how you what methods are available and taglib-sharp\src\TagLib\Riff\InfoTag.cs
to see how to use these.
Thanks I'll take a look at this and see how I go.
Hi @Starwer, Thanks for pointing me in that direction. I did have a much deeper look this time and it appears that those tags available in the Riff/InfoTag.cs
appear to be fixed and basically following these standard 4 digit codes.
After doing more research in to what is actually going on, I opened up my file in a HEX editor, and surprisingly it seems to be doing custom XMP entries.
Here is a newly created sample of one of these offending WAV files, with the suggested metadata as first mentioned. TEST_WAV_RIFF.wav.zip
I'm not looking for a free ride, but after trying multiple things, I'm not really getting anywhere.
This code below (which I thought should may have worked) gives me a null entry for tag_XMP
, meaning it can't find that tag.
TagLib.File file = TagLib.File.Create("TEST_WAV_RIFF.wav");
TagLib.Xmp.XmpTag tag_XMP = (TagLib.Xmp.XmpTag)file.GetTag(TagLib.TagTypes.XMP, true);
if (tag_XMP != null)
{
Console.WriteLine(ape_tag_XMP.GetTextNode("XML_NS", "Intro"));
}
I'm honestly not sure what I'm doing wrong. I know there are multiple 'XML Nodes' for the GetTextNode
, but as I still can't even read the tags yet, I figured that probably won't matter just yet.
Anyway, if you can shine any light, that would be great. Thanks in advance.
I'm not sure if this project will work, but I'm going to give it a go.
@vrdriver Hey, sorry. My life is a bit upside down right now. Please let me know how it goes.
Sorry it's been so long, but I wasn't able to find a way to add custom APE tags to a WAVE file in the end.
Hi Team, are there any updates on this with writing custom tags to PCM Wave files?
This code breaks, with the message of
System.NullReferenceException: 'Object reference not set to an instance of an object.'
ape_tag was null.
As it's a 'Wave' file, it fails, but if I do the same with an MP3 it goes through fine.
TagLib.File file = TagLib.File.Create("c:\\temp\\test\\1.wav");
TagLib.Ape.Tag ape_tag = (TagLib.Ape.Tag)file.GetTag(TagLib.TagTypes.Ape, true);
ape_tag.SetValue("steve", "hello");
file.Save();
Ta.
Hi, I'm attempting to read (and later write) WAV files with known custom APE tags, but there doesn't seem to be a way to do it? Am I missing something?
The main help example says it's possible (basically)
This code of mine works if the file is an MP3, but will fail in this example, as it's been given a WAV File.
This also fails as well, because Riff doesn't appear to have custom tags?
TagLib.Riff.InfoTag test = (TagLib.Riff.InfoTag)file.GetTag(TagLib.TagTypes.RiffInfo); test = custom.GetField("MY_TAG");
A program I'm using (while written in Delphi) has a stand-alone program in it called TrackTool, and it's able to read and write custom APE metadata to just about any audio file.
It basically writes and reads the following metadata fields with a value in milliseconds to keep up with its cue points for audio playout.
Is what I'm trying to do even possible using taglib-sharp? Thanks.