gchq/CyberChef · error · OperationError

No input data. Load an audio file (drag/drop or use the open

Error message

No input data. Load an audio file (drag/drop or use the open file button).

What it means

Thrown by the Extract Audio Metadata operation when the input is not an ArrayBuffer or is a zero-length ArrayBuffer. The operation expects raw audio file bytes (MP3, WAV, FLAC, OGG, etc.) to parse container and tag metadata. Without valid binary data there is nothing to sniff or parse.

Source

Thrown at src/core/operations/ExtractAudioMetadata.mjs:50

        this.presentType = "html";

        this.args = [
            { name: "Filename (optional)", type: "string", value: "" },
            { name: "Max embedded text bytes (iXML/axml/etc)", type: "number", value: 1024 * 512 },
        ];
    }

    /**
     * @param {ArrayBuffer} input
     * @param {Object[]} args
     * @returns {Object}
     */
    run(input, args) {
        const filename = (args?.[0] || "").trim() || null;
        const maxTextBytes = Number.isFinite(args?.[1]) ? Math.max(1024, args[1]) : 1024 * 512;

        if (!(input instanceof ArrayBuffer) || input.byteLength === 0)
            throw new OperationError("No input data. Load an audio file (drag/drop or use the open file button).");

        const bytes = new Uint8Array(input);
        const container = sniffContainer(bytes);
        const report = makeEmptyReport(filename, bytes.length, container);

        try {
            const parsers = {
                mp3: () => parseMp3(bytes, report),
                wav: () => parseRiffWave(bytes, report, maxTextBytes),
                bw64: () => parseRiffWave(bytes, report, maxTextBytes),
                flac: () => parseFlac(bytes, report, maxTextBytes),
                ogg: () => parseOgg(bytes, report),
                opus: () => parseOgg(bytes, report),
                mp4: () => parseMp4BestEffort(bytes, report),
                m4a: () => parseMp4BestEffort(bytes, report),
                aiff: () => parseAiffBestEffort(bytes, report, maxTextBytes),
                aac: () => parseAacAdts(bytes, report),
                ac3: () => parseAc3(bytes, report),

View on GitHub (pinned to 4290ea7539)

Solutions

  1. Load an audio file via drag/drop or the open file button so input is a non-empty ArrayBuffer.
  2. Ensure no upstream operation converts the data away from ArrayBuffer before this operation.
  3. Verify the file is non-empty and is a supported audio format.

Example fix

// before: input = '' (empty string) or input = new ArrayBuffer(0)

// after: input = <audio file ArrayBuffer with byteLength > 0>
Defensive patterns

Strategy: type-guard

Validate before calling

// Verify input is a non-empty ArrayBuffer before calling ExtractAudioMetadata
if (!(input instanceof ArrayBuffer) || input.byteLength === 0) {
  throw new Error('Load a non-empty audio file first');
}

Type guard

function isValidAudioInput(input) {
  return input instanceof ArrayBuffer && input.byteLength > 0;
}

Prevention

When it happens

Trigger: run(input, args) where input fails the check: !(input instanceof ArrayBuffer) || input.byteLength === 0. This happens when inputType is mismatched (e.g., string passed instead of ArrayBuffer) or when the file loaded is empty.

Common situations: User has not loaded a file into the input. Also occurs when an upstream operation in the recipe outputs a string or byteArray instead of an ArrayBuffer, or when an empty file is drag-dropped.

Related errors


AI-assisted analysis of gchq/CyberChef@4290ea7539 (2026-08-13). Data as JSON: /api/errors/6e66e724e8a6e6c2. Report an issue: GitHub.