Communitygithub.com

majiayu000/claude-skill-registry-data

OpenAI Audio API による音声認識・翻訳 — モデル選択、レスポンス形式、タイムスタンプ、プロンプティング、ストリーミング、チャンク分割、話者識別

claude-skill-registry-data とは?

このスキルは、OpenAI Whisper モデル(whisper-1、gpt-4o-transcribe、gpt-4o-mini-transcribe、gpt-4o-transcribe-diarize)を利用した高精度な音声認識・翻訳を提供します。`gpt-4o-transcribe` は最高精度を、`gpt-4o-mini-transcribe` はコスト効率を、`whisper-1` はタイムスタンプ・字幕出力を、`gpt-4o-transcribe-diarize` は話者識別をそれぞれ得意とします。25MB を超える音声ファイルは自動的にチャンク分割が必要で、プロンプトによる語彙・スタイルの誘導や、ストリーミングによる段階的出力にも対応しています。Claude Code, Cursor, Codex など、OpenAI SDK が利用可能な開発環境で動作し、会議録音、インタビュー、ポッドキャスト、字幕生成、動画編集など幅広いユースケースに適用できます。

対応✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/majiayu000/claude-skill-registry-data/tree/HEAD/ai-llm/api-ai-openai-whisper

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

OpenAI Whisper パターン

クイックガイド: 音声認識には client.audio.transcriptions.create() を、非英語音声の英語テキスト化には client.audio.translations.create() を使用します。最高精度が必要なら gpt-4o-transcribe、コスト効率なら gpt-4o-mini-transcribe、タイムスタンプ/SRT/VTT が必要なら whisper-1、話者識別が必要なら gpt-4o-transcribe-diarize を選びます。ファイルは 25 MB 未満に制限 — 大きなファイルは分割してください。prompt で語彙やスタイルを誘導できます。gpt-4o-transcribe 系モデルでは stream: true によるストリーミング出力も可能です。


<critical_requirements>

重要: スキル使用前の注意点

すべてのコードは CLAUDE.md のプロジェクト規約に従うこと(kebab-case、名前付きエクスポート、import 順序、import type、名前付き定数)

(ユースケースに適したモデルを必ず選択すること — gpt-4o-transcribe は精度、whisper-1 はタイムスタンプ/SRT/VTT 出力、gpt-4o-transcribe-diarize は話者ラベル向け)

(25 MB を超える音声ファイルは API に送信する前に必ずチャンク分割すること — API はこの制限を超えるファイルを拒否します)

(timestamp_granularities を使用する場合は response_format: "verbose_json" を必ず指定すること — whisper-1 でタイムスタンプを利用するにはこの形式が必要です)

(30 秒を超える音声で gpt-4o-transcribe-diarize を使用する場合は chunking_strategy: "auto" を必ず設定すること — API が要求します)

</critical_requirements>


自動検出キーワード: Whisper, whisper-1, gpt-4o-transcribe, gpt-4o-mini-transcribe, gpt-4o-transcribe-diarize, audio.transcriptions, audio.translations, transcription, speech-to-text, diarization, diarized_json, timestamp_granularities, verbose_json

使用タイミング:

  • 音声ファイル(会議、インタビュー、ポッドキャスト、ボイスノート)のテキスト化
  • 非英語音声の英語テキストへの翻訳
  • 音声からの SRT または VTT 形式の字幕生成
  • 動画編集のための単語単位・セグメント単位のタイムスタンプ取得
  • 複数話者音声における話者識別(話者ダイアライゼーション)
  • モデル処理中に段階的に転写結果をストリーミング

カバーする主なパターン:

  • モデル選択(whisper-1 vs gpt-4o-transcribe vs gpt-4o-mini-transcribe vs gpt-4o-transcribe-diarize)
  • レスポンス形式(json, text, srt, vtt, verbose_json, diarized_json)
  • タイムスタンプ(単語単位、セグメント単位)と字幕生成
  • 語彙、略語、スタイルのプロンプティング
  • 大きなファイル(> 25 MB)のコンテキストを保持した分割
  • stream: true によるストリーミング転写
  • audio.translations.create() による英語への翻訳
  • 話者参照を用いた話者ダイアライゼーション

使用すべきでないタイミング:

  • 音声合成(TTS) — OpenAI TTS API(client.audio.speech.create())を使用
  • リアルタイム双方向音声会話 — OpenAI Realtime API を使用
  • OpenAI 以外のプロバイダーによる音声認識 — プロバイダー非依存の音声 SDK を使用

サンプル一覧


哲学

OpenAI Audio API は、さまざまなニーズに最適化された複数のモデルを通じて 音声認識・翻訳 を提供します。API はシンプルで、音声ファイルを送信するとテキストが返ってきますが、適切なモデル、レスポンス形式、パラメータを選択することが高品質な結果に不可欠です。

基本原則:

  1. モデル選択が重要 — gpt-4o-transcribe は最も高い精度と低い幻覚率を実現。whisper-1 はタイムスタンプ付き SRT/VTT/verbose_json をサポートする唯一のモデル。gpt-4o-transcribe-diarize は話者識別を追加。
  2. ファイルサイズが主要な制約 — 25 MB 制限により、長い音声は分割が必要。文の境界で分割してコンテキストを保持。
  3. プロンプトで精度向上 — prompt パラメータは語彙、略語、書式スタイルを誘導。指示ではなく、モデルが照合するコンテキストを提供。
  4. レスポンス形式が利用可能な機能を決定 — タイムスタンプは whisper-1 で verbose_json が必要。話者ダイアライゼーションには diarized_json が必要。SRT/VTT は whisper-1 のみ。

Audio API を使用するタイミング:

  • 録音された音声ファイルの正確な転写が必要な場合
  • 音声から字幕(SRT/VTT)が必要な場合
  • 会話で誰が話しているかを識別する必要がある場合
  • 音声を英語テキストに翻訳する必要がある場合

使用すべきでないタイミング:

  • リアルタイム音声チャット — Realtime API を使用
  • 音声合成 — client.audio.speech.create() を使用
  • 英語以外の言語への翻訳が必要な場合(翻訳は英語のみ出力)

コアパターン

パターン 1: 基本転写

音声ファイルを送信し、テキストを受け取ります。モデルは言語を自動検出します。

const transcription = await client.audio.transcriptions.create({
  model: "gpt-4o-transcribe",
  file: createReadStream(audioPath),
});

最高精度が必要な場合は gpt-4o-transcribe を使用します。プレーンテキストのみ必要な場合に whisper-1 を verbose_json で使用しないでください — オーバーヘッドが増え、幻覚率が高くなります。完全なサンプルは core.md を参照。


パターン 2: モデル選択

各モデルには明確な機能とトレードオフがあります。

何が必要ですか?
+-- 最高精度、プレーンテキスト -> gpt-4o-transcribe
+-- コスト効率、プレーンテキスト -> gpt-4o-mini-transcribe
+-- タイムスタンプ(単語/セグメント) -> whisper-1(verbose_json)
+-- SRT または VTT 字幕 -> whisper-1(srt/vtt 形式)
+-- 話者識別 -> gpt-4o-transcribe-diarize
+-- ストリーミング出力 -> gpt-4o-transcribe または gpt-4o-mini-transcribe

モデル機能マトリックス

機能whisper-1gpt-4o-transcribegpt-4o-mini-transcribegpt-4o-transcribe-diarize
レスポンス形式json, text, srt, vtt, verbose_jsonjson, textjson, textjson, text, diarized_json
タイムスタンプ単語 + セグメントなしなしなし
ストリーミングなしありありなし
プロンプト対応あり(224 トークン)ありありなし
Logprobsなしありありなし
話者ラベルなしなしなしあり
言語パラメータありありありあり

パターン 3: 語彙とスタイルのプロンプティング

prompt パラメータは指示ではなくコンテキストを提供します。名前、略語、書式スタイルのスペルを誘導します。「注意深く転写してください」のような指示には使用しないでください — スタイルと語彙のコンテキストを照合します。

const VOCABULARY_PROMPT = "Kubernetes, kubectl, etcd, NGINX, gRPC, PostgreSQL";

const transcription = await client.audio.transcriptions.create({
  model: "gpt-4o-transcribe",
  file: createReadStream(audioPath),
  prompt: VOCABULARY_PROMPT,
});

使用例: 略語/固有名詞、チャンク間のコンテキスト保持(前のチャンクの末尾を渡す)、フィラーワードの維持、文章スタイルのガイダンス。詳細な語彙サンプルは core.md を参照。


パターン 4: 大きなファイルのチャンク分割

25 MB を超える音声ファイルは転写前に分割する必要があります。コンテキストを保持するために、文の境界(例:ffmpeg を使用)で分割します。連続性を保つため、前の転写の末尾を prompt として渡します。

const MAX_FILE_SIZE_BYTES = 25 * 1024 * 1024; // 25 MB
// ffmpeg で分割: ffmpeg -i long.mp3 -f segment -segment_time 600 -c copy chunk_%03d.mp3
// その後、前のコンテキストを prompt で渡しながら順次転写

完全なチャンク分割実装(サイズ検証とコンテキスト保持を含む)は core.md を参照。


パターン 5: ストリーミング転写

モデルが音声を処理する際に、部分的な転写結果をストリーミングします。gpt-4o-transcribe と gpt-4o-mini-transcribe のみが stream: true をサポートします。段階的出力には transcript.text.delta イベント、完了時には transcript.text.done をリッスンします。whisper-1 で stream: true を使用しないでください — サポートされていません。

const stream = await client.audio.transcriptions.create({
  model: "gpt-4o-transcribe",
  file: createReadStream(audioPath),
  stream: true,
});
for await (const event of stream) {
  if (event.type === "transcript.text.delta") process.stdout.write(event.delta);
}

完全なストリーミングと logprob のサンプルは core.md を参照。


パターン 6: 英語への翻訳

非英語音声を英語テキストに翻訳します。audio.translations.create() 経由で whisper-1 のみがサポートされています。同じ言語での転写には audio.transcriptions.create() を使用してください。翻訳は英語のみを出力します — 他の言語への翻訳はできません。

const translation = await client.audio.translations.create({
  model: "whisper-1",
  file: createReadStream(audioPath),
});

語彙プロンプティングを含む完全な翻訳サンプルは core.md を参照。


パターン 7: 話者ダイアライゼーション

複数話者音声で誰が話しているかを識別します。gpt-4o-transcribe-diarize を response_format: "diarized_json" および chunking_strategy: "auto"(30 秒以上の音声に必須)とともに使用します。話者ダイアライゼーションは prompt、logprobs、timestamp_granularities をサポートしません。

const transcription = await client.audio.transcriptions.create({
  model: "gpt-4o-transcribe-diarize",
  file: createReadStream(audioPath),
  response_format: "diarized_json",
  chunking_strategy: "auto",
});

オプションで known_speaker_names と known_speaker_references(2~10 秒の音声クリップをデータ URL として)を指定すると、セグメントを既知の話者(最大 4 人)にマッピングできます。完全な話者ダイアライゼーションサンプルは core.md を参照。


<decision_framework>

判断フレームワーク

どのモデルを選ぶか

転写に何が必要ですか?
+-- テキストのみ(最高精度) -> gpt-4o-transcribe
+-- テキストのみ(コスト重視) -> gpt-4o-mini-transcribe
+-- 単語/セグメントのタイムスタンプ -> whisper-1(verbose_json)
+-- SRT または VTT 字幕ファイル -> whisper-1(srt または vtt)
+-- 話者識別 -> gpt-4o-transcribe-diarize
+-- 段階的/ストリーミング出力 -> gpt-4o-transcribe(stream: true)

どのレスポンス形式を使うか

どんな出力が必要ですか?
+-- プレーンテキスト文字列 -> "text"
+-- text フィールド付き JSON -> "json"(デフォルト)
+-- 動画用字幕 -> "srt" または "vtt"(whisper-1 のみ)
+-- タイムスタンプ(単語/セグメント) -> "verbose_json"(whisper-1 のみ)
+-- 話者ラベル付きセグメント -> "diarized_json"(gpt-4o-transcribe-diarize のみ)

転写 vs 翻訳

音声は英語ですか?
+-- はい -> audio.transcriptions.create() を使用
+-- いいえ -> 出力は元の言語がいいですか?
    +-- はい -> audio.transcriptions.create() を使用(言語を自動検出)
    +-- いいえ(英語が欲しい) -> audio.translations.create() を使用(whisper-1 のみ)

</decision_framework>


<red_flags>

注意すべきポイント

高優先度の問題:

  • response_format: "verbose_json" なしで whisper-1 で timestamp_granularities を使用(静かに無視される)
  • 25 MB を超えるファイルを送信(API がエラーを返す)
  • 30 秒以上の音声で chunking_strategy なしで gpt-4o-transcribe-diarize を使用(API がエラーを返す)
  • whisper-1 で stream: true を使用(サポートされていない)

中優先度の問題:

  • gpt-4o-transcribe の方が高精度な場面で whisper-1 を使用(whisper-1 は幻覚率が高い)
  • 言語がわかっている場合に language パラメータを指定しない(短い音声やノイズの多い音声では自動検出が正しくない可能性)
  • 同じ言語の転写が必要な場合に audio.translations.create() を使用(翻訳は常に英語を出力)
  • チャンク分割時に音声を文の途中で分割(境界でコンテキストが失われる)

よくある間違い:

  • prompt パラメータを指示(「注意深く転写してください」)として扱う — 語彙とスタイルのマッチングのためのコンテキストです
  • SRT/VTT 出力が必要な場合に gpt-4o-transcribe を使用 — これらの形式をサポートするのは whisper-1 のみ
  • gpt-4o-transcribe-diarize がプロンプトや logprobs をサポートすることを期待(サポートしません)
  • 英語音声に翻訳エンドポイントを使用(非英語から英語への翻訳のみ)
  • 分割ファイルの転写時に前のチャンクのコンテキストを提供しない(境界での精度が低下)

落とし穴とエッジケース:

  • prompt パラメータは whisper-1 で約 224 トークンに制限。長いプロンプトは切り捨てられます。
  • whisper-1 は無音またはほぼ無音のセグメントでテキストを幻覚することがあります。verbose_json の no_speech_prob を使用して検出します。
  • gpt-4o-transcribe と gpt-4o-mini-transcribe は json と text のレスポンス形式のみサポート — srt、vtt、verbose_json はサポートしません。
  • language パラメータは ISO 639-1 コードを使用(例: "en"、"fr"、"ja")。設定すると短い音声の精度が向上します。
  • サポートされるファイル形式: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm。その他の形式は事前に変換が必要です。
  • gpt-4o-transcribe-diarize は話者を「A」「B」「C」とラベル付けします。known_speaker_names と known_speaker_references(短い音声クリップ)を提供しない限りこの方式です。
  • 翻訳エンドポイントは whisper-1 のみをサポートし、英語のみを出力します — この API で他の言語に翻訳する方法はありません。
  • ストリーミング転写は transcript.text.delta イベント(delta 文字列プロパティ付き)と、最後に transcript.text.done イベントを発行します。

</red_flags>


<critical_reminders>

重要な注意点

**

…

[翻訳のため省略] </critical_reminders>

Individual skills in this repo

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

majiayu000/claude-skill-registry-data

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry-data

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry-data

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry-data

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry-data

Analyzes current state and user query to answer BMad questions or recommend the next workflow or agent. Use when user says what should I do next, what do I do now, or asks a question about BMad

majiayu000/claude-skill-registry-data

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry-data

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry-data

Portfolio allocation and rebalancing optimizer. Manages asset allocation across stocks/cash/bonds, performs periodic rebalancing, and ensures diversification according to market regime and risk tolerance.

majiayu000/claude-skill-registry-data

Create a hilarious and ultra-realistic video of an anthropomorphic animal acting like a human vlogger in a real-world setting.

majiayu000/claude-skill-registry-data

This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.

majiayu000/claude-skill-registry-data

小省导购员数字人带货版即梦视频提示词生成系统,基于四大智能体协同(提示词生成师、质量管控师、知识库运维师、跨环节适配师),按照"主体+运动+场景+(镜头语言+光影+氛围)"公式输出中英文双版提示词,适配5s短视频。确保人物一致性、视觉连贯性、情绪连贯性,支持知识库智能复用和跨工具适配(Suno音乐、AI绘画),为数字人带货视频提供高质量提示词生成服务。

majiayu000/claude-skill-registry-data

Upload and manage files using Google Gemini File API via scripts/. Use for uploading images, audio, video, PDFs, and other files for use with Gemini models. Supports file upload, status checking, and file management. Triggers on "upload file", "file API", "upload image", "upload PDF", "upload video", "file management".

majiayu000/claude-skill-registry-data

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry-data

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry-data

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

majiayu000/claude-skill-registry-data

Conduct domain and industry research. Use when the user says "lets create a research report on [domain or industry]

majiayu000/claude-skill-registry-data

Conduct market research on competition and customers. Use when the user says "create a market research report about [business idea]".

majiayu000/claude-skill-registry-data

Conduct technical research on technologies and architecture. Use when the user says "create a technical research report on [topic]".

majiayu000/claude-skill-registry-data

Understand an existing codebase through systematic exploration

majiayu000/claude-skill-registry-data

Builds, edit or validate Agent Skill through conversational discovery. Use when the user requests to "Create an Agent", "Optimize an Agent" or "Edit an Agent".

関連スキル