VoiceText Web APIでのGolang利用事例のご紹介

B9dd885e3ef94ac5e0bcfdf4800ba703?s=47 tmaeda
January 21, 2015

VoiceText Web APIでのGolang利用事例のご紹介

Golang meetup in Sapporo 2015/01/21 #sapgolang

B9dd885e3ef94ac5e0bcfdf4800ba703?s=128

tmaeda

January 21, 2015
Tweet

Transcript

  1. 5.

    7PJDF5FYU8FC"1* curl "https://api.voicetext.jp/v1/tts" \ -o "test.wav" \ -u "YOUR_API_KEY:" \

    -d "text=͓͸Α͏͍͟͝·͢" \ -d “speaker=hikari" \ -d “emotion=happiness” \ -d “emotion_level=2”
  2. 6.

    7PJDF5FYU8FC"1*ͷߏ੒ Portal(Rails) Wrapper (Go)! ར༻ऀ VoiceText Engine Ի੠߹੒αʔόʔ Heroku Postgre!

    SQL ɾϩά ɾϢʔβʔ ೝূɺϩάॻࠐ Ϣʔβʔ! ొ࿥ Ϣʔβʔొ࿥ LoadBalancer APIར༻
  3. 15.

    $ͱͷ਌࿨ੑ wඞཁ࠷খݶͷखଓ͖ Ͱɺ$Ͱॻ͔Εͨ֎ ෦ϥΠϒϥϦͷؔ਺ Λݺͼग़ͤΔɻ package rand ! /* #include

    <stdlib.h> */ import "C" ! func Random() int { // Cͷੈքͷrandom()ؔ਺Λݺͼग़ͯ͠ // ݁ՌΛgoͷੈքͷintʹม׵ͯ͠ฦ͢ return int(C.random()) } ! func Seed(i int) { // goͷੈքͷintܕͷiΛCͷੈքͷuintʹม׵ͯ͠ɺ // Cͷੈքͷsrandomؔ਺ʹҾ਺ͱͯ͠౉͢ C.srandom(C.uint(i)) }
  4. 24.