Comments (7)
Hi and thanks for your feedback.
Could you please explain which field you're saving to ? WAV has many chunks that follow different specifications.
from atldotnet.
public void WriteMetaData()
{
foreach (var item in LogList)
{
foreach (var bwf in item.bwfList)
{
Track tr = new(bwf.FullName);
WriteAdditional(tr, "ixml.SCENE", item.scn + "-" + item.sht);
WriteAdditional(tr, "ixml.TAKE", item.tk.ToString());
WriteAdditional(tr, "ixml.NOTE", item.scnNote + "," + item.shtNote);
WriteAdditional(tr, "ixml.CIRCLED", (item.okTk == TkStatus.ok) ? "TRUE" : "FALSE");
WriteAdditional(tr, "ixml.TAKE_TYPE", (item.okTk == TkStatus.bad) ? "NO_GOOD" : "DEFAULT");
WriteAdditional(tr, "ixml.WILD_TRACK", (item.tkNote.Contains("wild")) ? "TRUE" : "FALSE");
tr.Description = item.tkNote;
tr.Title = item.shtNote;
tr.Save();
}
}
}
void WriteAdditional(Track tr, string tag, string content)
{
if (tr.AdditionalFields.ContainsKey(tag)) tr.AdditionalFields[tag] = content;
else tr.AdditionalFields.Add(tag, content);
}
the random code happened in ixml.NOTE and question mark in description and title.
from atldotnet.
I tried to modify the source to make it enabled to write the utf8 information I need.
#203
it fixed. the picture I show in Details is the problem of waveagent. the utf8 information showed correctly in metadata management softwares. here is an example in reaper:
the title is still random code in File Explorer because the default encoder of my system is GB2312.
that's the problem. I read CharsetDetector/UTF-unknown#143 and learn that it maybe the problem caused by this. So it is caused that the Settings.DefaultTextEncoding did not cover the other fields?
from atldotnet.
I tried to decipher these garbled codes and found that they were encoded by ISO-8859-1 but decoded by utf8
The places where you found garbled text are read and written using ISO-8859-1
, which does not support oriental characters.
I've done that because of what specifications say :
BEXT
(used for the description field) : Specifications say the string fields should be written usingASCII
. However,ASCII
being a subset ofUTF-8
, we can switch toUTF-8
without any issueπLIST INFO
(used for the title field) : Specifications say the string fields should be written usingASCII
. However,ASCII
being a subset ofUTF-8
, we can switch toUTF-8
without any issue π- Other fields you've written use the
iXML
structure, which is alreadyUTF-8
-encoded π
the title is still random code in File Explorer because the default encoder of my system is
GB2312
.
Precisely. Western versions of Windows use ISO-8859-1
as their default encoding. They assume WAV metadata are encoded using ISO-8859-1
, which works because WAV metadata is usually encoded using ASCII
, which is a subset of ISO-8859-1
.
Your version of Windows might be expecting GB2312
, which is not compatible with UTF-8
, hence the garbled characters displayed on the Explorer.
=> Another way of fixing that issue and make Windows happy would be to use Settings.DefaultTextEncoding
instead of UTF-8
in the library code, and set Settings.DefaultTextEncoding
to System.Text.Encoding.GetEncoding("GB2312")
in your application code.
That would fix the issue with your Windows, but would completely deviate from the BEXT
and LIST INFO
specifications, which would make the text you save unreadable on a western computer. That's why I'd rather hardcode UTF-8
as suggested above.
Do you agree with me on that one ?
I read CharsetDetector/UTF-unknown#143 and learn that it maybe the problem caused by this.
This has nothing to do with WAV files. UTF-unknown is only used by the library to detect CUE sheets encoding.
from atldotnet.
Thanks for your detailed explaination, it answered a lot of problems. And I have to appologize for my ambgious description. I totally agree the answer, the random code on windows explorer in fact dosen't matter in sound production, I have felt the benefit of utf8 especially when I cooperate with others whose OS is macOS.
Beside, I finally find that the most important bug:
all the Chinese metadata written in my bext turned into question marks, which in binary 3F
is actually caused by
WavHelper.writeFixedTextValue(description, 256, w);
which uses Latin1Encoding as encoder to utf8 text. I inferred that Lain1Encoding.GetBytes(utf8Text)
may return 3F
(question mark) when out of range.
I varified the problem:
It is actually caused by GetBytes.
from atldotnet.
Perfect, thanks for confirming π
I'm gonna publish a fixed version in the following days. Stay tuned~
from atldotnet.
Fix is available on today's v4.34
from atldotnet.
Related Issues (20)
- Playlist API simplification HOT 3
- Strings in ID3v2.4 tags too long? HOT 15
- Unable to set PublishingDate for flac files HOT 5
- Some Required Header Information Shown as Additional Fields HOT 20
- Parse Metadata from partial `m4a`/`m4b` HOT 2
- Cannot update wav metadata tags (riff_info) on windows 11 HOT 7
- Not reflecting chapter title changes made with MP3Tag anymore HOT 6
- Loading a (possibly corrupt) AIF file puts ATL in an endless loop HOT 6
- The BPM field won't be extracted if the value contains a BOM HOT 4
- MP3 Title contains extra character starting in 5.04 HOT 5
- Cannot CopyMetadataTo HOT 15
- Add support ENCODEDBY HOT 9
- get image HOT 1
- Ambisonic bwav files cannot be written and don't throw an exception HOT 5
- wav file duration is not determined HOT 2
- OptimFROG blind tags HOT 6
- long .ogg file loading HOT 3
- more understandable name HOT 6
- Chinese encoding exception HOT 6
- Reading MP3 files whose ID3v2 tags contain multiple PRIV frames HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atldotnet.