# Test tone generator

Generate a test tone as an audio file: sine, square or sawtooth wave at the frequency, length and volume you choose.

- Endpoint: `POST https://setget.net/v1/tools/audio-tone` with JSON `{"input": {...}}` (add `"wait": 30` to hold the reply until the job finishes)
- MCP: `run_tool` with `slug` = `audio-tone`
- Page: https://setget.net/tools/audio-tone

## Files in, files out

This is a file tool. Its file inputs take file references, not file contents and not web addresses.

- Get a reference by uploading: `curl -T FILE https://setget.net/drop/` prints a line `ref  <id>/f1`. Or `POST https://setget.net/v1/drops` with `{"files":[{"name","size"}]}`, PUT the bytes to the returned `upload.url` with the listed headers, and use the file's `ref`. Over MCP use the `drop` tool. A file under about 700 KB can also be sent in place as a `data:<type>;base64,<content>` URI.
- Uploads are at most 100 MB per file, are readable by anyone with the link, and expire (one hour by default). Programs are refused.
- The tool runs as a job. The reply is `{"tool", "ms", "result", "files", "job"}`: `result` is JSON, and every result file comes back in `files` as `{"name", "size", "content_type", "kind", "url", "ref"}`. Download it from `url`, or pass `ref` as the input of another file tool.
- A job still running when the wait ends answers 202 with `job`. Follow it with `GET https://setget.net/v1/jobs/<id>?wait=30`, or stream progress from `GET https://setget.net/v1/jobs/<id>/events` (over MCP: the `job` tool). A person can watch it at `job.url`.

## Inputs

- `frequency` (optional, number, default `440`, range 20..20000): Pitch of the tone in Hz. 440 is the note A; 1000 is the usual test tone.
- `duration` (optional, number, default `2`, range 0.1..60): Length of the tone in seconds, up to 60.
- `waveform` (optional, string, one of `sine`, `square`, `sawtooth`, default `"sine"`): Shape of the wave: sine is a pure tone, square and sawtooth sound buzzy.
- `volume` (optional, number, default `-12`, range -60..0): Peak level in dB below full volume: 0 is the loudest possible, -12 is comfortable.
- `format` (optional, string, one of `mp3`, `wav`, `ogg`, `opus`, `flac`, `m4a`, default `"wav"`): Format of the result.
- `sample_rate` (optional, integer, one of `16000`, `22050`, `44100`, `48000`, `96000`, default `44100`): Sample rate in Hz.
- `channels` (optional, string, one of `mono`, `stereo`, default `"mono"`): Mono, or stereo with the same tone on both sides.

## Example 1: One second of A at 440 Hz

```json
{"input":{"frequency":440,"duration":1},"wait":30}
```

## Example 2: A quiet 1 kHz square wave as MP3

```json
{"input":{"frequency":1000,"duration":2,"waveform":"square","volume":-20,"format":"mp3"},"wait":30}
```

**Why is there a limit on the frequency?** A file can only hold tones below half its sample rate. For tones above 20 kHz the limit of human hearing is passed anyway.

**Is it safe for speakers and ears?** Start with your volume low. Steady tones sound much louder than music at the same level, and square and sawtooth waves more so.
