SpeechSynthesis/SpeechSynthesisCapability.swift

hermes-swift-ios · Hermes_IOS/HermesCapabilities/SpeechSynthesis/SpeechSynthesisCapability.swift · swift · MIT
voice

iOS text-to-speech capability for speaking text with customizable voice, rate, and pitch.

// Source: https://github.com/hermes-webui/hermes-swift-ios | License: MIT | Copyright 2026 hermes-webui contributors
// Provided via justclaw.it.com; keep this notice with the code.
import Foundation
import AVFoundation

/// Text-to-speech via `AVSpeechSynthesizer`. No permission required (TTS doesn't touch the mic).
///
/// Methods:
///   - `speak`  — params: `{ text: String, language?: "en-US", rate?: Double (0..1), pitch?: Double (0.5..2.0) }`
///   - `stop`   — interrupts any current utterance
///   - `voices` — returns the list of available voice identifiers + languages
public final class SpeechSynthesisCapability: Capability, @unchecked Sendable {
    public let name = "speech"

    private let synthesizer = AVSpeechSynthesizer()

    public init() {}

    public func permissionStat

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key