require 'rubygems'
require 'sinatra'
require 'espeak-ruby'

include ESpeak

get '/tts' do
     file = "file_#{Time.now}.mp3"
     espeak( file,params )
     [ 200, { "Content-type" => "audio/mpeg" }, File.read( file ) ]   
end