fest 1.1.9 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.org +25 -43
- data/changelog.org +3 -0
- data/fest.gemspec +1 -1
- data/lib/fest.rb +4 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9237e21fc231d0ba30b76d23b80d12496ab47ae
|
4
|
+
data.tar.gz: 2ada0f7803419ef8be89927e9944b3bc5bc63df6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3eaf3e2d54049daefc46eff64c1207248784dc53ea30d365762f6e798695f301285136310a25149ac42618659aaaa6493f4ee239f3dd0598f76fd849ab44d3b
|
7
|
+
data.tar.gz: 95b7e5c453789a106c7094e0445e83e2ef405b66eb08180abf03e028e950d006194b33ab2dc6289368b6678d3d86086e66fd76f48d503ed3ba48a66578037a93
|
data/README.org
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
** FEST
|
2
|
-
|
3
|
-
**
|
2
|
+
Ruby wrapper use [[https://wiki.archlinux.org/index.php/Festival_%28%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%29][Festival]] for speak of the text and scripts ...
|
3
|
+
** Requirements
|
4
4
|
- *nix* or OS X ...
|
5
|
-
- [[https://wiki.archlinux.org/index.php/Festival_%28%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%29][Festival]]
|
5
|
+
- [[https://wiki.archlinux.org/index.php/Festival_%28%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%29][Festival]] and necessary languages ...
|
6
6
|
- [[https://wiki.archlinux.org/index.php/PulseAudio_%28%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%29][Pulseaudio]]
|
7
7
|
- xbacklight ([[https://wiki.archlinux.org/index.php/Backlight_%28%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%29][backlight]])
|
8
8
|
** Установка
|
@@ -10,94 +10,76 @@ FEST - Ruby-адаптер, использующий [[https://wiki.archlinux.or
|
|
10
10
|
# Gemfile
|
11
11
|
gem 'fest'
|
12
12
|
#+end_src
|
13
|
-
|
13
|
+
or
|
14
14
|
#+begin_src ruby
|
15
15
|
$ gem install fest
|
16
16
|
#+end_src
|
17
|
-
**
|
18
|
-
*****
|
17
|
+
** Used
|
18
|
+
***** Call methods
|
19
19
|
#+begin_src ruby
|
20
|
-
# Подключаем
|
21
20
|
require 'fest'
|
22
21
|
|
23
22
|
@fest = Fest.new
|
24
23
|
text = "Пример"
|
25
24
|
@fest.say(text)
|
26
|
-
# =>
|
25
|
+
# => Say "Пример"
|
27
26
|
|
28
|
-
#
|
27
|
+
# Expanded option
|
29
28
|
params = {:language => "cmu_us_slt_arctic_hts"}
|
30
29
|
text = "This is an example"
|
31
30
|
@fest.say(text, params)
|
32
|
-
# =>
|
31
|
+
# => Say "This is an example" ...
|
33
32
|
|
34
|
-
#
|
33
|
+
# All options
|
35
34
|
# params || default value
|
36
35
|
params[:path] || "/tmp"
|
37
36
|
params[:down_volume] || [20,60,4] # [min, max, step]
|
38
|
-
params[:backlight] || nil #
|
37
|
+
params[:backlight] || nil # disable check backlight
|
39
38
|
params[:language] || "voice_msu_ru_nsh_clunits"
|
40
39
|
|
41
|
-
#
|
40
|
+
# Declension
|
42
41
|
text = @fest.pluraform(2, %w(Сообщение Сообщения Сообщений))
|
43
42
|
puts text
|
44
43
|
# => "Сообщения"
|
45
44
|
#+end_src
|
46
45
|
|
47
|
-
**
|
46
|
+
** Сustomization
|
48
47
|
#+begin_src ruby
|
49
48
|
@fest.init(params)
|
50
|
-
#
|
49
|
+
# check @current_volume
|
51
50
|
# @path, @index, @min_volume, @max_volume ...
|
52
51
|
|
53
52
|
@fest.check_optimal_volume
|
54
53
|
# @volume = @current_volume - @down_volume
|
55
|
-
# Вычитает из текущей громкости @down_volume
|
56
54
|
|
57
55
|
@fest.optimize_min_and_max_volume(min_volume, max_volume)
|
58
|
-
# Проверяет громкость и ставит min или max ...
|
59
56
|
|
60
57
|
@fest.check_conditions
|
61
|
-
#
|
58
|
+
# @fest.check_say_wav
|
62
59
|
# check_light и check_home_theater
|
63
60
|
|
64
61
|
@fest.check_light # (with xbacklight)
|
65
|
-
#
|
62
|
+
# exit if backlight equal 0
|
66
63
|
|
67
64
|
@fest.check_home_theater
|
68
|
-
#
|
69
|
-
# Выходит если запущено...
|
70
|
-
|
71
|
-
@fest.check_say_wav
|
72
|
-
# Проверяем на max @index ... если нету @index = 1 ...
|
73
|
-
# Требуется чтобы сообщения не затирались до проигрывания...
|
65
|
+
# exit if run (vlc, kodi(xbmc))
|
74
66
|
|
75
67
|
@fest.make_wav(text)
|
76
|
-
# Создаём wav с определённым языком ... с учётом @index...
|
77
68
|
|
78
69
|
@fest.change_volume(volume)
|
79
|
-
# Ставит громкость ...
|
80
70
|
|
81
71
|
@fest.expect_if_paplay_now
|
82
|
-
#
|
83
|
-
|
84
|
-
@fest.turn_down_volume
|
85
|
-
# Получает список входящих каналов @inputs
|
86
|
-
# Понижает громкость ... c шагом...
|
87
|
-
# @volume = @current_volume - @current_volume / 10 * @step
|
72
|
+
# wait if paplay active ...
|
88
73
|
|
89
74
|
@fest.play_wav
|
90
|
-
#
|
91
|
-
#
|
92
|
-
|
93
|
-
@fest.return_current_volume
|
94
|
-
#
|
95
|
-
|
96
|
-
@fest.delete_wav
|
97
|
-
# Удаляет проигранный файл ...
|
75
|
+
# @fest.turn_down_volume (with @step)
|
76
|
+
# @volume = @current_volume - @current_volume / 10 * @step
|
77
|
+
# play wav ... with @optimize_volume
|
78
|
+
# @fest.return_current_volume (with @step)
|
79
|
+
# @fest.delete_wav
|
98
80
|
#+end_src
|
99
|
-
**
|
100
|
-
*****
|
81
|
+
** Issues
|
82
|
+
***** Level of loudness doesn't dump after an exit
|
101
83
|
#+begin_src bash
|
102
84
|
#!/bin/bash
|
103
85
|
|
data/changelog.org
CHANGED
data/fest.gemspec
CHANGED
data/lib/fest.rb
CHANGED
@@ -4,13 +4,10 @@ class Fest
|
|
4
4
|
def say(string, params = {})
|
5
5
|
init(params)
|
6
6
|
check_conditions
|
7
|
-
check_say_wav
|
8
7
|
make_wav(string)
|
9
8
|
expect_if_paplay_now
|
10
9
|
check_optimal_volume
|
11
10
|
play_wav
|
12
|
-
return_current_volume
|
13
|
-
delete_wav
|
14
11
|
end
|
15
12
|
|
16
13
|
def init(params)
|
@@ -43,6 +40,7 @@ class Fest
|
|
43
40
|
def check_conditions
|
44
41
|
check_light
|
45
42
|
check_home_theater
|
43
|
+
check_say_wav
|
46
44
|
end
|
47
45
|
|
48
46
|
def check_light
|
@@ -72,8 +70,8 @@ class Fest
|
|
72
70
|
|
73
71
|
def expect_if_paplay_now
|
74
72
|
loop do
|
75
|
-
sleep 1
|
76
73
|
break if `ps -el | grep paplay | wc -l`.to_i == 0
|
74
|
+
sleep 1
|
77
75
|
end
|
78
76
|
end
|
79
77
|
|
@@ -93,6 +91,8 @@ class Fest
|
|
93
91
|
turn_down_volume
|
94
92
|
system("paplay #{@path}/say_#{@index}.wav \
|
95
93
|
--volume='#{@optimize_volume * 655}' > /dev/null 2>&1")
|
94
|
+
return_current_volume
|
95
|
+
delete_wav
|
96
96
|
end
|
97
97
|
|
98
98
|
def return_current_volume
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexsey Ermolaev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby wrapper for festival scripts
|
14
14
|
email: afay.zangetsu@gmail.com
|
@@ -52,3 +52,4 @@ signing_key:
|
|
52
52
|
specification_version: 4
|
53
53
|
summary: Ruby wrapper for festival speech engine
|
54
54
|
test_files: []
|
55
|
+
has_rdoc:
|