Skip to content

Voice input and output support (STT/TTS layer) #526

Description

@haiphucnguyen

Summary

Add voice input and output to Askimo's chat interface. Voice is a convenience layer on top of the existing chat pipeline — the AI provider always receives and returns plain text, nothing changes in how messages are processed.

Voice Input: User speaks → Askimo records → STT API converts to text → text appears in input field → user sends as normal Voice Output: AI responds with text → user clicks 🔊 → TTS API converts to audio → Askimo plays it


Why

  • Hands-free interaction — dictate messages instead of typing
  • Listen to long AI responses without reading
  • Works with every provider (OpenAI, Claude, Gemini, Ollama, etc.) since it's just text under the hood

What Needs to Be Built

1. Core Voice Services

A SpeechToTextService and TextToSpeechService interface in shared/src/main/kotlin/io/askimo/core/voice/, with an initial OpenAI implementation (Whisper for STT, OpenAI TTS for TTS). Other providers can follow in future issues.

2. Voice Config

Add a VoiceConfig block to AppConfig (disabled by default — zero impact on existing users).

3. Voice Input Button in Chat

Add a 🎤 microphone button to the controls row in ChatInputField.kt, next to the existing attach button. States: idle → recording (red) → transcribing (spinner) → done. Transcribed text is inserted into the input field so the user can review and edit before sending.

4. Audio Recorder

Platform audio capture using standard JVM APIs (javax.sound.sampled) — no extra native dependencies needed.

5. Voice Playback on Messages

Add a 🔊 speaker button to message actions in MessageComponents.kt. Clicking it synthesises the message text and plays it. Only one message plays at a time.

6. Audio Player

Simple playback wrapper using javax.sound.sampled. Supports pause and stop.

7. Voice Settings

A new Voice section in Settings with toggles for enabling STT/TTS, model fields, voice selector, and speech speed slider.

8. Keyboard Shortcut

Cmd/Ctrl + Shift + M to toggle voice recording. Add to KeyMapManager and the shortcuts settings screen.

9. i18n Strings

All new UI text added to messages.properties so Crowdin picks them up for translation automatically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions