Contents

bestAvailableAudioFormat(compatibleWith:)

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

Declaration

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.

See Also

Determining audio formats