TranscriptSegment

parley ยท voice, data-model, transcript, immutable

Immutable transcript segment with start time, end time, and text content.

import Foundation

/// One transcript segment, mirroring the desktop wire shape
/// (`TranscriptEvent` in `src-tauri/src/transcription/common.rs` and
/// `TranscriptSegment` in `src/lib/types.ts`).
///
/// Identity rules (the UI upserts by `id`):
/// - A committed run keeps re-emitting under the same `"{source}-{index}"` id
///   while it grows; the index advances only on endpoint/speaker change.
/// - The tentative tail always uses the stable `"{source}-tail"` id; an empty
///   `text` clears it.
public struct TranscriptSegment: Equatable, Sendable, Codable {
    public let id: String
    /// Capture source. On iOS this is always `"mix"` โ€” a phone has one mic and
    /// speaker identity comes from provider diarization, exactly like the
    /// desktop's single-session diarizing topology.

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

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

Get a free API key