Skip to content

Instantly share code, notes, and snippets.

@willnet
Created Jul 10, 2014
Embed
What would you like to do?
# -*- 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