<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Speech",
  "identifier" : "/documentation/Speech/SpeechAnalyzer/bestAvailableAudioFormat(compatibleWith:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Speech"
    ],
    "preciseIdentifier" : "s:6Speech0A8AnalyzerC24bestAvailableAudioFormat14compatibleWithSo07AVAudioF0CSgSayAA0A6Module_pG_tYaFZ"
  },
  "title" : "bestAvailableAudioFormat(compatibleWith:)"
}
-->

# bestAvailableAudioFormat(compatibleWith:)

Retrieves the best-quality audio format that the specified modules can work with, from assets installed on the device.

```
static func bestAvailableAudioFormat(compatibleWith modules: [any SpeechModule]) async -> AVAudioFormat?
```

## Parameters

`modules`

A list of modules that will be analyzing the audio.

## Return Value

`nil` if the specified modules require you to install additional assets.

## Discussion

Use this method to set up an audio pipeline or pre-convert audio to a usable format. In order to keep `CMTime` values sample-accurate, the analyzer does not transparently upsample, downsample, or convert audio input.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)