You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to set music tags using taglibsharp dll (downloadable from https://www.nuget.org/packages/TagLibSharp/ : download package, extract content -e.g. 7zip- and get dll from netstandard2.0).
I'm able to get and set (some) tags for .mp3 file. My code :
using DotNET
dllpath = "TagLibSharp.dll"
taglibsharp = T"System.Reflection.Assembly".LoadFrom(dllpath)
taglibfile = taglibsharp.GetType("TagLib.File")
filepath = "[PATH_TO_MP3_FILE]"
obj = taglibfile.Create(filepath)
println(obj.Tag.Title) # print title of the song
obj.Tag.Title = "Test Title"
obj.Save() # now if you check the title tag for the mp3 file, it has "Test Title"
However, there are some tags I can't write.
println(obj.Tag.Year) # I can access and get the Year tag
obj.Tag.Year = 2010 # This lead to an error :
ERROR: CLRException: System.MissingMethodException: Method 'TagLib.NonContainer.Tag.Year' not found.
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at CLRBridge.Meta.InvokeMember(IntPtr type, String name, BindingFlags bindingFlags, IntPtr binder, IntPtr target, IntPtr[] providedArgs, UInt32 argCount, IntPtr& exception)
Stacktrace:
[1] track_and_throw(::UInt64) at C:\Users\axelv\.julia\packages\DotNET\aiT1M\src\CLRBridge.jl:46
[2] InvokeMember(::UInt64, ::String, ::UInt32, ::Int64, ::UInt64, ::Array{UInt64,1}) at C:\Users\axelv\.julia\packages\DotNET\aiT1M\src\CLRBridge.jl:319
[3] invokemember(::UInt32, ::CLRObject, ::CLRObject, ::Symbol, ::Array{String,1}) at C:\Users\axelv\.julia\packages\DotNET\aiT1M\src\marshalling.jl:69
[4] setproperty!(::CLRObject, ::Symbol, ::Array{String,1}) at C:\Users\axelv\.julia\packages\DotNET\aiT1M\src\operators.jl:99
[5] top-level scope at REPL[22]:1
I have the same behaviour for some other tags.
When I do the same operation in PowerShell, everything works fine and I can edit the tag. So I guess the issue is not linked with TagLibSharp ?
Is there something I am doing wrong ? Is this an actual issue with DotNET.jl ? Is there another way to edit the tag.
Any idea ?
Thanks
The text was updated successfully, but these errors were encountered:
julia>T"TagLib.Tag, TagLibSharp".GetProperty("Year")
System.Reflection.RuntimePropertyInfo("UInt32 Year")
The property Year is of type System.UInt32 in CLR, which is mapped to UInt32 in Julia, while the literal 2010 is of type Int(32 or 64). When DotNET.jl tries to find the property with exact type info , an MissingMethodException is thrown. I admit that this mechanism needs to be improved in the future, and you can use UInt32(2010) as a workaround.
Hi,
I'm trying to set music tags using taglibsharp dll (downloadable from https://www.nuget.org/packages/TagLibSharp/ : download package, extract content -e.g. 7zip- and get dll from netstandard2.0).
I'm able to get and set (some) tags for .mp3 file. My code :
However, there are some tags I can't write.
I have the same behaviour for some other tags.
When I do the same operation in PowerShell, everything works fine and I can edit the tag. So I guess the issue is not linked with TagLibSharp ?
Is there something I am doing wrong ? Is this an actual issue with DotNET.jl ? Is there another way to edit the tag.
Any idea ?
Thanks
The text was updated successfully, but these errors were encountered: