🧤Speech to Text with Google API

หลายคนคงเคยใช้งาน Speech to Text กันมาบ้างแล้ว ในการแปลงเสียงเป็นข้อความ เช่น Google Translate ซึ่งทาง Google เองก็มี API ให้ใช้งาน มีทั้งแบบฟรีและไม่ฟรีให้ได้ลองเล่นกัน ถ้าไม่เกิน 60 นาที สามารถใช้งานได้ฟรี แต่ถ้าเกินก็จะเสียตัง Cloud Speech to Text Pricing

Requirement

Get Started

  • ทำการ Create project คลิก Next แล้วคลิก Download private key a JSON

  • ทำการติดตั้ง Google Cloud SDK แล้วกำหนดค่า Environment Variable

  • ทำการรัน Google Speech to Text API โดยขึ้นอยู่กับ Audio Encoding ที่ Support

  • ทำการรัน Google Speech to Text API โดยทำการ Upload ไฟล์ไปไว้ใน Google Cloud Storage ของตัวเอง เมื่อรันคำสั่งจะ Return ค่า Operation ID กรณีที่ไฟล์มีความยาวเกิน 1 นาทีให้ใช้คำสั่ง recognize-long-running

  • ทำการแสดง Metadata ของ Operation ID

  • ทำการแสดง Result ของ Operation ID

อ่านเพิ่มเติม : https://bit.ly/312fabR

Last updated

Was this helpful?