earshot

Speech-to-Text Shiny App

Last updated: 2026-01-27

Shiny app for speech-to-text transcription using stt.api.

Installation

1remotes::install_github("cornball-ai/whisper")
2remotes::install_github("cornball-ai/stt.api")
3remotes::install_github("cornball-ai/earshot")

Usage

RStudio: Open the project and click “Run App” (uses app.R)

From R:

1library(earshot)
2run_app()

Opens at http://localhost:7802 by default.

Features

  • Record from microphone (requires browser - see note below)
  • Upload audio files (.wav, .mp3, .m4a, .ogg, .flac, .webm)
  • Model selection (tiny, base, small, medium, large, or whisper-1 for OpenAI)
  • Optional language hint for improved accuracy
  • Optional prompt for names, acronyms, or domain-specific terms
  • View transcription text, segments with timestamps, or raw API response

Microphone Recording

To use microphone recording, you must open the app in a web browser (not RStudio’s viewer pane). Click “Open in Browser” in the Shiny viewer tab, or navigate directly to the URL (e.g., http://localhost:7802).

Microphone access requires:

  • A secure context (HTTPS or localhost)
  • Browser permission to access the microphone

Backends

earshot uses stt.api which supports multiple transcription backends. In auto mode, backends are tried in this order:

  1. whisper (native R torch) - Fastest, runs locally, no API key needed
  2. api (OpenAI or compatible) - Requires API endpoint and key
  3. audio.whisper - Fallback using the audio.whisper package

Install the whisper package for local transcription with no API dependencies:

1remotes::install_github("cornball-ai/whisper")

Models are downloaded automatically on first use.

OpenAI API

To use OpenAI’s API, set your API key in ~/.Renviron:

1OPENAI_API_KEY=sk-...

Then configure stt.api:

1stt.api::set_stt_base("https://api.openai.com")
2stt.api::set_stt_key(Sys.getenv("OPENAI_API_KEY"))

Local whisper server

For a local OpenAI-compatible server (e.g., whisper container):

1stt.api::set_stt_base("http://localhost:8200")

audio.whisper

Install from the bnosac drat repository or GitHub:

1# From drat
2install.packages("audio.whisper", repos = "https://bnosac.github.io/drat")
3
4# From GitHub
5remotes::install_github("bnosac/audio.whisper")

License

MIT

Functions