One Logo Pool Ball
Speech · IOS API REFERENCE

AssetInventory

class · iOS 26.0+ · SDK 27.1

final class AssetInventory

Manages the assets that are necessary for transcription or other analyses. Before using the ``SpeechAnalyzer`` class, you must install assets required by the modules you plan to use. These assets are machine-learning models downloaded from Apple's servers and managed by the system. Once you download, install, or use an asset, the system retains and updates it automatically, and shares it with other apps. The system makes a certain number of locale-specific asset reservations available to your app to limit storage space and network usage. Your app does not work with assets directly. Instead, your app configures module objects. The system uses the modules' configuration to determine what assets are relevant. ### Install assets Installing an asset is a four-step process: 1. Create analyzer modules in the configurations that you wish to use. These modules can be discarded when no longer needed; the system installs assets using the modules' configuration, not their object identity. 2. Assign your app's asset reservations to those locales. The class does this automatically if needed, but you can also call ``reserve(locale:)`` to do this manually. This step is only necessary for modules with locale-specific assets; that is, modules conforming to ``LocaleDependentSpeechModule``. You can skip this step for other modules. 3. Start downloading the required assets for the modules' configuration. Call ``assetInstallationRequest(supporting:)`` to obtain an instance of ``AssetInstallationRequest`` and call its ``AssetInstallationRequest/downloadAndInstall()`` method. 4. Wait for the download to finish. Note that the download may finish immediately; the assets may have already been downloaded if the assets were preinstalled on the system, another app already downloaded them, or a previous module configuration used the same assets. Once assets are downloaded, they persist between app launches and are shared between apps. The system may unsubscribe your app from assets that haven’t been used in a while. ### Manage assets When your app no longer needs assets for a particular locale, call ``release(reservedLocale:)`` to free up that reservation. The system will remove the assets at a later time.

Members (6)

get · iOS 26.0+

reservedLocales

TypeScript
static get reservedLocales(): Promise<Array<_Foundation_Locale>>
Swift declaration
static var reservedLocales: [Locale] { get async }

The app's current asset locale reservations. Before you can subscribe to assets supporting a module, you must reserve those assets' locales. Please note, the locales returned by this method may be variants of the locales provided to ``AssetInventory/reserve(locale:)``.

get · iOS 26.0+

maximumReservedLocales

TypeScript
static get maximumReservedLocales(): number
Swift declaration
static var maximumReservedLocales: Int { get }

The number of locale reservations permitted to an app. This value is the largest allowed count of ``reservedLocales``. The value may vary between devices according to storage space.

static · iOS 26.0+

assetInstallationRequest

TypeScript
static assetInstallationRequest(modules: Array<SDKHandle>): Promise<(AssetInstallationRequest) | null>
Swift declaration
static func assetInstallationRequest(supporting modules: [any SpeechModule]) async throws -> AssetInstallationRequest?

Returns an installation request object, which is used to initiate the asset download and monitor its progress. If the current status is `.installed`, returns nil, indicating that nothing further needs to be done. If some of the assets require locales that aren't reserved, it automatically reserves those locales. If that would exceed ``maximumReservedLocales``, then it throws an error. - Throws: An error if the assets are not supported or no reservations are available.

static · iOS 26.0+

status

TypeScript
static status(modules: Array<SDKHandle>): Promise<AssetInventory_Status>
Swift declaration
static func status(forModules modules: [any SpeechModule]) async -> AssetInventory.Status

Returns the status for the list of modules. If the status differs between modules, it returns an applicable status in order from `unsupported`, `downloading`, `supported`, `installed`.

static · iOS 26.0+

release

TypeScript
static release(reservedLocale: _Foundation_Locale): Promise<boolean>
Swift declaration
@discardableResult static func release(reservedLocale: Locale) async -> Bool

Removes an asset locale reservation. Unsubscribes from any assets that depended on the locale. - Returns: `false` if the locale was not reserved.

static · iOS 26.0+

reserve

TypeScript
static reserve(locale: _Foundation_Locale): Promise<boolean>
Swift declaration
@discardableResult static func reserve(locale: Locale) async throws -> Bool

Add an asset locale to the app's current reservations. If an asset that supports the input locale exists, adds that asset's locale to ``reservedLocales``. - Throws: An error if the number of locales would exceed ``maximumReservedLocales`` or if there is no asset that can support the locale. - Returns: `false` if the locale was already reserved.

Skipped declarations

No declarations were skipped in this snapshot.

All Speech types →