SpeakTrue

Unified Speech Library Plan

Status

Proposed implementation plan to make reusable speech discoverable across categories and generation workflows without breaking the existing Soundboard.

Product Thesis

Soundboard is already SpeakTrue’s durable audio store, but its primary navigation model is “remember the folder.” A Unified Speech Library should add global retrieval—recent, search, favorites, tags, and source filters—while keeping categories, ordering, offline behavior, and existing save contracts intact.

User Outcome

A signed-in user can search all of their clips, filter to favorites or a generation source, play a result, see where it lives, and reuse it without first navigating to its category.

Current-State Evidence

Scope

MVP

Later

Non-Goals

UX Contract

Add Library as a retrieval view, not a second storage system.

Data Model

soundboard_clips additions

Do not put favorite state in metadata; metadata remains immutable generation provenance.

soundboard_tags

Field Type Notes
id uuid Primary key
user_id uuid Owner
name text Display name, bounded and trimmed
normalized_name text Unique per owner, case-insensitive
color_token text nullable Controlled design token, not raw CSS
timestamps timestamptz UTC

soundboard_clip_tags

Search strategy

Start with indexed owner/category/favorite/source filters and bounded case-insensitive matching over file_name and transcript. Measure scale and query plans before adding generated full-text vectors. Do not add semantic search until content-processing privacy, cost, and relevance are separately approved.

API Contract

Add soundboard-library-query as the normalized cross-platform read boundary.

Request:

{
  "query": "appointment",
  "favorite_only": false,
  "category_ids": [],
  "tag_ids": [],
  "sources": ["tts", "sts-live-interpreter"],
  "offline_only": false,
  "cursor": null,
  "limit": 30
}

Response:

{
  "items": [
    {
      "id": "uuid",
      "category": { "id": "uuid", "name": "Saved TTS" },
      "file_name": "Appointment reminder.mp3",
      "storage_path": "users/.../soundboard/...",
      "transcript": "Appointment reminder",
      "metadata": { "source": "tts" },
      "duration_ms": 1800,
      "is_offline_available": true,
      "is_favorite": true,
      "tags": [],
      "created_at": "2026-07-14T00:00:00Z"
    }
  ],
  "next_cursor": null
}

The query response does not include a signed audio URL by default. Add soundboard-library-resolve or reuse an owner-scoped existing resolver to return a short-lived URL for one selected item.

Mutations:

All mutations are idempotent and return the resulting resource state. Direct-table compatibility may remain temporarily, but new clients should converge on the normalized contract.

File Ownership Map

Backend

Web

iOS

Android

Vertical Slices

Verification

Acceptance Gate

Rollback

Disable speech_library_enabled and return clients to category-first Soundboard views. Keep additive columns/tables and dual-compatible decoding in place. Query and mutation functions can remain deployed but unreachable while investigation occurs. Do not remove favorite/tag data during rollback.

Open Decisions

  1. Whether Library is a top-level destination or a default subview of Soundboard.
  2. Maximum tag count per user and per clip.
  3. Search normalization for punctuation, diacritics, and multilingual transcripts.
  4. Whether source labels are user-facing or only filters.
  5. Dataset size threshold that justifies Postgres full-text search.