Speech-To-Text Output Generation Events (GLMASR/STTOutput.swift)

mlx-audio-swift · Sources/MLXAudioSTT/Models/GLMASR/STTOutput.swift · swift · MIT
voice, ai, realtime, lang:swift

Swift data structures and enums handling streaming speech-to-text generation events, tokens, and metrics.

// Source: https://github.com/aight-cool/mlx-audio-swift | License: MIT | Copyright 2025 Prince Canuma
// Provided via justclaw.it.com; keep this notice with the code.
//
//  STTOutput.swift
//  MLXAudioSTT
//
// Created by Prince Canuma on 04/01/2026.
//

import Foundation

// MARK: - STT Generation Events

/// Events emitted during speech-to-text streaming generation.
public enum STTGeneration: Sendable {
    /// A generated text token during transcription
    case token(String)
    /// Generation statistics
    case info(STTGenerationInfo)
    /// Final transcription result
    case result(STTOutput)
}

/// Information about the STT generation process.
public struct STTGenerationInfo: Sendable {
    public let promptTokenCount: Int
    public let generationTokenCount: Int
    public let

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

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

Get a free API key