Guth
NewsDocs
Page actions
View as Markdown ↗
Explore MCP tools ↗

instrument implementation / implementation-contract

Audio File Size Estimator implementation

A source-bound implementation contract for Audio File Size Estimator; deployment and executable qualification remain separate.

Status: VERIFIED_CLEANLifecycle: implementation-contract

Binding contract

This record describes what an executable surface must bind and validate. It does not claim that a public calculator, package, or production route is deployed.

Record owner
Guth Instruments
Lifecycle
verified-clean
Evidence ID
t3-013
Effect
Computation or source lookup only

Input and validation requirements

  • A lossy estimate cannot be computed when bitrate is omitted; the interface must require bitrate for lossy mode or clearly report missing input.
  • Reject or clearly handle nonpositive sample rates, bit depths, channel counts, and negative durations; zero duration should produce zero bytes.
  • Validate that bitrate is positive for lossy mode and that kbps-to-bits-per-second conversion is applied exactly once.
  • Very long durations or large sample rates can exceed JavaScript safe integer precision if calculations are not guarded or performed with suitable numeric handling.
  • A WAV file's actual size can exceed the PCM payload estimate because of headers, metadata, padding, and container structure.

Required corrections

No binding erratum is attached to this unique-name record. Implementers must still preserve the declared units, domain, and failure behavior.

Inspectable interface fixture

The sample below is evidence for interface and validation tests, not a production implementation.

{
  "inputs": {
    "mode": "PCM/WAV payload",
    "sample_rate_hz": 44100,
    "bit_depth_bits": 16,
    "channels": 2,
    "duration_seconds": 180
  },
  "expected_outputs": {
    "payload_bytes": 31752000,
    "payload_MB_decimal": 31.752,
    "payload_MiB": 30.2810668945
  },
  "working": "16 / 8 = 2 bytes/sample. 44100 samples/s × 2 bytes/sample × 2 channels = 176400 bytes/s. 176400 × 180 s = 31752000 bytes. 31752000 / 1000000 = 31.752 MB. 31752000 / 1048576 = 30.2810668945 MiB."
}

Other records

Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

  • VERIFIED_LEDGER.json
  • evidence-tranche3/tranche3-results.json