SpeechTilesAndamento Docs
Get started
SDK Reference · Type

STAudioSource

Identifies the content source for an STAudioSegment.

Declaration

public enum STAudioSource: Sendable {
    case audioResource(URL)
    case text(String)
    case textResource(URL)
}

Overview

This identifies the kind of content supplied to an audio segment for playback. The selected source determines which other segment fields are relevant and how the runtime obtains playable media.

Cases

audioResource(_:)

Plays recorded audio from the supplied file URL.

Use this case when the content already exists as an audio resource rather than requiring speech synthesis.

text(_:)

Synthesizes and plays the supplied text.

The text may be plain text or SSML according to the isSSML and autoDetectSSML settings on the containing STAudioSegment.

textResource(_:)

Loads text from the supplied resource URL and synthesizes the loaded content.

Cases

  • .audioResource — Audio resource option.
  • .text — Text option.
  • .textResource — Text resource option.

Swift example

let selection: STAudioSource = .audioResource

File URL limitations

Although a source may accept a URL, audio-file playback currently requires a file accessible to Andamento, such as a local file or an accessible file:// URL. Direct remote network playback and streaming are not supported.

See Also