Ruby wrapper use Festival for speak of the text and scripts ...
- nix or OS X (pgrep tools) ...
- Festival and necessary languages ...
- Pulseaudio
# Gemfile
gem 'fest'
or
$ gem install fest
require 'fest'
@fest = Fest.new
@fest.say("Пример") # => Say "Пример"
@fest = Fest.new(YAML.load_file('../config/custom.yml'))
@fest.say("This is an example")
# => Say "This is an example"
# All options
# params || default value
params['path'] || '/tmp'
params['flat_volumes'] || 'no' # need pulseaudio flat-volumes = no
params['min_volume'] || 20
params['max_volume'] || 60
params['step'] || 4
params['backlight'] || nil # disable check backlight
params['language'] || 'voice_msu_ru_nsh_clunits'
params['conditions'] || {} # eval config/conditions.yml
## Сustomization
@fest.initialize(params = {})
# check @common_volume
# @path, @index, @min_volume, @max_volume ...
@fest.check_conditions
# eval config/conditions.yml if default conditions
@fest.make_wav(text)
@fest.expect_if_paplay_now
# wait if paplay active ...
@fest.play_wav
# play wav ... with @optimize_volume
# delete_wav
#!/bin/bash
vlc.run --play-and-exit $*
amixer set Master 30% > /dev/null 2>&1
or
; pulseaudio config
flat-volumes = no ; yes