SpeechTilesAndamento Docs
Get started
SDK Reference · Method

loadAudioToTextMap (URL)

Loads an Audio Resource-to-Text Map from a Conversation resource.

Declaration

public func loadAudioToTextMap(from resource: String) -> STResult

Overview

Requires an initialized, idle runner. The resource is resolved through the Conversation resource-location resolver. If it cannot be resolved, the method returns .fileNotFound; parsing/loading errors are returned from the map loader.

Loading and prerequisites

Load the Audio Resource-to-Text Map from a resource resolvable through the configured local resource location. Initialize the runner and ensure the Conversation is idle before loading.

Parameters

  • resource — String Refer to the method-specific behavior and usage example for how this parameter is used.

Usage example

_ = conversation.loadAudioToTextMap(from: "AudioToTextMap.json")

Result handling

This loading method executes synchronously. .success indicates that the requested resource data was loaded successfully. Handle other STResult values as loading failures.

Resource location

Before loading a resource file, you may configure the default local directory with STConversationRunner.setResourceLocation using .conversation from STResourceCategory.

By default, the language-specific directory is en-US. The loader first searches that language-specific directory under the configured resource location. If the resource is not found there, it searches the parent resource directory as a fallback. You can select another language-specific directory using STConversationRunner.setLanguageFolder.

See Also