<!--
{
  "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:considering:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Speech"
    ],
    "preciseIdentifier" : "s:6Speech0A8AnalyzerC24bestAvailableAudioFormat14compatibleWith11consideringSo07AVAudioF0CSgSayAA0A6Module_pG_AItYaFZ"
  },
  "title" : "bestAvailableAudioFormat(compatibleWith:considering:)"
}
-->

# bestAvailableAudioFormat(compatibleWith:considering:)

Retrieves the best-quality audio format that the specified modules can work with, taking into account the natural format of the audio and assets installed on the device.

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

## Parameters

`modules`

A list of modules that will be analyzing the audio.

`naturalFormat`

An audio format that you prefer to work with, or `nil` if you have no preference.

## 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)