Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

tmaeda
January 21, 2015

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

Golang meetup in Sapporo 2015/01/21 #sapgolang

tmaeda

January 21, 2015
Tweet

More Decks by tmaeda

Other Decks in Technology

Transcript

  1. 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. 7PJDF5FYU8FC"1*ͷߏ੒ Portal(Rails) Wrapper (Go)! ར༻ऀ VoiceText Engine Ի੠߹੒αʔόʔ Heroku Postgre!

    SQL ɾϩά ɾϢʔβʔ ೝূɺϩάॻࠐ Ϣʔβʔ! ొ࿥ Ϣʔβʔొ࿥ LoadBalancer APIར༻
  3. $ͱͷ਌࿨ੑ 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)) }