Communitygithub.com

ComeOnOliver/skillshub

Transcreva áudio com o Whisper da OpenAI — o modelo de reconhecimento de fala de última geração. Este skill cobre Whisper local (Python), faster-whisper (CTranslate2, 4x mais rápido), whisper.cpp (C++ otimizado para CPU) e a API OpenAI Whisper. Inclui geração de legendas (SRT/VTT/JSON), transcrição multilíngue, tradução para inglês, diarização de falantes, marcações temporais em nível de palavra e padrões de pipeline de produção para podcasts, reuniões e legendas de vídeo.

O que é skillshub?

This skill, **ComeOnOliver/skillshub**, is a comprehensive guide for transcribing audio using OpenAI's Whisper model in various environments. It covers four distinct runtimes: the original Python implementation, the faster-whisper (CTranslate2) variant which is 4x faster, the CPU-optimized whisper.cpp, and the OpenAI Whisper API for cloud-based processing. The skill provides step-by-step instructions for basic transcription, subtitle generation in SRT/VTT formats, language detection and translation to English, speaker diarization using pyannote-audio, and batch processing pipelines for podcasts, meetings, and video subtitles. It is particularly useful for developers and AI agent users who need to transform audio into structured text or subtitles, supporting tasks from quick drafts to production-quality outputs. The detailed code examples and model selection guide help users optimize performance based on available hardware—from lightweight CPU models like 'tiny' and 'base' to large GPU-accelerated models like 'large-v3'.

Funciona com~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/TerminalSkills/skills/whisper

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

Whisper

Visão Geral

Transcreva áudio com o Whisper da OpenAI — o modelo de reconhecimento de fala de última geração. Este skill cobre Whisper local (Python), faster-whisper (CTranslate2, 4x mais rápido), whisper.cpp (C++ otimizado para CPU) e a API OpenAI Whisper. Inclui geração de legendas (SRT/VTT/JSON), transcrição multilíngue, tradução para inglês, diarização de falantes, marcações temporais em nível de palavra e padrões de pipeline de produção para podcasts, reuniões e legendas de vídeo.

Instruções

Passo 1: Escolha seu Ambiente de Execução

Opção A — OpenAI Whisper (Python original):

pip install openai-whisper
# Modelos: tiny (39M), base (74M), small (244M), medium (769M), large-v3 (1,5G)

Opção B — faster-whisper (recomendado para local, 4x mais rápido):

pip install faster-whisper
# Utiliza CTranslate2 — quantização INT8, funciona bem em CPU

Opção C — whisper.cpp (melhor para CPU, dependências mínimas):

git clone https://github.com/ggerganov/whisper.cpp
cd whisper.cpp && make
# Baixar modelo
bash models/download-ggml-model.sh base.en

Opção D — API OpenAI (sem necessidade de GPU local):

pip install openai
export OPENAI_API_KEY="sk-..."

Passo 2: Transcrição Básica

faster-whisper (recomendado):

from faster_whisper import WhisperModel

model = WhisperModel("base", device="cpu", compute_type="int8")
# GPU: model = WhisperModel("large-v3", device="cuda", compute_type="float16")

segments, info = model.transcribe("episode.mp3", beam_size=5)
print(f"Idioma: {info.language} (probabilidade: {info.language_probability:.2f})")

for segment in segments:
    print(f"[{segment.start:.2f}s → {segment.end:.2f}s] {segment.text}")

OpenAI Whisper (original):

import whisper

model = whisper.load_model("base")  # tiny, base, small, medium, large-v3
result = model.transcribe("episode.mp3")

print(result["text"])
for segment in result["segments"]:
    print(f"[{segment['start']:.1f}s - {segment['end']:.1f}s] {segment['text']}")

whisper.cpp (CLI):

./main -m models/ggml-base.en.bin -f episode.wav -otxt -osrt -ovtt
# Saídas: episode.txt, episode.srt, episode.vtt

API OpenAI:

from openai import OpenAI
client = OpenAI()

with open("episode.mp3", "rb") as f:
    transcript = client.audio.transcriptions.create(
        model="whisper-1",
        file=f,
        response_format="verbose_json",
        timestamp_granularities=["segment", "word"],
    )

print(transcript.text)
for segment in transcript.segments:
    print(f"[{segment.start:.1f}s] {segment.text}")

Passo 3: Geração de Legendas (SRT/VTT)

Gerar SRT com faster-whisper:

from faster_whisper import WhisperModel

model = WhisperModel("small", device="cpu", compute_type="int8")
segments, info = model.transcribe("episode.mp3", beam_size=5)

def format_timestamp(seconds):
    h = int(seconds // 3600)
    m = int((seconds % 3600) // 60)
    s = int(seconds % 60)
    ms = int((seconds % 1) * 1000)
    return f"{h:02d}:{m:02d}:{s:02d},{ms:03d}"

with open("episode.srt", "w") as f:
    for i, seg in enumerate(segments, 1):
        f.write(f"{i}\n")
        f.write(f"{format_timestamp(seg.start)} --> {format_timestamp(seg.end)}\n")
        f.write(f"{seg.text.strip()}\n\n")

print("episode.srt gerado")

Gerar VTT (para vídeo HTML5):

with open("episode.vtt", "w") as f:
    f.write("WEBVTT\n\n")
    for i, seg in enumerate(segments, 1):
        start = format_timestamp(seg.start).replace(",", ".")
        end = format_timestamp(seg.end).replace(",", ".")
        f.write(f"{start} --> {end}\n")
        f.write(f"{seg.text.strip()}\n\n")

Marcações temporais em nível de palavra (para legendas estilo karaokê):

segments, info = model.transcribe("episode.mp3", word_timestamps=True)
for segment in segments:
    for word in segment.words:
        print(f"  [{word.start:.2f}s → {word.end:.2f}s] {word.word}")

Passo 4: Detecção de Idioma e Tradução

# Detecção automática de idioma
segments, info = model.transcribe("foreign_audio.mp3")
print(f"Detectado: {info.language} ({info.language_probability:.0%})")

# Forçar um idioma específico
segments, info = model.transcribe("german.mp3", language="de")

# Traduzir para inglês (qualquer idioma → inglês)
segments, info = model.transcribe("german.mp3", task="translate")
for seg in segments:
    print(seg.text)  # Tradução para inglês

Idiomas suportados: 99 idiomas, incluindo en, zh, de, es, ru, ko, fr, ja, pt, tr, pl, nl, ar, sv, it, hi, e muitos outros.

Passo 5: Diarização de Falantes

Combine Whisper com pyannote-audio para "quem disse o quê":

from faster_whisper import WhisperModel
from pyannote.audio import Pipeline
import torch

# Transcrição
model = WhisperModel("small", device="cpu", compute_type="int8")
segments, info = model.transcribe("meeting.wav", beam_size=5)
whisper_segments = list(segments)

# Diarização (requer token HuggingFace com acesso ao pyannote)
diarization = Pipeline.from_pretrained(
    "pyannote/speaker-diarization-3.1",
    use_auth_token="hf_YOUR_TOKEN"
)
diarization_result = diarization("meeting.wav")

# Mesclar: atribuir falante a cada segmento do Whisper
def get_speaker(start, end, diarization_result):
    """Encontra o falante dominante em um intervalo de tempo."""
    speakers = {}
    for turn, _, speaker in diarization_result.itertracks(yield_label=True):
        overlap_start = max(start, turn.start)
        overlap_end = min(end, turn.end)
        if overlap_start < overlap_end:
            duration = overlap_end - overlap_start
            speakers[speaker] = speakers.get(speaker, 0) + duration
    return max(speakers, key=speakers.get) if speakers else "Desconhecido"

for seg in whisper_segments:
    speaker = get_speaker(seg.start, seg.end, diarization_result)
    print(f"[{speaker}] [{seg.start:.1f}s → {seg.end:.1f}s] {seg.text}")

Passo 6: Processamento em Lote e Pipelines

Transcrever todos os episódios em um diretório:

import os
from pathlib import Path
from faster_whisper import WhisperModel

model = WhisperModel("small", device="cpu", compute_type="int8")
episodes_dir = Path("episodes")
output_dir = Path("transcripts")
output_dir.mkdir(exist_ok=True)

for audio_file in sorted(episodes_dir.glob("*.mp3")):
    print(f"Transcrevendo: {audio_file.name}")
    segments, info = model.transcribe(str(audio_file), beam_size=5)
    
    # Texto simples
    txt_path = output_dir / f"{audio_file.stem}.txt"
    with open(txt_path, "w") as f:
        for seg in segments:
            f.write(seg.text.strip() + "\n")
    
    # SRT
    srt_path = output_dir / f"{audio_file.stem}.srt"
    segments2, _ = model.transcribe(str(audio_file), beam_size=5)  # Reiterar
    with open(srt_path, "w") as f:
        for i, seg in enumerate(segments2, 1):
            h, m = divmod(int(seg.start), 3600)
            m, s = divmod(m, 60)
            ms = int((seg.start % 1) * 1000)
            start_ts = f"{h:02d}:{m:02d}:{s:02d},{ms:03d}"
            h2, m2 = divmod(int(seg.end), 3600)
            m2, s2 = divmod(m2, 60)
            ms2 = int((seg.end % 1) * 1000)
            end_ts = f"{h2:02d}:{m2:02d}:{s2:02d},{ms2:03d}"
            f.write(f"{i}\n{start_ts} --> {end_ts}\n{seg.text.strip()}\n\n")
    
    print(f"  → {txt_path}, {srt_path}")

Passo 7: Guia de Seleção de Modelo

ModeloTamanhoVRAMVelocidade (CPU)PrecisãoMelhor para
tiny39M~1GBMuito rápidoBaixaRascunhos rápidos, tempo real
base74M~1GBRápidoMédiaBom equilíbrio para CPU
small244M~2GBModeradoBoaPodcasts, áudio claro
medium769M~5GBLentoMuito boaÁudio ruidoso, sotaques
large-v31,5G~10GBMuito lentoExcelenteQualidade de produção

Recomendações:

  • Somente CPU, velocidade importa: tiny ou base com faster-whisper
  • Somente CPU, precisão importa: small com faster-whisper
  • GPU disponível: large-v3 com faster-whisper (float16)
  • Sem computação local: API OpenAI (whisper-1)

Exemplos

Exemplo 1: Transcrever uma temporada de podcast e gerar legendas SRT

Solicitação do usuário: "Transcreva todos os 20 episódios MP3 em ./episodes/ e gere transcrições em texto simples e arquivos de legenda SRT. Tenho uma GPU com 10 GB de VRAM."

O agente irá:

  1. Instalar faster-whisper via pip install faster-whisper.
  2. Carregar o modelo large-v3 com device="cuda" e compute_type="float16" para aproveitar a GPU.
  3. Criar um diretório de saída ./transcripts/.
  4. Iterar sobre todos os arquivos .mp3 em ./episodes/, transcrevendo cada um com beam_size=5.
  5. Escrever um arquivo .txt (texto simples) e um arquivo .srt (com timestamps formatados corretamente) para cada episódio.
  6. Relatar o idioma detectado e o tempo total de processamento por episódio.

Exemplo 2: Traduzir uma entrevista em alemão para inglês com rótulos de falantes

Solicitação do usuário: "Tenho uma gravação de entrevista de 45 minutos em alemão em meeting.wav com dois falantes. Transcreva-a em inglês e rotule quem disse o quê."

O agente irá:

  1. Instalar faster-whisper e pyannote-audio (pip install faster-whisper pyannote.audio).
  2. Transcrever meeting.wav com task="translate" para obter texto em inglês a partir do áudio em alemão.
  3. Executar a diarização de falantes pyannote para identificar segmentos de falantes (requer um token do HuggingFace com acesso ao modelo pyannote).
  4. Mesclar segmentos do Whisper com resultados da diarização correspondendo aos intervalos de tempo para atribuir rótulos de falantes.
  5. Produzir uma transcrição formatada com rótulos [Falante 1] e [Falante 2] antes de cada segmento.

Diretrizes

  • Use faster-whisper em vez do OpenAI Whisper original para transcrição local; é 4x mais rápido e usa menos memória através da quantização INT8 com CTranslate2.
  • Selecione o tamanho do modelo com base no seu hardware: tiny/base para velocidade em CPU, small para precisão em CPU, large-v3 para qualidade de produção em GPU.
  • Sempre converta o áudio para WAV ou certifique-se de que o ffmpeg esteja instalado ao trabalhar com entradas MP3/M4A; o Whisper depende do ffmpeg para decodificar formatos que não sejam WAV.
  • Para diarização de falantes, o pipeline pyannote requer um token de acesso ao HuggingFace com os termos do modelo aceitos; configure isso antes de tentar a transcrição com vários falantes.
  • Ao gerar arquivos SRT, use beam_size=5 para limites de segmento mais precisos; a decodificação gulosa padrão pode produzir quebras de legenda mal cronometradas.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

Habilidades Relacionadas