Skip to content

Instantly share code, notes, and snippets.

@willnet
Created July 10, 2014 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willnet/7b2e310a5aabf9fd929c to your computer and use it in GitHub Desktop.
Save willnet/7b2e310a5aabf9fd929c to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
require 'voice_text_api'
require 'tempfile'
# https://github.com/tdtds/voice_text_api
vt = VoiceTextAPI.new('YOUR_API_KEY')
# wav = vt.tts('隣の客はよく柿食う客だ', :haruka, emotion: :happiness)
wav = vt.tts('隣の客はよく柿食う客だ', :haruka, emotion: :anger, emotion_level: 2)
Tempfile.open('test-text-api') do |file|
file.write wav
system("afplay #{file.path}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment