[Speech API] Speech to Text Transcription with the Speech-to-Text API

yejin·2026년 4월 30일

Google Skills

목록 보기
38/46

Course

Using the Google Cloud Speech API

Lab

목록


🌠 Speech to Text Transcription with the Speech-to-Text API

개요

스크립트 작성을 위해 오디오 파일을 Speech API로 전송하기

실습과정

1. API Key 만들기



2. VM의 SSH 접속


3. API KEY 환경변수 설정


4. 요청 파일 생성

touch request.json
nano request.json

# 내용
{
  "config": {
      "encoding":"FLAC",
      "languageCode": "en-US"
  },
  "audio": {
      "uri":"gs://cloud-samples-data/speech/brooklyn_bridge.flac"
  }
}

5. API 호출

curl -s -X POST -H "Content-Type: application/json" --data-binary @request.json \
"https://speech.googleapis.com/v1/speech:recognize?key=${API_KEY}" > result.json

6. 요청 내용 수정

# request.json 파일 내용 수정
 {
  "config": {
      "encoding":"FLAC",
      "languageCode": "fr"
  },
  "audio": {
      "uri":"gs://cloud-samples-data/speech/corbeau_renard.flac"
  }
}

7. API 호출

curl -s -X POST -H "Content-Type: application/json" --data-binary @request.json \
"https://speech.googleapis.com/v1/speech:recognize?key=${API_KEY}" > result.json
profile
새싹 개발자

0개의 댓글