Package-level declarations

Types

Link copied to clipboard

Represents a voice used by the Android Text-to-Speech (TTS) engine.

Link copied to clipboard

Construct that defines the text to be played using the voice injected.

Link copied to clipboard
interface AudioMixer

AudioMixer manages audio clips in prioritized tracks, ensuring that clips are played in the order of insertion while allowing higher-priority clips to interrupt lower-priority clips.

Link copied to clipboard

Interface representing a repository for managing languages and voices.

Link copied to clipboard
class LanguageRepositoryImpl(val initialVoice: Voice = DefaultVoice, val initialLanguage: Locale = Locale.getDefault()) : LanguageRepository

Implementation of LanguageRepository, providing state management for languages and voices.

Link copied to clipboard
interface LocalTtsPlayer

Interface for a local Text-to-Speech (TTS) player.

Link copied to clipboard

Represents a notification alert that plays a sound when triggered.

Link copied to clipboard
data class PersonaVoice(val personaVoiceId: String, val personaName: String) : Voice

Describes the voice to be used with the default Player instance.

Link copied to clipboard
class PlatformAudioPlayerFactory(context: Context, languageRepository: LanguageRepository, sharedReachability: SharedReachability, voicePlayerOptionsProvider: VoicePlayerOptionsProvider, playerOptions: PlayerOptions = PlayerOptions.Builder().build(), ttsEngine: String? = null)

Factory for instantiating the services required for the playing voice announcements.

Link copied to clipboard
interface Player

An API that allows you to interact with the speech player.

Link copied to clipboard
interface PlayerCallback

The PlayerCallback interface defines the callbacks that are triggered during the playback of an announcement by a VoicePlayer.

Link copied to clipboard

PlayerOptions.

Link copied to clipboard
sealed class PlayerState

Exposes current state of the Player.

Link copied to clipboard

Defines a remote Text-to-Speech (TTS) API client.

Link copied to clipboard
interface RemoteTtsPlayer

Interface representing a remote text-to-speech (TTS) player.

Link copied to clipboard
class RemoteTtsPlayerSwitcher : CoroutineMiddleware<MiddlewareContext> , RemoteTtsPlayer

Manages switching between different remote TTS players dynamically.

Link copied to clipboard
sealed class Sound

Represents different types of sounds that can be played.

Link copied to clipboard
interface SoundPlayer

Interface representing a sound player for handling various sound effects.

Link copied to clipboard

Manages the lifecycle of speech files for Text-To-Speech operations, including their creation, caching, and deletion. Links announcements with speech file progress, allowing observation of file creation status through Announcement.mediaCacheId and SpeechFileProgress.mediaCacheId matching.

Link copied to clipboard

Interface for playing speech files.

Link copied to clipboard
data class SpeechFileProgress(val mediaCacheId: String, val text: String, val filePath: String, val bytesRead: Long, val isDone: Boolean)

Tracks creation progress and state of speech files. It facilitates cache management by enabling the eviction of obsolete files and the cleanup of files interrupted during creation. This mechanism ensures efficient cache use and aids in maintaining a clean file storage by removing incomplete or unused speech files upon the next app start.

Link copied to clipboard

Manages performance measurements related to speech playback.

Link copied to clipboard

Simple VoicePlayerOptionsProvider implementation with one stable option

Link copied to clipboard
class TtsApiException(message: String, cause: Throwable? = null) : RuntimeException

Represents an exception that occurs in the TTS API.

Link copied to clipboard
interface Voice

Describes the voice to be used with player.

Link copied to clipboard
sealed class VoiceAnnouncement

Represents a voice announcement, which can be either local or remote.

Link copied to clipboard
interface VoicePlayer

The VoicePlayer interface defines the contract for a voice playback system. Implementations may use Text-to-Speech (TTS) engines to play back announcements.

Link copied to clipboard
class VoicePlayerMiddlewareContext(val context: Context, val language: StateFlow<Locale>, val voice: StateFlow<Voice?>, val audioFocusManager: AudioFocusManager, val soundPlayer: SoundPlayer) : MiddlewareContext

Provides context needed for the middleware to operate.

Link copied to clipboard
data class VoicePlayerOptions(val apiHost: String, val accessToken: String, val voices: Set<PersonaVoice>)

Options used to initialize the default VoicePlayer instance.

Link copied to clipboard

Options provider used to initialize a VoicePlayer instance.

Link copied to clipboard
interface VoiceProgress

Represents the progress of a voice announcement.

Properties

Link copied to clipboard

The identifier for the core TTS provider.

Functions

Link copied to clipboard

Starts measuring the TTS download time for this Announcement.