"""Gap 13: BWF/INFO metadata chunks cho WAV export (EBU Tech 3285 + RIFF INFO). sf.write chi ghi fmt/data — ham nay chen bext (602 bytes fixed + coding history) va LIST/INFO (INAM title, IART artist, ISRC, ICMT comment) ngay truoc data chunk roi ghi lai file. Pure stdlib (struct/datetime). """ import datetime import struct _BEXT_FIXED = 602 def _pad(text, length): raw = text.encode("utf-8", errors="replace") return (raw[:length] + b"\x00" * length)[:length] def _chunk(fourcc, payload): pad = b"\x00" if len(payload) % 2 else b"" return fourcc + struct.pack("