class ESpeak::Voice

Attributes

file[R]
gender[R]
language[R]
name[R]

Public Class Methods

all() click to toggle source
# File lib/espeak/voice.rb, line 13
def self.all
  voices = []
  CSV.parse(espeak_voices, headers: :first_row, col_sep: ' ') do |row|
    voices << Voice.new(language: row[1], gender: row[2], name: row[3], file: row[4] )
  end
  voices
end
espeak_voices() click to toggle source
# File lib/espeak/voice.rb, line 25
def self.espeak_voices
  `espeak --voices`
end
find_by_language(lang) click to toggle source
# File lib/espeak/voice.rb, line 21
def self.find_by_language(lang)
  all.find { |v| v.language == lang.to_s }
end
new(attributes) click to toggle source
# File lib/espeak/voice.rb, line 6
def initialize(attributes)
  @language = attributes[:language]
  @name     = attributes[:name]
  @gender   = attributes[:gender]
  @file     = attributes[:file]
end