DEV Community

Vee Satayamas
Vee Satayamas

Posted on

4 1

ทดลองใช้ speech-to-text ของ Google ถอดเสียงประชุมสภาผู้แทนราษฎร

(25 กรกฎาคม 2562)

มันเป็น API อยู่ที่ https://cloud.google.com/speech-to-text/ มีวิธีใช้พร้อม ผมเปลี่ยน config นิดหน่อย ตามนี้ครับ

เขามีไฟล์ PDFให้อ่านด้วยนะครับ

แต่แค่อยากลองว่า Google มันจะฟังออกแค่ไหน

config = { encoding:          :FLAC,
           sample_rate_hertz: 16_000,
           language_code:     "th-TH" }
Enter fullscreen mode Exit fullscreen mode

ไฟล์เสียง

เพื่อใช้ในการวิจัยและไม่ได้มีการหาผลประโยชน์อะไรเลยนะครับ ตามนี้
https://file.veer66.rocks/nlp/sample1min7.flac

วิธีเตรียมไฟล์เสียงเพื่องานวิจัยและไม่ได้มีการหาผลประโยชน์

อันนี้เอาไฟล์เตรียมไฟล์ video ก่อนเพื่องานวิจัยและไม่ได้มีการหาผลประโยชน์

ffmpeg -i http://live.parliament.go.th/livestream/encoder3/playlist.m3u8 -c copy -bsf:a aac_adtstoasc output.mp4
Enter fullscreen mode Exit fullscreen mode

แล้วก็แปลงเป็นเสียงเพื่องานวิจัยและไม่ได้มีการหาผลประโยชน์

ffmpeg -i output.mp4 sample.mp3
Enter fullscreen mode Exit fullscreen mode

หลังจากนั้นผมใช้ Audacity แก้เสียง sample.mp3 ให้เป็น mono 16-bit แล้ว save เป็น .flac ครับ เพื่องานวิจัยและไม่ได้มีการหาผลประโยชน์อีกเช่นเคย

ผลออกมาได้งี้

ชาติแห่งชาติขุนกลางยึดมั่นในหลักจริยธรรมและธรรมาภิบาลมีสมรรถนะและความรู้ความสามารถพร้อมต่อการเปิดงานดำเนินการปรับปรุงสวัสดิการสวัสดิภาพชีวิตขวัญกำลังใจความเป็นอยู่ให้เกิดความปลอดภัยในการทำงาน

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay