{
  "slug": "wav-to-numpy-npy",
  "name": "gizza-ai/wav-to-numpy-npy",
  "version": "0.1.0",
  "title": "WAV to NumPy NPY Converter — PCM Audio Array Export — gizza.ai",
  "description": "Paste WAV bytes as base64 or hex and export decoded PCM samples as a NumPy .npy array with dtype, shape, mono, order, and frame-window controls.",
  "tags": [
    "wav to numpy",
    "wav to npy",
    "audio array",
    "numpy npy",
    "pcm samples",
    "wav decoder",
    "scipy wavfile",
    "soundfile array",
    "audio ml preprocessing",
    "base64 wav"
  ],
  "category": "audio",
  "urls": {
    "page": "https://gizza.ai/tools/wav-to-numpy-npy/",
    "markdown": "https://gizza.ai/tools/wav-to-numpy-npy/index.md",
    "descriptor": "https://gizza.ai/tools/wav-to-numpy-npy/tool.json",
    "deep_link_example": "https://gizza.ai/tools/wav-to-numpy-npy/?input=UklGRioAAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YQYAAAAAQADgAAA%3D&input_format=base64&dtype=float32&shape=auto&mono=true&fortran_order=true&start_frame=0&max_frames=0&output=base64"
  },
  "cli": "gizza tool wav-to-numpy-npy \"UklGRioAAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YQYAAAAAQADgAAA=\"",
  "tool": {
    "description": "Decode an uncompressed WAV clip (pasted as base64 or hex bytes) and export its PCM samples as a NumPy .npy v1.0 array file that np.load() reads back directly. Choose the dtype (float32/float64 normalized to [-1,1], int16/int32/uint8 scaled to full range, or 'auto' for the source's own dtype and raw stored values the way scipy.io.wavfile.read returns them), the shape (1-D for mono and (frames, channels) otherwise, always-2-D, channels-first, or flat interleaved), an optional mono downmix, C or Fortran memory order, and a start_frame/max_frames window. Returns the .npy as base64 or hex, or an 'info' report of the source format, the resulting array header and byte sizes plus a np.load snippet. Decodes RIFF/WAVE PCM 8/16/24/32-bit integer and 32/64-bit IEEE float; compressed MP3/AAC/FLAC/Ogg and companded A-law/mu-law input is rejected clearly rather than guessed.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "dtype": {
          "default": "float32",
          "description": "NumPy dtype of the exported array. 'float32' (default) and 'float64' write the normalized amplitude in [-1,1]; 'int16', 'int32' and 'uint8' write integers scaled to that type's full range; 'auto' keeps the source's own dtype and its raw stored values, matching scipy.io.wavfile.read (8-bit->uint8, 16-bit->int16, 24/32-bit->int32 left-justified, float->float32/float64).",
          "enum": [
            "float32",
            "float64",
            "int16",
            "int32",
            "uint8",
            "auto"
          ],
          "type": "string"
        },
        "fortran_order": {
          "default": false,
          "description": "Write column-major (Fortran) data and set the .npy header's fortran_order flag. Default false = C order, what numpy.save writes for a freshly read array. Ignored for 1-D shapes, which NumPy always records as fortran_order: False.",
          "type": "boolean"
        },
        "input": {
          "description": "Uncompressed WAV audio bytes encoded as base64 (default) or hex. Only RIFF/WAVE PCM 8/16/24/32-bit integer or 32/64-bit IEEE float is decoded; compressed MP3/AAC/FLAC/Ogg and companded A-law/mu-law input is rejected with a clear message.",
          "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"
        },
        "max_frames": {
          "default": 0,
          "description": "How many sample frames to export, starting at start_frame (0-1000000). '0' (the default) exports to the end of the clip. The export is additionally bounded by a 4000000-value array cap and a per-output byte cap.",
          "maximum": 1000000,
          "minimum": 0,
          "type": "integer"
        },
        "mono": {
          "default": false,
          "description": "Average all channels down to one before exporting (default false, which keeps every channel). A downmix is lossy and cannot be undone, so it is opt-in.",
          "type": "boolean"
        },
        "output": {
          "default": "base64",
          "description": "How the .npy file is returned: 'base64' (default, decode it with `base64 -d > audio.npy`), 'hex' (one unbroken run, reversed by `xxd -r -p`), or 'info' (a report of the source format, the resulting dtype/shape/order/byte sizes and a ready-to-run np.load snippet, with no sample bytes).",
          "enum": [
            "base64",
            "hex",
            "info"
          ],
          "type": "string"
        },
        "shape": {
          "default": "auto",
          "description": "Array shape. 'auto' (default) is 1-D (frames,) for mono and 2-D (frames, channels) otherwise, like scipy/soundfile; 'frames_channels' is always 2-D even for mono (soundfile's always_2d); 'channels_frames' transposes to (channels, frames), the torchaudio layout; 'flat' is a 1-D interleaved array of every sample.",
          "enum": [
            "auto",
            "frames_channels",
            "channels_frames",
            "flat"
          ],
          "type": "string"
        },
        "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"
        }
      },
      "required": [
        "input"
      ],
      "type": "object"
    }
  }
}