lib.rs

crates/veilvoice-meta/src/lib.rs

veilvoice-meta · 121 lines · read the source here · or on GitHub

Strip or spoof the identifying metadata that rides along with media files.

Why this exists

De-identifying a voice accomplishes nothing if the file still says who recorded it. A phone recording routinely carries the device model, the recording software, a precise timestamp and, for images, GPS coordinates accurate to a few metres. That is often a far easier way to identify someone than analysing their voice, and it survives every DSP transform because it is not in the audio at all.

Strip versus spoof

Removing every tag is not always the least conspicuous choice. A file with no metadata whatsoever is itself a signal: it says the sender was trying to hide something, and it stands out in a set of otherwise ordinary files. Policy therefore offers two approaches:

  • Policy::Strip removes everything. Best when the file is expected to be sanitised anyway, or when any false statement would be worse than an obvious absence.
  • Policy::Realistic replaces the tags with plausible, non-identifying values so the file looks unremarkable rather than scrubbed.

What this crate cannot do

It removes container metadata. It cannot remove information encoded in the media itself: a photograph still shows the room it was taken in, and audio still carries its room acoustics and background noise. Nor does it touch filesystem timestamps or the filename, both of which are outside the file, callers that care must handle those separately.

In plain words

This strips the hidden labels off a file.

Photographs and recordings carry information you never typed: where the picture was taken, which phone or microphone made it, what the file was called before, sometimes a name. Removing the sound of a voice and leaving that behind would be pointless, so this takes it out -- not by blanking the fields, but by removing the parts of the file that hold them.

WHAT THIS FILE CONTAINS

121 lines defining 4 functions (0 public), 3 types and 1 constant. Everything below is read out of the source, so it cannot disagree with the code.

The types it owns.

  • enum Policy line 61 · How aggressively to rewrite metadata.
  • struct Report line 72 · What changed in a single file.
  • enum Error line 89 · Everything that can go wrong in this crate.

WHAT CALLS WHAT

Report::note line 80 Error::from line 99 Error::fmt line 105 Error::source line 115 helper: private to this file dashed: a call that goes back up, or across a wrapped rank The functions this file defines, and the calls between them. An edge means the callee's name appears, called, inside the caller's body. This is a syntactic reading, not a type-resolved one.

The functions this file defines, and the calls between them. An edge means the callee's name appears, called, inside the caller's body. This is a syntactic reading, not a type-resolved one.

The same graph as Mermaid source
%%{init: {"theme":"base","themeVariables":{"background":"#1a1b26","primaryColor":"#1f2335","primaryTextColor":"#c0caf5","primaryBorderColor":"#7aa2f7","secondaryColor":"#16161e","tertiaryColor":"#16161e","lineColor":"#737aa2","textColor":"#c0caf5","mainBkg":"#1f2335","nodeBorder":"#7aa2f7","clusterBkg":"#16161e","clusterBorder":"#2f3549","fontFamily":"ui-monospace, SFMono-Regular, Consolas, monospace","fontSize":"14px"}}}%%
flowchart TD
    n_note["Report::note<br/>line 80"]
    n_from["Error::from<br/>line 99"]
    n_fmt["Error::fmt<br/>line 105"]
    n_source["Error::source<br/>line 115"]
    click n_note href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-meta/src/lib.rs#L80" "open the source"
    click n_from href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-meta/src/lib.rs#L99" "open the source"
    click n_fmt href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-meta/src/lib.rs#L105" "open the source"
    click n_source href "https://github.com/tilas01/veilvoice/blob/main/crates/veilvoice-meta/src/lib.rs#L115" "open the source"
    classDef helper fill:#1f2335,stroke:#bb9af7,color:#c0caf5
    class n_note,n_from,n_fmt,n_source helper

This site loads no third-party script, so it cannot run Mermaid; the diagram above is the same nodes and edges drawn by the generator instead. GitHub renders the source below directly.

ITEMS

ItemLineDocumentation
VERSION pub const57Crate version string, surfaced in the About panel.
Policy pub enum61How aggressively to rewrite metadata.
Report pub struct72What changed in a single file.
Report::note fn80
Error pub enum89Everything that can go wrong in this crate.
Error::from fn99
Error::fmt fn105
Error::source fn115