업무 자동화 음성 텍스트로 변환하기 with n8n & STT 음성 파일을 자동으로 텍스트로 변환하는 STT(Speech-to-Text) 기능은 다양한 업무 자동화에 활용될 수 있습니다. 특히 n8n과 Google Drive를 연동하면, 파일 업로드 시 자동으로 음성을 텍스트로 변환하는 강력한 자동화 시스템을 구성할 수 있습니다. 본문에서는 STT 구현 방법과 함께, 이를 n8n으로 자동화하는 실제 워크플로우 구성 방법까지 안내드립니다.
STT는 음성을 인식하여 텍스트로 변환하는 기술로, 음성 회의 기록, 고객 서비스 녹취 분석, 뉴스 스크립트 자동화 등 다양한 영역에서 활용됩니다. TTS(Text-to-Speech)의 반대 개념이며, AI 음성 인식 기술의 핵심 요소입니다.
Google의 STT API는 고정밀 음성 인식 서비스를 제공합니다.
import os
from google.cloud import speech
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "your_key.json"
def transcribe(audio_file):
client = speech.SpeechClient()
with open(audio_file, "rb") as f:
content = f.read()
audio = speech.RecognitionAudio(content=content)
config = speech.RecognitionConfig(
encoding=speech.RecognitionConfig.AudioEncoding.LINEAR16,
sample_rate_hertz=16000,
language_code="ko-KR"
)
response = client.recognize(config=config, audio=audio)
for result in response.results:
print(result.alternatives[0].transcript)
Python 기반 오픈소스 라이브러리로, Google Web Speech API 등을 사용할 수 있습니다.
pip install SpeechRecognition pydubfrom pydub import AudioSegment
import speech_recognition as sr
def convert_audio(input_file, output_file):
AudioSegment.from_file(input_file).export(output_file, format="wav")
def recognize_speech(audio_file):
r = sr.Recognizer()
with sr.AudioFile(audio_file) as source:
audio = r.record(source)
print(r.recognize_google(audio, language="ko-KR"))
Whisper는 다양한 언어를 지원하는 고성능 STT 모델로, 오픈소스로 제공됩니다.
pip install git+https://github.com/openai/whisper.gitimport whisper
model = whisper.load_model("base")
result = model.transcribe("sample_audio.mp3")
print(result["text"])
Google Drive에 음성 파일이 업로드되면, 자동으로 이를 감지하고 STT 변환 후 텍스트 결과를 저장하는 n8n 워크플로우 구성 방법입니다.
n8n을 아직 설치안하셨다면 해당 내용을 먼저 참고해보세요!
2024.12.15 – [제품추천/소프트웨어] – n8n 시놀로지 로컬 설치 쉽게 하는 방법
n8n 시놀로지 로컬 설치 쉽게 하는 방법
n8n 시놀로지 로컬 설치 쉽게 하는 방법 ㅣ n8n(n-eight-n으로 발음)은 전 세계의 모든 API 앱을 서로 연결하여 코드 한 줄 없이 데이터를 공유하고 조작할 수 있도록 도와줍니다. 사용하기 쉽고 사용
aboda.kr
Python 코드를 n8n의 Execute Command 노드로 실행합니다. 아래 예시는 Google Cloud API를 활용한 변환 스크립트입니다.
import os
import requests
from google.cloud import speech
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "your_key.json"
def download_file(url, local_path):
with requests.get(url, stream=True) as r:
r.raise_for_status()
with open(local_path, 'wb') as f:
for chunk in r.iter_content(8192):
f.write(chunk)
def transcribe(audio_file):
client = speech.SpeechClient()
with open(audio_file, "rb") as f:
content = f.read()
audio = speech.RecognitionAudio(content=content)
config = speech.RecognitionConfig(
encoding=speech.RecognitionConfig.AudioEncoding.LINEAR16,
sample_rate_hertz=16000,
language_code="ko-KR"
)
response = client.recognize(config=config, audio=audio)
return "\n".join([r.alternatives[0].transcript for r in response.results])
url = "URL_FROM_N8N"
file_path = "audio.wav"
download_file(url, file_path)
print(transcribe(file_path))
n8n과 STT 기능을 결합하면 음성 기반 데이터를 자동으로 분석하고 저장하는 자동화 시스템을 간단하게 구축할 수 있습니다. 코드 지식이 많지 않더라도, 위 워크플로우를 따라 하시면 누구나 구현할 수 있습니다.
관련 글
n8n자동화, 음성텍스트변환, STT자동화, 구글STTAPI, openaiWhisper, 음성인식워크플로우, GoogleDrive트리거, 자동음성기록, n8nExecuteCommand, STT스크립트
2025.06.20 – [부동산/자동화 프로젝트] – n8n Slack으로 자동 메시지 보내기 완전 쉬워요 (1/1)
n8n Slack으로 자동 메시지 보내기 완전 쉬워요 (1/1)
n8n Slack으로 자동 메시지 보내기 완전 쉬워요 , n8n을 활용한 자동화 워크플로우 시간입니다. 이번에는 Slack 채널로 알림 메시지를 자동 전송하는 방법을 소개드립니다. 환율 정보, 에러 발생 알림
aboda.kr
국회 보건복지위원회 소속 백종헌 의원이 검증되지 않은 농산물 성분 광고에 실증 의무를 부과하는 법안을 대표발의했어요.…
지드래곤이 신곡 기립 포스터를 전격 공개하며 데뷔 20주년을 향한 본격적인 행보를 시작했어요. 붉은색 배경의 강렬한…
르노 콜레오스와 필랑트를 고민하는 분들이라면 가격과 실내 공간의 차이가 가장 궁금할 거예요. 두 차는 뼈대를…
현대엘리베이터가 자회사 현대무벡스 지분 일부를 매각하며 약 1026억원의 현금을 손에 넣었습니다. 이는 시간외대량매매를 통해 11월…