# Verbatim Minutes

`minutes` reads a recording of a call (a 16-bit PCM WAV file you exported) and prints a set of minutes that records only the silences: every pause as a numbered item, the total dead air, the longest gap, and the rule it measured with. It writes the pauses that hold room tone to `gaps.wav`, joined with equal-power crossfades. Build it with `go build -o minutes .` (Go 1.22 or newer, standard library only) or download a release binary, then run `./minutes call.wav`. The real input is a WAV of your own: an exported call, or a recording of your own room. It never modifies the input and never overwrites a file.

## The notice

`minutes` with nothing after it, or `minutes -h`, prints this and exits 0:

```
minutes: records the silences in a recording, and only those.

  minutes [flags] recording.wav

  -min SECONDS   shortest pause that gets a minute (default 2.0)
  -above DB      loudness over the noise floor that still counts
                 as quiet (default 6.0)
  -o FILE        where the pauses are joined (default gaps.wav)

Reads 16-bit PCM WAV, mono or stereo, at any sample rate. For
other formats, convert and keep the date (Dated: reads it):
  ffmpeg -i call.m4a -c:a pcm_s16le call.wav
  or, on a Mac: afconvert -f WAVE -d LEI16 call.m4a call.wav
  touch -r call.m4a call.wav

Prints the numbered pauses, the total dead air and the longest
gap. Writes the pauses that hold room tone to gaps.wav.

normal is dead
```

## Getting it

First choice, a release binary. `bash scripts/release.sh` builds five static binaries into `dist/`, with no Go needed on the machine that runs them:

- `minutes-darwin-arm64`: a Mac with Apple silicon (M1 and later)
- `minutes-darwin-amd64`: an Intel Mac
- `minutes-linux-amd64`: Linux on a usual PC or server
- `minutes-linux-arm64`: Linux on 64-bit ARM
- `minutes-windows-amd64.exe`: Windows

On a Mac, a downloaded binary carries a quarantine flag. Clear it and make it runnable:

```
xattr -d com.apple.quarantine minutes-darwin-arm64 && chmod +x minutes-darwin-arm64
```

Second choice, from source: `go build -o minutes .` in this folder.

## A run on the generated test signal

`bash scripts/fixture.sh` writes `fixture.wav`, a generated test signal (sox tone, sox white noise and exact digital zero, 34.7 s at 16 kHz). It is not a recording of anything. `./minutes fixture.wav` prints:

```
Minutes

Meeting:  fixture.wav
Dated:    2026-10-14
Length:   34.7 s (16000 Hz, 1 channel, 16-bit)
Present:  (none recorded)

Rule
  Floor    -60.5 dBFS: the quietest tenth of the 20 ms windows
           that are not digital zero.
  Quiet    no more than 6.0 dB over the floor (-54.5 dBFS).
  Pause    quiet for at least 2.0 s.
  Copied   to gaps.wav when room tone fills 90% or more of the
           pause, less 0.05 s trimmed from each end.

Items
  Item  Start       Length  Level     Tone  Copied
  1.    00:00:03.0  4.2 s   -60.2 dB  100%  yes
  2.    00:00:12.2  6.0 s   -inf      0%    no
  3.    00:00:25.7  8.0 s   -60.2 dB  100%  yes

Totals
  Dead air       18.2 s of 34.7 s (52.4%) in 3 pauses.
  Longest        8.0 s, item 3, at 00:00:25.7.
  No room tone   1 pause, 6.0 s: digital zero in the file.
                 Not copied.
  Room tone      gaps.wav, 12.0 s, 2 pauses.

normal is dead
```

Item 2 is the stretch of exact zero: a platform that gated the line leaves the same thing. It is minuted and not copied. `gaps.wav` here is 11.99 s of the generated noise.

Speed, measured on a generated file of 7182.9 s (the fixture repeated 207 times) on a 2 core ARM Linux machine: 1.86 s of wall time, 21.7 MB peak memory.

## Making a WAV

From an m4a, mp3 or any other format, convert to 16-bit PCM and then give the WAV the date of the original, because `Dated:` reads the file's modification date:

```
ffmpeg -i call.m4a -c:a pcm_s16le call.wav
touch -r call.m4a call.wav
```

On a Mac without ffmpeg, `afconvert` ships with macOS:

```
afconvert -f WAVE -d LEI16 call.m4a call.wav
touch -r call.m4a call.wav
```

On Windows, after converting, in PowerShell:

```
(Get-Item call.wav).LastWriteTime = (Get-Item call.m4a).LastWriteTime
```

Any audio editor that exports 16-bit WAV works too. A file that is already a WAV but 24-bit or float is refused with the exact command to convert it to a new name (`call16.wav`), never over itself.

## Recording a room of your own

On a Mac (asks for microphone permission once; list devices with `ffmpeg -f avfoundation -list_devices true -i ""`):

```
ffmpeg -f avfoundation -i ":0" -t 120 -ac 1 -ar 16000 -c:a pcm_s16le room.wav
```

On Linux:

```
arecord -f S16_LE -r 16000 -d 120 room.wav
```

## Known behaviours

- There is no bridging. A keyboard click that rises above the threshold splits a pause in two, and each part must last `-min` on its own. Raise `-above` on a noisy call.
- The floor is the recording's own: the 10th percentile of the 20 ms windows that are not digital zero. A call with a fan that cycles or an echo tail will need `-above` or `-min` tuned. Every run prints the values it used.
- When that floor is above -30 dBFS there is no room tone to measure against. Only digital zero then counts as quiet, and the `Quiet` line says so.
- Channels are measured as power across all of them, never a downmix. In a stereo call the louder channel sets the result.
- A file that was resampled can carry a few low samples into the edge of a digital zero stretch. That pause then reads a level such as `-93.9 dB` and `1%` instead of `-inf` and `0%`. It is still not copied.
- Plain WAV up to 4 GiB only. RF64, BW64, 8-bit, 24-bit, float and compressed WAVs are refused with a conversion line.

## Checks

`go vet ./... && go test ./...` runs the unit tests on signals the test code generates. `bash scripts/e2e.sh` runs every acceptance check end to end (it needs sox, soxi, ffmpeg, xxd and tmux) and prints each as pass, fail or skipped. `MINUTES_REAL=room.wav bash scripts/e2e.sh` adds the checks that hold for any real recording.

## Colophon

One rule, one document, one file of the room. Set in whatever monospace your terminal already had, at 64 columns.

normal is dead
