gitwtfhub

wtf is cohere-transcribe-ruby?

aliosm/cohere-transcribe-ruby — explained in plain English

Analysis updated 2026-05-18

2RubyAudience · developerComplexity · 4/5Setup · hard

TL;DR

A Ruby gem that transcribes Arabic and English audio into text using Cohere's speech recognition model, running entirely in Ruby with no Python or separate server needed.

Mindmap

mindmap
  root((repo))
    What it does
      Transcribes audio to text
      Arabic and English support
      Generates subtitles
    How it works
      Native C and C++ extensions
      No Python required
      Runs inside Ruby
    Tech stack
      Ruby
      C++20
      CMake
      FFmpeg
    Use cases
      Batch transcribe audio files
      Create subtitle files
      Process folders of recordings
    Setup
      Linux or macOS only
      Needs C++ compiler
      Doctor command checks setup

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Transcribe Arabic or English audio recordings into text files.

REASON 2

Generate SRT, VTT, TXT, or JSON subtitle files from audio or video.

REASON 3

Batch process a folder of audio files with automatic error handling.

REASON 4

Fine-tune transcription with custom Hugging Face models for specific domains.

What's in the stack?

RubyC++CMakeFFmpegCUDAMetal

How it stacks up

aliosm/cohere-transcribe-rubykelseyhightower/lobstersmastodon/webpush
Stars222
LanguageRubyRubyRuby
Last pushed2016-08-142025-01-13
MaintenanceDormantStale
Setup difficultyhardhardmoderate
Complexity4/54/52/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1h+

Requires 64-bit Ruby 4.x on Linux or macOS, a C++20 compiler, CMake, and FFmpeg shared libraries, CUDA or Metal toolchains needed for GPU acceleration.

Wtf does this do

This is a Ruby gem for transcribing Arabic and English audio into text using Cohere's speech recognition model. It runs entirely in Ruby with native C and C++ extensions, without requiring a Python runtime, a separate worker process, or a model server. The project mirrors the Python package's interface while keeping all inference inside Ruby. The core feature set covers the pinned Cohere Arabic and English model, compatible fine-tunes from Hugging Face, and local checkpoints. It includes audio decoding at 16 kHz, voice activity detection using Silero or an energy-based detector, fixed-window segmentation, batched inference, word-level alignment using a pinned MMS model, and subtitle generation. It also supports progress callbacks, reusable model sessions, and transactional file output so partial batches can be rolled back cleanly. Audio decoding works through a native adapter that binds FFmpeg's shared libraries directly, without launching the ffmpeg executable. Supported formats include AAC, FLAC, MP3, MP4, Ogg, Opus, WAV, WebM, and WMA. If the native adapter is missing, the gem can fall back to libsndfile and libsamplerate for a smaller set of formats. Decoding has monotonic deadlines, 30 seconds for duration probes and one hour for full decodes, and supports cooperative cancellation. Installation requires 64-bit Ruby 4.x on Linux or macOS. Windows is not currently supported. CPU builds are the default. CUDA builds need the NVIDIA toolkit, and Metal builds need Apple's Metal toolchain. The gem builds its native extension locally during installation, so you also need CMake and a C++20 compiler. A built-in doctor command checks the runtime and model access before you start. The Ruby API offers a simple one-shot method for single files and a persistent transcriber object for repeated calls. You can pass individual files, directories, or arrays, and the run returns successful, failed, and skipped results so one bad file does not abort a batch. Optional publication settings write TXT, SRT, VTT, and JSON files. The full README is longer than what was shown.

Yoink these prompts

Prompt 1
Using the cohere-transcribe-ruby gem, write a Ruby script that transcribes all MP3 files in a directory and outputs SRT subtitle files for each one.
Prompt 2
Write a Ruby script using the persistent Transcriber object from cohere-transcribe-ruby to process a list of audio files, printing progress callbacks for each file.
Prompt 3
Help me run the doctor command from cohere-transcribe-ruby and interpret the output to check if my Ruby version and native extensions are set up correctly.
Prompt 4
Write a Ruby script using cohere-transcribe-ruby to transcribe a single WAV file and save the result as both TXT and JSON, using a custom Hugging Face fine-tuned model checkpoint.

Frequently asked questions

wtf is cohere-transcribe-ruby?

A Ruby gem that transcribes Arabic and English audio into text using Cohere's speech recognition model, running entirely in Ruby with no Python or separate server needed.

What language is cohere-transcribe-ruby written in?

Mainly Ruby. The stack also includes Ruby, C++, CMake.

How hard is cohere-transcribe-ruby to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is cohere-transcribe-ruby for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.