google/ExoPlayer · error · AudioProcessor.UnhandledAudioFormatException

Unhandled input format: ${audioFormat}

Error message

Unhandled input format: ${audioFormat}

What it means

AudioProcessingPipeline.configure(AudioFormat) chains configure() across every AudioProcessor in the pipeline and throws AudioProcessor.UnhandledAudioFormatException when the chain cannot accept the input format. The explicitly shown case is inputAudioFormat.equals(AudioFormat.NOT_SET) — configuring with an unset format — but any processor in the chain may also throw UnhandledAudioFormatException for encodings/channel counts it rejects, and that propagates out of the pipeline.

Source

Thrown at library/common/src/main/java/com/google/android/exoplayer2/audio/AudioProcessingPipeline.java:129

   * Configures the pipeline to process input audio with the specified format. Returns the
   * configured output audio format.
   *
   * <p>To apply the new configuration for use, the pipeline must be {@linkplain #flush() flushed}.
   * Before applying the new configuration, it is safe to queue input and get output in the old
   * input/output formats/configuration. Call {@link #queueEndOfStream()} when no more input will be
   * supplied for processing in the old configuration.
   *
   * @param inputAudioFormat The format of audio that will be queued after the next call to {@link
   *     #flush()}.
   * @return The configured output audio format.
   * @throws AudioProcessor.UnhandledAudioFormatException If the specified format is not supported
   *     by the pipeline.
   */
  @CanIgnoreReturnValue
  public AudioFormat configure(AudioFormat inputAudioFormat)
      throws AudioProcessor.UnhandledAudioFormatException {
    if (inputAudioFormat.equals(AudioFormat.NOT_SET)) {
      throw new AudioProcessor.UnhandledAudioFormatException(inputAudioFormat);
    }

    AudioFormat intermediateAudioFormat = inputAudioFormat;

    for (int i = 0; i < audioProcessors.size(); i++) {
      AudioProcessor audioProcessor = audioProcessors.get(i);
      AudioFormat nextFormat = audioProcessor.configure(intermediateAudioFormat);
      if (audioProcessor.isActive()) {
        checkState(!nextFormat.equals(AudioFormat.NOT_SET));
        intermediateAudioFormat = nextFormat;
      }
    }

    return pendingOutputAudioFormat = intermediateAudioFormat;
  }

  /**
   * Clears any buffered data and pending output. If any underlying audio processors are {@linkplain

View on GitHub (pinned to dd430f7053)

Solutions

  1. Check inputAudioFormat against AudioFormat.NOT_SET before configuring and only call configure() once a real format is available.
  2. Verify the source produces C.ENCODING_PCM_16BIT (or insert ToInt16PcmAudioProcessor ahead of the chain) since most built-in processors require 16-bit PCM.
  3. Inspect which processor throws by configuring each AudioProcessor individually; replace or remove the restrictive one for the offending channel count.
  4. Catch AudioProcessor.UnhandledAudioFormatException at the renderer level to disable the failing processor rather than crash playback.

Example fix

// before
pipeline.configure(AudioFormat.NOT_SET); // throws UnhandledAudioFormatException

// after
if (!inputFormat.equals(AudioFormat.NOT_SET)
    && inputFormat.encoding == C.ENCODING_PCM_16BIT) {
  AudioFormat out = pipeline.configure(inputFormat);
} else {
  // skip processing, use passthrough path
}
Defensive patterns

Strategy: try-catch

Validate before calling

public boolean isPipelineFormatSupported(AudioProcessingPipeline p, AudioFormat f) {
  if (f.equals(AudioFormat.NOT_SET)) return false;
  try {
    // dry-run configure on a scratch instance or the same pipeline before flush
    p.configure(f);
    return true;
  } catch (AudioProcessor.UnhandledAudioFormatException e) {
    return false;
  }
}

Try / catch

try {
  pipeline.configure(inputFormat);
} catch (AudioProcessor.UnhandledAudioFormatException e) {
  // Disable the unsupported processor and use a shorter chain / passthrough
  Log.w(TAG, "Unsupported audio format " + e.getAudioFormat(), e);
  pipeline = new AudioProcessingPipeline(ImmutableList.of());
  pipeline.configure(inputFormat);
}

Prevention

When it happens

Trigger: Calling pipeline.configure(new AudioFormat(...)) with a NOT_SET format, or feeding a format (encoding, channel count, sample rate combination) that at least one active AudioProcessor in the pipeline cannot process, e.g. 5.1-channel PCM into a processor limited to stereo, or non-PCM input into an audio DSP chain.

Common situations: Using SilenceSkippingAudioProcessor/ChannelMixingAudioProcessor/SonicAudioProcessor which only accept ENCODING_PCM_16BIT; playing exotic devices or files that output 24-bit/float PCM; reconfiguring the pipeline after a mid-stream format change without draining/resetting processors; calling configure before the upstream format is known (NOT_SET).

Related errors


AI-assisted analysis of google/ExoPlayer@dd430f7053 (2026-08-14). Data as JSON: /api/errors/bd8d81db4911f529. Report an issue: GitHub.