{
  "slug": "wav-samples-to-json",
  "name": "gizza-ai/wav-samples-to-json",
  "version": "0.1.0",
  "title": "WAV to JSON — Export PCM Samples + Format Metadata — gizza.ai",
  "description": "Paste an uncompressed WAV as base64 or hex and get JSON: the sample rate, channels, bit depth and duration alongside the PCM samples as an array. Runs in your browser.",
  "tags": [
    "wav to json",
    "wav samples to json",
    "pcm samples to json",
    "wav to json converter",
    "audio samples json",
    "wav metadata json",
    "export wav samples",
    "wav sample array",
    "wav decoder json",
    "waveform json"
  ],
  "category": "audio",
  "urls": {
    "page": "https://gizza.ai/tools/wav-samples-to-json/",
    "markdown": "https://gizza.ai/tools/wav-samples-to-json/index.md",
    "descriptor": "https://gizza.ai/tools/wav-samples-to-json/tool.json",
    "deep_link_example": "https://gizza.ai/tools/wav-samples-to-json/?input=UklGRioAAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YQYAAAAAQADgAAA%3D&input_format=base64&output=full&layout=interleaved&value_scale=float&precision=6&start_frame=0&frame_step=1&max_frames=50000&indent=2"
  },
  "cli": "gizza tool wav-samples-to-json \"UklGRioAAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YQYAAAAAQADgAAA=\"",
  "tool": {
    "description": "Decode an uncompressed WAV clip (pasted as base64 or hex bytes) and emit JSON: the format metadata read from the fmt chunk (sample rate, channels, bit depth, encoding, format tag, byte rate, block align, total frames, duration) alongside the decoded PCM samples as a JSON array you can paste straight into code. Choose interleaved or per-channel layout, the value scale (normalized float in [-1,1], raw PCM integer at the source bit depth, or dBFS), the decimal precision, the JSON indent (0 = compact), a start_frame/max_frames window, and a frame_step stride that decimates a long clip down to a waveform-preview-sized array. Output can be the full document, just the samples array, or just the metadata object. Decodes RIFF/WAVE PCM 8/16/24/32-bit integer and 32/64-bit IEEE float; compressed MP3/AAC/FLAC/Ogg/A-law/mu-law inputs are rejected clearly rather than guessed.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "frame_step": {
          "default": 1,
          "description": "Keep every Nth sample frame (1-10000, default 1 = keep every frame). Use it to decimate a long clip down to a waveform-preview-sized array, e.g. 441 gives about 100 points per second at 44100 Hz.",
          "maximum": 10000,
          "minimum": 1,
          "type": "integer"
        },
        "indent": {
          "default": 2,
          "description": "JSON indentation width in spaces (0-8, default 2). Set 0 for compact single-line JSON. Numeric sample arrays always stay on one line so the document does not explode to one value per line.",
          "maximum": 8,
          "minimum": 0,
          "type": "integer"
        },
        "input": {
          "description": "Uncompressed WAV audio bytes encoded as base64 (default) or hex, e.g. the output of `base64 clip.wav`. Only RIFF/WAVE PCM 8/16/24/32-bit integer or 32/64-bit IEEE float is decoded; compressed MP3/AAC/FLAC/Ogg/A-law/mu-law is rejected with a message naming the detected format.",
          "type": "string"
        },
        "input_format": {
          "default": "base64",
          "description": "Encoding of the pasted WAV bytes: 'base64' (default) or 'hex'. Hex may include whitespace, ':' or '-' separators.",
          "enum": [
            "base64",
            "hex"
          ],
          "type": "string"
        },
        "layout": {
          "default": "interleaved",
          "description": "Shape of the samples array. 'interleaved' (default) = one flat array with channels interleaved L,R,L,R... 'channels' = an array per channel (de-interleaved), so samples[0] is the left channel and samples[1] the right.",
          "enum": [
            "interleaved",
            "channels"
          ],
          "type": "string"
        },
        "max_frames": {
          "default": 50000,
          "description": "Maximum number of sample frames to export AFTER frame_step decimation (1-200000, default 50000). Bounds the JSON size; use start_frame to page through a longer clip.",
          "maximum": 200000,
          "minimum": 1,
          "type": "integer"
        },
        "output": {
          "default": "full",
          "description": "What the JSON document contains. 'full' (default) = an object with a 'metadata' block (sampleRate, channels, bitDepth, encoding, formatTag, byteRate, blockAlign, totalFrames, durationSeconds), an 'export' block describing the window, and the 'samples' array. 'samples' = the bare sample array only, ready to paste into code. 'metadata' = the format object only, no samples.",
          "enum": [
            "full",
            "samples",
            "metadata"
          ],
          "type": "string"
        },
        "precision": {
          "default": 6,
          "description": "Decimal places for 'float' and 'db' sample values (0-15, default 6). Ignored for the integer 'int' scale. Lower it to shrink the JSON: 3 is plenty for a waveform preview.",
          "maximum": 15,
          "minimum": 0,
          "type": "integer"
        },
        "start_frame": {
          "default": 0,
          "description": "Zero-based index of the first sample frame to export (default 0). One frame is one sample per channel, so at 44100 Hz frame 44100 is one second in. Errors if it is at or past the end of the clip.",
          "minimum": 0,
          "type": "integer"
        },
        "value_scale": {
          "default": "float",
          "description": "How each sample value is written. 'float' (default) = normalized amplitude in [-1,1]; 'int' = the raw PCM integer at the source bit depth (a 16-bit source gives -32768..32767; float-WAV sources scale to 32-bit); 'db' = dBFS magnitude (0 = full scale, silence = -120).",
          "enum": [
            "float",
            "int",
            "db"
          ],
          "type": "string"
        }
      },
      "required": [
        "input"
      ],
      "type": "object"
    }
  }
}