---
title: "bestAvailableAudioFormat(compatibleWith:)"
framework: speech
role: symbol
role_heading: Type Method
path: "speech/speechanalyzer/bestavailableaudioformat(compatiblewith:)"
---

# bestAvailableAudioFormat(compatibleWith:)

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

## Declaration

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

## Parameters

- `modules`: A list of modules that will be analyzing the audio.

## Return Value

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

## Discussion

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.

## See Also

### Determining audio formats

- [bestAvailableAudioFormat(compatibleWith:considering:)](speech/speechanalyzer/bestavailableaudioformat(compatiblewith:considering:).md)
