class Espeak::Speech

Defined in:

espeak/speech.cr

Constant Summary

DEFAULT_CAPITAL = 1
DEFAULT_PITCH = 50
DEFAULT_QUIET = true
DEFAULT_SPEED = 170
DEFAULT_VOICE = "en"

Although espeak itself has default options I'm defining them here for easier generating command (with simple hash.merge)

Constructors

Instance Method Summary

Constructor Detail

def self.new(text : String, *, voice : String = DEFAULT_VOICE, pitch : Int32 = DEFAULT_PITCH, speed : Int32 = DEFAULT_SPEED, capital : Int32 = DEFAULT_CAPITAL, quiet : Bool = DEFAULT_QUIET) #

filename - The file that will be generated :voice - use voice file of this name from espeak-data/voices. ie "en", "de", ... :pitch - pitch adjustment, 0 to 99 :speed - speed in words per minute, 80 to 370 :capital - increase emphasis of capitalized letters by raising pitch by this amount no range given in man but good range is 10-40 to start :quiet - remove printing to stdout. Affects only lame (default false)


[View source]

Instance Method Detail

def bytes #

Returns mp3 file bytes as a result of Text-To-Speech conversion.


[View source]
def bytes_wav #

Returns wav file bytes as a result of Text-To-Speech conversion.


[View source]
def capital : Int32 #

[View source]
def pitch : Int32 #

[View source]
def quiet : Bool #

[View source]
def save(filename) #

Generates mp3 file as a result of Text-To-Speech conversion.


[View source]
def speak #

Speaks text


[View source]
def speed : Int32 #

[View source]
def text : String #

[View source]
def voice : String #

[View source]