Skip to content

Instantly share code, notes, and snippets.

@willnet
Created July 10, 2014 14:25
Show Gist options
  • Select an option

  • Save willnet/7b2e310a5aabf9fd929c to your computer and use it in GitHub Desktop.

Select an option

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