Module lip

Module lip 

Source
Expand description

LIP binary lip-sync support. LIP binary reader and writer.

LIP files store lip-sync animation keyframes for voiced dialogue. Each keyframe maps a timestamp to a viseme (mouth shape) index.

§Format Layout

+------------------------------+ 0x0000
| Header (16 bytes)            |
+------------------------------+ 0x0010
| Keyframe table               |
| 5 bytes * entry_count        |
+------------------------------+

§Header (16 bytes)

0x00..0x04  magic        "LIP "
0x04..0x08  version      "V1.0"
0x08..0x0C  length       (f32)
0x0C..0x10  entry_count  (u32)

§Keyframe Entry (5 bytes)

0x00..0x04  time         (f32)
0x04..0x05  shape        (u8)

Structs§

Lip
In-memory LIP container.
LipKeyframe
One LIP keyframe entry.
LipShapeCode
Lossless LIP shape code wrapper.

Enums§

LipBinaryError
Errors produced while parsing or serializing LIP binary data.
LipShape
Known LIP viseme (mouth shape) IDs.

Functions§

read_lip
Reads a LIP file from a reader.
read_lip_from_bytes
Reads a LIP file directly from bytes.
write_lip
Writes a LIP file to a writer.
write_lip_to_vec
Serializes a LIP file into bytes.