title
Products            Buy            Support Forum            Professional            About            Codec Central
 
Results 1 to 14 of 14

Thread: Adding new tag deletes all existing tags & values

  1. #1

    Join Date
    May 2012
    Posts
    17

    Adding new tag deletes all existing tags & values

    I have a vb2010 project that allows user to enter new value for a tag - - e.g., "BACH" for Composer. convex.WriteIDTag(FileLocation, TagName, UserEnteredValue) If the tag already exists (e.g., "MOZART"), then the new value ("BACH") is written and everything works as it should. But if the tag Composer does not exist, this command not only fails to add the new tag and value, it wipes out all of the other existing tags and values (e.g., Artist, Length, etc.).

    The tags for the files were originally written with DMC. I can edit the tags manually and add a new tag manually. Any explanation/fix for this behavior? I would like to be able to add new tags, not just edit existing ones through my vb2010 project.

  2. #2
    Administrator
    Join Date
    Apr 2002
    Posts
    43,855

    Re: Adding new tag deletes all existing tags & values

    Which audio format and which tag type?

    dBpoweramp does not intentionally do this, it appends tags only overwriting exact matches.

  3. #3

    Join Date
    May 2012
    Posts
    17

    Re: Adding new tag deletes all existing tags & values

    The audio format is .m4a. I am not sure how to figure out what tag type (I am reading the data with AudioProperties and writing it to a DB). In Windows, I have access both to "Audio Properties" (which has a dropdown saying "dBpoweramp" then "Copy to Clipboard") and to "ID-Tag" (which begins with "dBpoweramp:" ). After trying to add a new tag, as described above, data in both Audio Properties and ID-Tag is wiped out. I can add a new tag and value through "ID-Tag" in Windows; it is just WriteIDTag that fails when trying to add a new tag and value programmatically.

  4. #4
    dBpoweramp Guru
    Join Date
    Jan 2011
    Posts
    937

    Re: Adding new tag deletes all existing tags & values

    If audio properties is being wiped out it suggests the file is then corrupted, can you play the file?

  5. #5

    Join Date
    May 2012
    Posts
    17

    Re: Adding new tag deletes all existing tags & values

    I can play the file before trying to add the new tag programatically; after trying to add the new tag (and there is never an error message), I cannot play the file. So writeIDtag corrupts the file if the tag does not already exist? Any idea why that would be, if I can add the new tag manually?

  6. #6
    Administrator
    Join Date
    Apr 2002
    Posts
    43,855

    Re: Adding new tag deletes all existing tags & values

    Please post some simple code showing your tag writing.

  7. #7

    Join Date
    May 2012
    Posts
    17

    Re: Adding new tag deletes all existing tags & values

    This reads data (UserEnteredInfo) from a db column, then assigns the appropriate tag (dicto(CI) = , e.g., "Composer") based on the db view displayed and column edited (CI). FixiItSelectedLoco is the filename whose tag is being edited. This works correctly when the tag exists; when the tag does not exist, no error is caught, but all the existing tags are wiped out and the file will not play.

    Private Sub Changex(dictctr As Int16, CI As Int16)
    Dim dicto As New Dictionary(Of Integer, String)
    Select Case dictctr
    Case 0
    dicto = TotalDictionary
    Case 1
    dicto = StandardDictionary
    Case 2
    dicto = TechDictionary
    End Select


    Try
    convex.WriteIDTag(FixItSelectedLoco, dicto(CI), UserEnteredInfo)
    Catch eprob as exception
    msgbox("Could not change " + dicto(CI) + " in " + FixItSelectedLoco + ".")
    End Try
    Last edited by JFS; 02-22-2013 at 05:07 PM.

  8. #8

    Join Date
    May 2012
    Posts
    17

    Re: Adding new tag deletes all existing tags & values

    Anything to investigate on this? Seems wrong that I can programmatically edit, but not add tags.

  9. #9
    Administrator
    Join Date
    Apr 2002
    Posts
    43,855

    Re: Adding new tag deletes all existing tags & values

    Just ran a test, created an Apple Lossless m4a file (z:\a.m4a), the file had ID Tags but no composer, then created a write.vbs file and added:

    ' create shell object
    Set WshShell = CreateObject("WScript.Shell")

    ' Create dMC Object
    Set dMC = CreateObject("dMCScripting.Converter")


    'Write an ID Tag
    Call dMC.WriteIDTag("z:\a.m4a", "Composer", "BACH")


    The final file was not corrupted. Please try the above code to test on your files.

  10. #10

    Join Date
    May 2012
    Posts
    17

    Re: Adding new tag deletes all existing tags & values

    Yes, that works correctly for me in shell too. It adds the tag/value pair when the tag was not previously present. Does that mean that the problem has something to do with the DMCScriptingLib.dll used in the VB2010 project? I will try calling the script from vb2010, bypassing the referenced dll.

  11. #11
    Administrator
    Join Date
    Apr 2002
    Posts
    43,855

    Re: Adding new tag deletes all existing tags & values

    They both use a com object, the same DLL...

  12. #12

    Join Date
    May 2012
    Posts
    17

    Re: Adding new tag deletes all existing tags & values

    The shell script you wrote worked for me in shell; but when I call it from within vb2010, the file is again corrupted/unreadable. This is the script I call, passing the filename of the file to which a tag is being added from VB2010 to script as nomen.

    ' create shell object
    Set WshShell = CreateObject("WScript.Shell")
    dim nomen
    nomen = WScript.Arguments(0)

    msgbox("Filename = " & nomen)

    ' Create dMC Object
    Set dMC = CreateObject("dMCScripting.Converter")

    'Write an ID Tag
    Call dMC.WriteIDTag(nomen, "Composer", "Beet1")

    In VB2010, I am calling the script through: Process.Start("c:\test.vbs", CFN)

    The script works correctly from the command line; how can the fact that the name is being passed from the VB2010 program prevent the script from working correctly? Is there something simple I am missing here?

    UPDATE: I COPIED BACK THE CORRUPTED FILES, THEN RE-RAN THE VB2010 PROGRAM; THIS TIME IT PROPERLY ADDED THE TAG/VALUE PAIR.
    Last edited by JFS; 02-25-2013 at 02:32 PM.

  13. #13
    dBpoweramp Guru
    Join Date
    Jan 2011
    Posts
    937

    Re: Adding new tag deletes all existing tags & values

    Running the script from the command line, explorer, or in VB should make no difference, I have no clue what is happening

  14. #14

    Join Date
    May 2012
    Posts
    17

    Re: Adding new tag deletes all existing tags & values

    As a further test, I deleted files with the added tag, then copied them back without the tag, then ran the VB2010 program that calls the Shell VBScript 3 separate times. The first time, the VB2010 program added the tag/value pair to all 4 test files. The second time, it added the tag/value pair to 2 files and corrupted 2 files, then added to 3 files and corrupted 1. So calling the VB Script sometimes works, calling WriteIDTag from within VB2010 never works, when tag is not already present (can edit, but not create).

    I cannot figure this out either, including why calling the Script only sometimes works.

    Thank you for the help to date.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •