Hi All,
i've got some code to read cart chunk tags:
Bass.Init();
// var stream = Bass.CreateStream(@"C:\Powershell\2 Unlimited - Maximum Overdrive.wav");
var stream = Bass.CreateStream(@"C:\Powershell\MYR10569.wav");
IntPtr tagpointer= Bass.ChannelGetTags(stream, TagType.RiffCart);
//IntPtr tagpointer = Bass.ChannelGetTags(stream, TagType.RiffCart);
if (tagpointer != IntPtr.Zero)
{
CartTag cart = (CartTag)Marshal.PtrToStructure(tagpointer, typeof(CartTag));
string tagText=cart.Artist;
Console.WriteLine($"Artist: {tagText}");
}
This works for a new file to which i've added a 2048 byte cart chunk data, but for a big set of my existing wavs, i get an exception error when i process them.
CartTag cart = (CartTag)Marshal.PtrToStructure(tagpointer, typeof(CartTag));
Exception has occurred: CLR/System.ExecutionEngineException
An unhandled exception of type 'System.ExecutionEngineException' occurred in System.Private.CoreLib.dll
<Cannot evaluate the exception stack trace>
I think this is because something in my wav file isn't of the correct format (although they work elsewhere), or the cartchunk is too long for bass (12k)