MCPcopy Create free account
hub / github.com/FunAudioLLM/FunMusic / write_ecdc_header

Function write_ecdc_header

inspiremusic/utils/binary.py:21–28  ·  view source on GitHub ↗
(fo: tp.IO[bytes], metadata: tp.Any)

Source from the content-addressed store, hash-verified

19
20
21def write_ecdc_header(fo: tp.IO[bytes], metadata: tp.Any):
22 meta_dumped = json.dumps(metadata).encode('utf-8')
23 version = 0
24 header = _encodec_header_struct.pack(_ENCODEC_MAGIC, version,
25 len(meta_dumped))
26 fo.write(header)
27 fo.write(meta_dumped)
28 fo.flush()
29
30
31def _read_exactly(fo: tp.IO[bytes], size: int) -> bytes:

Callers

nothing calls this directly

Calls 2

encodeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected