Command-line interface

The CLI is installed with the package and is invoked as cobalstamp. As with the Python API, it requires the COBALSTAMP_KEY environment variable (Environment variables) and a network connection.

Audio files

The CLI reads and writes standard uncompressed WAV files, mono or multi-channel, at any sampling rate. The marked audio is written with the same channel layout as the input.

Marking

cobalstamp mark input.wav --output marked.wav --not-ai

The mark command marks the input audio file, registers the mark on the server, and writes the marked audio to the output file. The flags follow cobalstamp.mark():

  • --is-ai / --not-ai (exactly one is required): declare that the audio is created using AI, or not.

  • --ai-type generated|transformed (optional): the AI type, when --is-ai.

  • --clip compress|rescale|none (default compress): protects the marked audio from exceeding full scale.

The command prints the mark info as a single JSON document on stdout, in the same shape as the one returned by cobalstamp.mark():

{
  "marked": true,
  "mark_id": "eac8d9d9-c918-442b-b66c-13b1170ab2b3"
}

Detection

cobalstamp detect input.wav

The detect command looks for a registered Cobalstamp watermark in the input audio file and prints the server’s verdict as a single JSON document on stdout, or to the file given with -o. The verdict has the same shape as the one returned by cobalstamp.detect():

{
  "marked": true,
  "mark_id": "eac8d9d9-c918-442b-b66c-13b1170ab2b3",
  "is_ai": false,
  "ai_type": null,
  "ppid": "8JKH-A5VH-6DPD-M73L"
}

Forgetting test marks

cobalstamp forget <mark_id>
cobalstamp forget all

The forget command forgets a registered test mark, freeing the marked audio so it can be marked again. It prints the number of forgotten test marks on stdout, as cobalstamp.forget() does.

Exit codes

  • 0: success.

  • 1: a runtime error occurred (unreadable audio file, server error, network failure); a one-line message is printed on stderr.

  • 2: invalid command-line arguments.