SpeechAnalyzer error "asset not found after attempted download" for certain languages

I am trying to use the new SpeechAnalyzer framework in my Mac app, and am running into an issue for some languages.

When I call AssetInstallationRequest.downloadAndInstall() for some languages, it throws an error:

Error Domain=SFSpeechErrorDomain Code=1 "transcription.ar asset not found after attempted download."

The ".ar" appears to be the language code, which in this case was Arabic.

When I call AssetInventory.status(forModules:) before attempting the download, it is giving me a status of "downloading" (perhaps from an earlier attempt?). If this language was completely unsupported, I would expect it to return a status of "unsupported", so I'm not sure what's going on here.

For other languages (Polish, for example) SpeechTranscriber.supportedLocale(equivalentTo:) is returning nil, so that seems like a clearly unsupported language. But I can't tell if the languages I'm trying, like Arabic, are supported and something is going wrong, or if this error represents something I can work around.

Here's the relevant section of code. The error is thrown from downloadAndInstall(), so I never even get as far as setting up the SpeechAnalyzer itself.

    private func setUpAnalyzer() async throws {
        guard let sourceLanguage else {
            throw Error.languageNotSpecified
        }
        
        guard let locale = await SpeechTranscriber.supportedLocale(equivalentTo: Locale(identifier: sourceLanguage.rawValue)) else {
            throw Error.unsupportedLanguage
        }
        let transcriber = SpeechTranscriber(locale: locale, preset: .progressiveTranscription)
        self.transcriber = transcriber
        
        let reservedLocales = await AssetInventory.reservedLocales
        if !reservedLocales.contains(locale) && reservedLocales.count == AssetInventory.maximumReservedLocales {
            if let oldest = reservedLocales.last {
                await AssetInventory.release(reservedLocale: oldest)
            }

        }
        do {
            let status = await AssetInventory.status(forModules: [transcriber])
            print("status: \(status)")
            
            if let installationRequest = try await AssetInventory.assetInstallationRequest(supporting: [transcriber]) {
                try await installationRequest.downloadAndInstall()
            }
        }
...

That error indicates that the initial download attempt didn't succeed for some reason. But the system will keep trying later.

The downloading status doesn't necessarily mean that the assets are actively getting downloaded, but it does mean that they're on the system's "to-do" list.

You can try another downloadAndInstall() call with this or another instance of AssetInstallationRequest at any time; that isn't an error and won't result in duplicated downloads.

I'm having the same problem. I understand from a technical standpoint that it functions as planned. However, in reality, the Arabic language is listed as a supported language, but the model is not downloadable. I hope this will be an easy fix in the next Beta; otherwise, I will need to exclude Arabic language from implementation.

Please file a radar for this issue.

SpeechAnalyzer error "asset not found after attempted download" for certain languages
 
 
Q