0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Otter.ai × Whisper × Colab:英語会話を録音→MP3→高精度文字起こしまで一括処理!

Posted at

🧠 Otter.ai × Whisper × Colab:英語会話を録音→MP3→高精度文字起こしまで一括処理!

🎯 この記事でできること

  1. Otter.aiで会議や講義を録音&ダウンロード
  2. 録音ファイル(WAV/M4A/WEBMなど)をMP3に変換
  3. Google Colab + Whisperで英語文字起こし(MP3対応)
  4. 議事録・字幕・要約などへの応用

🔁 フロー全体図

📡 Otter.ai録音(講義・会議・取材)
 ↓(録音完了後ダウンロード)
🎧 音声ファイル(WEBM/WAV/M4Aなど)
 ↓(MP3に変換)
🎵 MP3ファイル
 ↓(Colabにアップロード)
🧠 Whisperで英語文字起こし

🧾 ステップ① Otter.aiで録音・保存

Otterの使い方(要ログイン):

  1. https://otter.ai にアクセス

  2. 「Record」ボタンを押して録音開始

  3. 録音が終わったら、「Export Audio」から音声ファイルをダウンロード

    • 出力形式:.m4a / .webm / .wav

🎼 ステップ② 音声をMP3に変換(Colab上)

Google Colabで.webm.m4a.mp3に変換するにはffmpegを使います。

# 音声ファイルをアップロード(Otterから保存したファイルを選択)
from google.colab import files
uploaded = files.upload()

# 最初のファイル名を取得
filename = next(iter(uploaded))

# ffmpegでMP3に変換
import os
mp3_filename = os.path.splitext(filename)[0] + ".mp3"
!ffmpeg -i "{filename}" "{mp3_filename}"

🔍 ステップ③ Whisperで英語文字起こし(MP3ファイル)

# Whisperのインストール
!pip install openai-whisper ffmpeg-python

# WhisperでMP3ファイルを英語で文字起こし
import whisper
model = whisper.load_model("medium")  # "small" や "large" も選択可

result = model.transcribe(mp3_filename, language="en")

# テキスト保存&表示
with open("transcription_en.txt", "w", encoding="utf-8") as f:
    f.write(result['text'])

print("✅ Whisper transcription completed:\n")
print(result['text'])

🧠 OtterとWhisperの連携と違い

特徴 Otter.ai Whisper + Colab
リアルタイム対応 ◎ Zoom・Google Meetと連携可能 × 後処理型
高精度・カスタム自由度 △ 単語単位の訂正は難しい ◎ モデル選択・編集・整形が自在
ファイル形式 .m4a, .webm, .wav など .mp3 に変換して入力
話者分離(Speaker ID) ◎(話者ラベル自動) △(分離不可。外部ツールが必要)
要約・翻訳・整形 ○ キーワード抽出、文単位整形あり ◎ Pythonで自由に拡張可能

✅ 応用:字幕ファイル(SRT形式)で出力したいとき

# SRT形式で出力(タイムスタンプ付き)
result = model.transcribe(mp3_filename, language="en", task="transcribe", verbose=True)
with open("output.srt", "w", encoding="utf-8") as f:
    for segment in result["segments"]:
        f.write(f"{segment['id']+1}\n")
        start = segment["start"]
        end = segment["end"]
        f.write(f"{start:.2f} --> {end:.2f}\n")
        f.write(f"{segment['text']}\n\n")

🎬 まとめ

  • Otter.aiでその場の会話を録音、あとで「Export Audio」すれば音声ファイルが手に入る
  • それをGoogle ColabでMP3に変換 → Whisperで高精度文字起こし
  • カスタマイズやデータ分析、字幕生成、翻訳にも発展できる

# Program Name: local_mp3_transcribe_whisper_en.py
# Creation Date: 20250702
# Overview: Upload a local MP3 file to Google Colab and transcribe its English audio using Whisper
# Usage: Run cell-by-cell. Upload MP3 file and get transcription result.

# === 必要なライブラリのインストール / Install Required Packages ===
!pip install openai-whisper ffmpeg-python

# === ファイルアップロード / Upload MP3 File ===
from google.colab import files
uploaded = files.upload()  # ← ここでMP3ファイルを選ぶ!

# === ファイル名取得 / Get Filename ===
filename = next(iter(uploaded))

# === Whisperで英語文字起こし / Transcribe English Audio ===
import whisper
model = whisper.load_model("medium")  # "base", "small", "medium", "large"

# 言語を英語に指定して文字起こし
result = model.transcribe(filename, language="en")

# === 出力保存 / Save to Text File ===
output_file = "transcription_en.txt"
with open(output_file, "w", encoding="utf-8") as f:
    f.write(result['text'])

# === 結果表示 / Show Result ===
print("✅ Transcription completed! Copy the text below:\n")
print(result['text'])

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?