사전 녹음 STT — 음성 파일 전사

사전 녹음 STT — 음성 파일 전사

AssemblyAI의 사전 녹음 Speech-to-Text API는 이미 녹음된 오디오·비디오를 텍스트로 바꿔줘요. 업로드·제출·폴링을 SDK 한 번의 호출로 처리해요.

첫 전사 (Python)

import os
from assemblyai.prerecorded.v2 import Transcriber

transcriber = Transcriber(api_key=os.environ["ASSEMBLYAI_API_KEY"])
transcript = transcriber.transcribe("https://assembly.ai/wildfires.mp3")
print(transcript.text)

옵션

  • 로컬 파일: 파일 경로를 넘기면 SDK가 업로드
  • 화자 라벨(Speaker Diarization): speaker_labels=True로 화자별 발화 분리
  • 언어 자동 감지: language_detection=True
config = TranscriptionConfig(language_detection=True, speaker_labels=True)
transcript = transcriber.transcribe(audio_file, config=config)
for utterance in transcript.utterances:
    print(f"Speaker {utterance.speaker}: {utterance.text}")

HTTP 직접 호출

SDK 없이도 POST /v2/transcript로 제출 후 GET /v2/transcript/{id}를 폴링(3초 간격)해 completed가 되면 텍스트를 읽으면 돼요.

제한

  • 파일 크기: 요청당 최대 5GB (업로드 2.2GB)
  • 지속 시간: 160ms ~ 10시간
  • 무료 계정 기본 병렬 5 jobs, 유료 200

더 알아보기