FastAPI와 Faster Whisper를 사용한 음성-텍스트 변환(STT) 서버입니다.
# Docker 사용 (권장)
docker-compose up -d
# 로컬 실행
python app.py# 서버 상태 확인
curl http://localhost:7926/api/v1/stt/health
# 음성 변환
curl -X POST "http://localhost:7926/api/v1/stt/transcribe" \
-H "Content-Type: multipart/form-data" \
-F "file=@recording.wav"cd client
python run_web.py브라우저에서 http://localhost:3000 접속
- ✅ 음성-텍스트 변환: Whisper 모델 기반
- ✅ 다국어 지원: 10개 언어 지원
- ✅ 언어 고정: 특정 언어로 강제 지정
- ✅ 실시간 처리: 비동기 처리
- ✅ REST API: FastAPI 기반
- ✅ 자동 문서화: Swagger/ReDoc
- ✅ Docker 지원: 컨테이너화
- ✅ 웹 클라이언트: 테스트용 UI
- Backend: FastAPI, Uvicorn
- STT Engine: Faster Whisper
- Language: Python 3.11
- Container: Docker & Docker Compose
- Documentation: Swagger UI, ReDoc
| 언어 코드 | 언어명 | 언어 코드 | 언어명 |
|---|---|---|---|
ko |
한국어 | es |
스페인어 |
en |
영어 | fr |
프랑스어 |
ja |
일본어 | de |
독일어 |
zh |
중국어 | it |
이탈리아어 |
pt |
포르투갈어 | ||
ru |
러시아어 |
- WAV (
.wav) - MP3 (
.mp3) - M4A (
.m4a) - FLAC (
.flac) - OGG (
.ogg)
- 실시간 문서:
- Swagger UI - 대화형 API 문서
- ReDoc - 대안 문서 뷰어
- OpenAPI 스펙 - OpenAPI 3.0 스펙
- Docker와 Docker Compose 설치
- 프로젝트 클론
- 서버 실행
# Windows
docker-run.bat
# Linux/Mac
./docker-run.sh- 가상환경 생성 및 활성화
python -m venv venv
venv\Scripts\activate # Windows- 의존성 설치
pip install -r requirements.txt- 서버 실행
python app.py# 서버 실행
docker-compose up -d
# 로그 확인
docker-compose logs -f
# 서버 중지
docker-compose down
# 이미지 재빌드
docker-compose build --no-cache- STT 서버: http://localhost:7926 (설정 파일에서 변경 가능)
- 웹 클라이언트: http://localhost:3000
GET /api/v1/health- 서버 상태 확인POST /api/v1/stt/transcribe- 음성 변환GET /api/v1/info- 서비스 정보
| 변수명 | 기본값 | 설명 |
|---|---|---|
HOST |
0.0.0.0 |
서버 호스트 |
PORT |
7926 |
서버 포트 |
WHISPER_MODEL |
base |
Whisper 모델 크기 |
WHISPER_DEVICE |
cpu |
처리 디바이스 |
WHISPER_LANGUAGE |
None |
기본 언어 (미설정 시 자동 감지) |
MAX_FILE_SIZE |
16777216 |
최대 파일 크기 (16MB) |
import requests
# 음성 변환 (한국어 고정)
with open("recording.wav", "rb") as f:
files = {"file": f}
response = requests.post(
"http://localhost:7926/api/v1/stt/transcribe?language=ko",
files=files
)
print(response.json())# 한국어로 고정하여 변환
curl -X POST "http://localhost:7926/api/v1/stt/transcribe?language=ko" \
-H "Content-Type: multipart/form-data" \
-F "file=@recording.wav"- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
이 프로젝트는 MIT 라이선스 하에 배포됩니다. 자세한 내용은 LICENSE 파일을 참조하세요.
- 이슈 리포트: GitHub Issues
- 문서 개선: Pull Request
- 기술 문의: 프로젝트 팀