microsoft/semantic-kernel · error · NotSupportedException

The audio transcription format '{responseFormat}' is not sup

Error message

The audio transcription format '{responseFormat}' is not supported.

What it means

Thrown by GetAudioTranscriptionFormat when mapping the provider's response-format string to the internal AudioTranscriptionFormat enum. The switch only recognizes the four formats the Whisper/OpenAI audio-transcription endpoint returns: 'json', 'verbose_json', 'vtt', and 'srt'. Any other string indicates an API/SDK drift (e.g. the service added a format the connector does not yet model) and is rejected rather than silently miscategorized.

Source

Thrown at dotnet/src/Connectors/Connectors.OpenAI/Core/ClientCore.AudioToText.cs:106

        }

        return result;
    }

    private static AudioTranscriptionFormat? ConvertResponseFormat(string? responseFormat)
    {
        if (responseFormat is null)
        {
            return null;
        }

        return responseFormat switch
        {
            "json" => AudioTranscriptionFormat.Simple,
            "verbose_json" => AudioTranscriptionFormat.Verbose,
            "vtt" => AudioTranscriptionFormat.Vtt,
            "srt" => AudioTranscriptionFormat.Srt,
            _ => throw new NotSupportedException($"The audio transcription format '{responseFormat}' is not supported.")
        };
    }

    private static Dictionary<string, object?> GetResponseMetadata(AudioTranscription audioTranscription)
        => new(3)
        {
            [nameof(audioTranscription.Language)] = audioTranscription.Language,
            [nameof(audioTranscription.Duration)] = audioTranscription.Duration,
            [nameof(audioTranscription.Segments)] = audioTranscription.Segments
        };
}

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Use only one of the supported tokens: 'json', 'verbose_json', 'vtt', or 'srt' for the response format.
  2. If a genuinely new format is required, upgrade the Microsoft.SematicKernel.Connectors.OpenAI package to a release that maps it.
  3. Inspect the exact responseFormat string at runtime (log it before the call) and correct the source producing it.
  4. Avoid feeding mime-types (e.g. 'audio/vtt'); pass the bare format name.

Example fix

// before
settings.ResponseFormat = "audio/srt";
// after
settings.ResponseFormat = "srt";
Defensive patterns

Strategy: validation

Validate before calling

static readonly HashSet<string> SupportedAudioFormats = new(StringComparer.OrdinalIgnoreCase) { "json", "verbose_json", "vtt", "srt" };
static string NormalizeAudioFormat(string f) => SupportedAudioFormats.Contains(f) ? f.ToLowerInvariant() : throw new ArgumentException($"Use one of: {string.Join(", ", SupportedAudioFormats)}");

Type guard

static bool IsValidAudioFormat(string? f) => f is not null && SupportedAudioFormats.Contains(f);

Try / catch

try { await kernel.InvokeAsync(audioToText, settings); }
catch (NotSupportedException ex) when (ex.Message.Contains("audio transcription format")) { /* log + fall back to 'json' */ }

Prevention

When it happens

Trigger: The OpenAI audio-transcription (speech-to-text) call returns a responseFormat value that is not one of json, verbose_json, vtt, or srt. Typically happens when the response format was set on the request to a value like 'text', 'mp3', or a typo, and the connector tries to normalize it back into an enum.

Common situations: Upgrading the OpenAI service to a version that emits a new transcription format while still on an older Connectors.OpenAI package; passing a raw mime-type ('audio/srt') instead of the logical format token ('srt'); copy-pasting a format string from a different SDK.

Related errors


AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13). Data as JSON: /api/errors/e0d12c3bfff25f5b. Report an issue: GitHub.