Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read Track BWF metadata error #277

Closed
drunkenQCat opened this issue Sep 11, 2024 · 3 comments
Closed

Read Track BWF metadata error #277

drunkenQCat opened this issue Sep 11, 2024 · 3 comments
Assignees
Labels

Comments

@drunkenQCat
Copy link

drunkenQCat commented Sep 11, 2024

The problem

I have some audio file in my SFX library, and pre-edited with Reaper, wrote Description, Comment and Title. Now I have some new request to edit it with ATL, but when running:

Track theTrack = new Track(file);

just create the track object, it showed me a bunch of exceptions about xml, the first line of the log is 'BWF' is an undeclared prefix.

Environment

  • ATL version (or git revision) that exhibits the issue:6.04
  • Last ATL version that did not exhibit the issue (if applicable):
  • OS/version used to run ATL: Windows 11

Details

The detailed log:

'BWF' is an undeclared prefix. Line 1, position 397.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32 linePos)
   at System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node)
   at System.Xml.XmlTextReaderImpl.ElementNamespaceLookup()
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at ATL.AudioData.XmlArray.readXml(Stream mem, Encoding encoding, Stack`1 position, MetaDataIO meta, ReadTagParams readTagParams)
   at ATL.AudioData.XmlArray.FromStream(Stream source, MetaDataIO meta, ReadTagParams readTagParams, Int64 chunkSize)
'BWF' is an undeclared prefix. Line 1, position 397.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32 linePos)
   at System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node)
   at System.Xml.XmlTextReaderImpl.ElementNamespaceLookup()
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at ATL.AudioData.XmlArray.readXml(Stream mem, Encoding encoding, Stack`1 position, MetaDataIO meta, ReadTagParams readTagParams)
   at ATL.AudioData.XmlArray.FromStream(Stream source, MetaDataIO meta, ReadTagParams readTagParams, Int64 chunkSize)
   at ATL.AudioData.IO.IXmlTag.FromStream(Stream source, MetaDataIO meta, ReadTagParams readTagParams, Int64 chunkSize)
   at ATL.AudioData.IO.WAV.readWAV(Stream source, ReadTagParams readTagParams)
   at ATL.AudioData.IO.WAV.read(Stream source, ReadTagParams readTagParams)
   at ATL.AudioData.IO.WAV.Read(Stream source, SizeInfo sizeNfo, ReadTagParams readTagParams)
   at ATL.AudioData.AudioDataManager.read(Stream source, ReadTagParams readTagParams)
   at ATL.AudioData.AudioDataManager.read(Stream source, Boolean readEmbeddedPictures, Boolean readAllMetaFrames, Boolean prepareForWriting)
   at ATL.AudioData.AudioDataManager.ReadFromFile(Boolean readEmbeddedPictures, Boolean readAllMetaFrames)
'BWF' is an undeclared prefix. Line 1, position 397.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32 linePos)
   at System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node)
   at System.Xml.XmlTextReaderImpl.ElementNamespaceLookup()
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at ATL.AudioData.XmlArray.readXml(Stream mem, Encoding encoding, Stack`1 position, MetaDataIO meta, ReadTagParams readTagParams)
   at ATL.AudioData.XmlArray.FromStream(Stream source, MetaDataIO meta, ReadTagParams readTagParams, Int64 chunkSize)
'BWF' is an undeclared prefix. Line 1, position 397.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32 linePos)
   at System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node)
   at System.Xml.XmlTextReaderImpl.ElementNamespaceLookup()
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at ATL.AudioData.XmlArray.readXml(Stream mem, Encoding encoding, Stack`1 position, MetaDataIO meta, ReadTagParams readTagParams)
   at ATL.AudioData.XmlArray.FromStream(Stream source, MetaDataIO meta, ReadTagParams readTagParams, Int64 chunkSize)
   at ATL.AudioData.IO.IXmlTag.FromStream(Stream source, MetaDataIO meta, ReadTagParams readTagParams, Int64 chunkSize)
   at ATL.AudioData.IO.WAV.readWAV(Stream source, ReadTagParams readTagParams)
   at ATL.AudioData.IO.WAV.read(Stream source, ReadTagParams readTagParams)
   at ATL.AudioData.IO.WAV.Read(Stream source, SizeInfo sizeNfo, ReadTagParams readTagParams)
   at ATL.AudioData.AudioDataManager.read(Stream source, ReadTagParams readTagParams)
   at ATL.AudioData.AudioDataManager.read(Stream source, Boolean readEmbeddedPictures, Boolean readAllMetaFrames, Boolean prepareForWriting)
   at ATL.AudioData.AudioDataManager.ReadFromFile(Boolean readEmbeddedPictures, Boolean readAllMetaFrames)
'BWF' is an undeclared prefix. Line 1, position 397.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32 linePos)
   at System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node)
   at System.Xml.XmlTextReaderImpl.ElementNamespaceLookup()
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at ATL.AudioData.XmlArray.readXml(Stream mem, Encoding encoding, Stack`1 position, MetaDataIO meta, ReadTagParams readTagParams)
   at ATL.AudioData.XmlArray.FromStream(Stream source, MetaDataIO meta, ReadTagParams readTagParams, Int64 chunkSize)
'BWF' is an undeclared prefix. Line 1, position 397.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32 linePos)
   at System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node)
   at System.Xml.XmlTextReaderImpl.ElementNamespaceLookup()
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at ATL.AudioData.XmlArray.readXml(Stream mem, Encoding encoding, Stack`1 position, MetaDataIO meta, ReadTagParams readTagParams)
   at ATL.AudioData.XmlArray.FromStream(Stream source, MetaDataIO meta, ReadTagParams readTagParams, Int64 chunkSize)
   at ATL.AudioData.IO.IXmlTag.FromStream(Stream source, MetaDataIO meta, ReadTagParams readTagParams, Int64 chunkSize)
   at ATL.AudioData.IO.WAV.readWAV(Stream source, ReadTagParams readTagParams)
   at ATL.AudioData.IO.WAV.read(Stream source, ReadTagParams readTagParams)
   at ATL.AudioData.IO.WAV.Read(Stream source, SizeInfo sizeNfo, ReadTagParams readTagParams)
   at ATL.AudioData.AudioDataManager.read(Stream source, ReadTagParams readTagParams)
   at ATL.AudioData.AudioDataManager.read(Stream source, Boolean readEmbeddedPictures, Boolean readAllMetaFrames, Boolean prepareForWriting)
   at ATL.AudioData.AudioDataManager.ReadFromFile(Boolean readEmbeddedPictures, Boolean readAllMetaFrames)
'BWF' is an undeclared prefix. Line 1, position 397.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32 linePos)
   at System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node)
   at System.Xml.XmlTextReaderImpl.ElementNamespaceLookup()
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at ATL.AudioData.XmlArray.readXml(Stream mem, Encoding encoding, Stack`1 position, MetaDataIO meta, ReadTagParams readTagParams)
   at ATL.AudioData.XmlArray.FromStream(Stream source, MetaDataIO meta, ReadTagParams readTagParams, Int64 chunkSize)
'BWF' is an undeclared prefix. Line 1, position 397.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32 linePos)
   at System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node)
   at System.Xml.XmlTextReaderImpl.ElementNamespaceLookup()
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at ATL.AudioData.XmlArray.readXml(Stream mem, Encoding encoding, Stack`1 position, MetaDataIO meta, ReadTagParams readTagParams)
   at ATL.AudioData.XmlArray.FromStream(Stream source, MetaDataIO meta, ReadTagParams readTagParams, Int64 chunkSize)
   at ATL.AudioData.IO.IXmlTag.FromStream(Stream source, MetaDataIO meta, ReadTagParams readTagParams, Int64 chunkSize)
   at ATL.AudioData.IO.WAV.readWAV(Stream source, ReadTagParams readTagParams)
   at ATL.AudioData.IO.WAV.read(Stream source, ReadTagParams readTagParams)
   at ATL.AudioData.IO.WAV.Read(Stream source, SizeInfo sizeNfo, ReadTagParams readTagParams)
   at ATL.AudioData.AudioDataManager.read(Stream source, ReadTagParams readTagParams)
   at ATL.AudioData.AudioDataManager.read(Stream source, Boolean readEmbeddedPictures, Boolean readAllMetaFrames, Boolean prepareForWriting)
   at ATL.AudioData.AudioDataManager.ReadFromFile(Boolean readEmbeddedPictures, Boolean readAllMetaFrames)

The error didn't shutdown my program, and even in debuging I can inspect the attributes on bext and ixml fields, but id3 fields like Comment and Title are all empty. And when run Track.Save(), nothing modified.

Code To Reproduce Issue [ Good To Have ]

CodeAndAudio.zip

@drunkenQCat
Copy link
Author

what's more, the no.38 audio file in the attachment can be read and written, that may help to debug.

@Zeugma440 Zeugma440 self-assigned this Sep 11, 2024
@Zeugma440 Zeugma440 added the bug label Sep 11, 2024
@Zeugma440
Copy link
Owner

Zeugma440 commented Sep 11, 2024

Hello and thanks for your report.

I think the software you're using to tag these files has a very special way of implementing iXML.

Here's how the data looks like in file 35 :

<?xml version="1.0" encoding="UTF-8"?>
<BWFXML>
	<ASWG>
		<notes>HAMMERING ON METAL PIPE</notes>
		<project>CONSTRUCTION, HAMMER</project>
	</ASWG>
	<BWF>
		<BWF_DESCRIPTION>HAMMERING ON METAL PIPE</BWF_DESCRIPTION>
		<BWF_TIME_REFERENCE_HIGH>0</BWF_TIME_REFERENCE_HIGH>
		<BWF_TIME_REFERENCE_LOW>0</BWF_TIME_REFERENCE_LOW>
	</BWF>
	<BWF:BWF_DESCRIPTION>HAMMERING ON METAL PIPE</BWF:BWF_DESCRIPTION>
	<BWF:BWF_DESCRIPTION:2>HAMMERING ON METAL PIPE</BWF:BWF_DESCRIPTION:2>
	<BWF:BWF_TIME_REFERENCE_HIGH>0</BWF:BWF_TIME_REFERENCE_HIGH>
	<BWF:BWF_TIME_REFERENCE_LOW>0</BWF:BWF_TIME_REFERENCE_LOW>
	<NOTE>HAMMERING ON METAL PIPE</NOTE>
	<PROJECT>CONSTRUCTION, HAMMER</PROJECT>
</BWFXML>

You'll notice the following artefacts :

  • BWF_DESCRIPTION comes in three flavours
    • The one inside the BWF tag
    • The one outside the BWF tag, prefixed with BWF: (1)
    • The one outside the BWF tag, prefixed with BWF: and suffixed with :2 (1)
  • BWF_TIME_REFERENCE_HIGH and BWF_TIME_REFERENCE_LOW come in two flavours
    • The one inside the BWF tag
    • The one outside the BWF tag, prefixed with BWF: (1)

(1) All these occurences are illegal according to XML, for which the : character means a namespace, which needs to be defined in the XML structure before being used.

Last but not least, the data structure is remotely similar to the actual iXML specification, but doesn't match what's recommended.

=> I'd recommend you contact the maintainer of the software you're using to send him this feedback.

PS : File 38 still has this strange data structure that kinda resembles the specification, but doesn't have any BWF: prefix nor :2 suffix, which makes it pass the basic checks ATL performs.

@drunkenQCat
Copy link
Author

oh, thanks a lot for your answer, I would have a contact to the author of reaper, and notice it to the other users. sincerely thank you.

@drunkenQCat drunkenQCat reopened this Sep 11, 2024
@drunkenQCat drunkenQCat closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2024
@Zeugma440 Zeugma440 added question and removed bug labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants