Whisper
OpenAI Whisper
OpenAI's speech recognition model. Multilingual support, open source. Widely used for translation and subtitle generation.
OpenAI Whisper
OpenAI's speech recognition model. Multilingual support, open source. Widely used for translation and subtitle generation.
Whisper is an automatic speech recognition (ASR) model released by OpenAI in September 2022. Trained on 680,000 hours of multilingual speech data collected from the internet, it recognizes 99 languages, including English, and can translate several languages, including Korean, into English. It is released as open source under the MIT license, so anyone can use it for free.
Before Whisper, speech recognition required a separate model for each language and was vulnerable to accents, background noise, and technical terminology. Whisper operates robustly even in diverse acoustic environments thanks to large-scale Weakly Supervised Learning. It is widely used for podcasts, YouTube subtitles, meeting minutes generation, interpretation assistance, and more.
Technically, Whisper is an encoder-decoder Transformer architecture. It splits audio into 30-second chunks, converts them into 80-channel mel spectrograms, and feeds them into the encoder. The decoder predicts the next token together with the previously generated text, and supports various tasks such as language detection, timestamp generation, and translation.
In practice, Whisper is used in two ways: local execution (GPU/CPU) and the OpenAI API. Local execution is free but requires a GPU, while the API is convenient but billed per minute. Faster-Whisper (based on CTranslate2) is 4 times faster than the original and uses only half the memory, so it is often chosen in practice.
# pip install openai-whisper (μλ³Έ)
# pip install faster-whisper (μ΅μ ν λ²μ , κΆμ₯)
# === λ°©λ² 1: μλ³Έ Whisper (λ‘컬) ===
import whisper
model = whisper.load_model("base") # tiny, base, small, medium, large-v3
# μμ± νμΌ μ μ¬
result = model.transcribe("audio.mp3", language="ko")
print(result["text"])
# μμ΄λ‘ λ²μ
result_en = model.transcribe("audio.mp3", task="translate")
print(result_en["text"])
# νμμ€ν¬ν ν¬ν¨
for segment in result["segments"]:
print(f"[{segment['start']:.2f}s - {segment['end']:.2f}s] {segment['text']}")
# === λ°©λ² 2: Faster-Whisper (4λ°° λΉ λ¦, κΆμ₯) ===
from faster_whisper import WhisperModel
model = WhisperModel("large-v3", device="cuda", compute_type="float16")
segments, info = model.transcribe("audio.mp3", language="ko")
print(f"κ°μ§ μΈμ΄: {info.language} (νλ₯ : {info.language_probability:.2f})")
for segment in segments:
print(f"[{segment.start:.2f}s -> {segment.end:.2f}s] {segment.text}")
# === λ°©λ² 3: OpenAI API ===
from openai import OpenAI
client = OpenAI(api_key="your-api-key")
# μ μ¬ (Transcription)
audio_file = open("audio.mp3", "rb")
transcript = client.audio.transcriptions.create(
model="whisper-1",
file=audio_file,
response_format="verbose_json",
timestamp_granularities=["segment"]
)
print(transcript.text)
for segment in transcript.segments:
print(f"[{segment.start}s] {segment.text}")
# λ²μ (Translation to English)
translation = client.audio.translations.create(
model="whisper-1",
file=audio_file
)
print(translation.text)
# === λ°©λ² 4: μ€νΈλ¦¬λ°/μ€μκ° μ μ¬ (RealtimeSTT) ===
# pip install RealtimeSTT
# from RealtimeSTT import AudioToTextRecorder
#
# recorder = AudioToTextRecorder(model="base")
#
# def process_text(text):
# print(f"μΈμλ ν
μ€νΈ: {text}")
#
# recorder.text_callback = process_text
# recorder.start()
OpenAI Whisper API pricing as of January 2025
| Model | Price | Cost per hour | Features |
|---|---|---|---|
| Whisper / GPT-4o Transcribe | $0.006/min | $0.36/hour | Standard transcription |
| GPT-4o Transcribe + Diarization | $0.006/min | $0.36/hour | Includes speaker diarization |
| GPT-4o Mini Transcribe | $0.003/min | $0.18/hour | Low-cost option |
Whisper model comparison by size
| Model | Parameter | VRAM required | Relative speed |
|---|---|---|---|
| tiny | 39M | ~1GB | 32x |
| base | 74M | ~1GB | 16x |
| small | 244M | ~2GB | 6x |
| medium | 769M | ~5GB | 2x |
| large-v3 | 1.55B | ~10GB | 1x |
Cost comparison
"I think Whisper would be a good fit for automatically generating YouTube subtitles. If you run Faster-Whisper locally, you can use the large-v3 model without API costs, and its Korean recognition accuracy is quite high. With a GPU, real-time transcription is also possible."
"What are the advantages of Whisper?" - "Because it's open source, you can run it locally for free, and it supports 99 languages with a single model. It's especially robust to background noise and accents, so it works well in real-world environments. However, real-time streaming isn't supported out of the box, so separate handling is needed."
"If you use a Whisper + Diarization combination for a meeting minutes service, you can create subtitles separated by speaker. GPT-4o Transcribe with Diarization on the OpenAI API provides speaker diarization at no additional cost."
Take a mock interview on this topic β WIA SOOM AI Interview Β· Start for free
For short audio under 30 seconds or mixed-language audio, language detection can be wrong. For Korean speech, explicitly specify language="ko". Incorrect language detection greatly degrades transcription quality.
Whisper internally processes audio in 30-second chunks, but it loads the entire file into memory. For several hours of audio, split it into chunks for processing or use Faster-Whisper's batched inference.
Faster-Whisper is recommended for production. Optimized with CTranslate2, it is 4 times faster at the same accuracy and uses only half the memory. Using INT8 quantization makes it even lighter.