fest 1.4.14 → 1.4.15

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53f68ffbc15a4a6966f6fcb94ce7574d62ca544d
4
- data.tar.gz: e84ae4593be638f11355e4176e92940f6a2baeb9
3
+ metadata.gz: 98f5086be48f06050360fb29ec532b06a1c1fd31
4
+ data.tar.gz: 9f8fd4846065ece8468613d4649cce61fae8b73f
5
5
  SHA512:
6
- metadata.gz: b60e425906795bf19eaaafb1247731d783b3f638d13f0a8cdd9d6d696aafd953786068d36ba7a54e91531036e7e14367342291c8c4a290b90e4307d68a53112e
7
- data.tar.gz: 0ef24eb74d9d1e5576c35ced977b9862572e4cb3f11128c0841c6019a76d45bc06165a8196449733b100f4bffb86520dc8f05dcbdf6dcb63a8502488809b0df3
6
+ metadata.gz: 4dad9d66fee894a0815df1dd469283325c0786334b51ba9c9eebe7feff186104cba1cbedc3bef52d3d574c34a7efc3553cce125a3101eb6e99a86c8f407ce0b1
7
+ data.tar.gz: c373ff857191f69877389c7c28223de381449fb4af3bcde8fc860959250ddc052e0288d2b51fd4130d221b5cb0fd3044b8b655054518dfcbc80f87447136b662
@@ -1,3 +1,5 @@
1
+ ** 1.4.15 (Чт 15 окт 2015 17:29:36)
2
+ - fix common volume if lower and upper mix, max volume ...
1
3
  ** 1.4.14 (Ср 14 окт 2015 13:34:03)
2
4
  - fix optimize volume with flat_volumes ...
3
5
  ** 1.4.13 (Ср 14 окт 2015 11:59:29)
@@ -9,7 +9,7 @@ index:
9
9
  - "index = `ls -r #{@path} | grep -o '[0-9]*' | sed '1 ! d'`.to_i"
10
10
  - "index > 0 ? index += 1 : index = 1"
11
11
  min_volume:
12
- 20
12
+ 30
13
13
  max_volume:
14
14
  60
15
15
  step:
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'fest'
3
- gem.version = '1.4.14'
3
+ gem.version = '1.4.15'
4
4
  gem.authors = 'Alexsey Ermolaev'
5
5
  gem.email = 'afay.zangetsu@gmail.com'
6
6
  gem.homepage = 'https://github.com/AfsmNGhr/fest'
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
17
17
 
18
18
  gem.extra_rdoc_files = ['License.org', 'README.md']
19
- gem.requirements = ['*nix* or OS X (pgrep tools)',
19
+ gem.requirements = ['*nix* or OS X (pgrep, amixer)',
20
20
  'Pulseaudio sound server',
21
21
  'Festival speech engine']
22
22
  end
@@ -54,9 +54,20 @@ class Fest
54
54
  current_volumes_on_inputs
55
55
  volumes_for_inputs
56
56
  change_volumes(@current_volumes, @volumes, @step)
57
+ paplay_wav
58
+ change_volumes(@volumes, @current_volumes, @step)
59
+ end
60
+
61
+ def paplay_wav
62
+ change_common_volume(optimize_common_volume)
57
63
  system("paplay #{@path}/say_#{@index}.wav \
58
64
  --volume='#{optimize_volume * 655}' > /dev/null 2>&1")
59
- change_volumes(@volumes, @current_volumes, @step)
65
+ change_common_volume(@common_volume)
66
+ end
67
+
68
+ def change_common_volume(volume)
69
+ system("amixer set Master '#{volume}%' \
70
+ > /dev/null 2>&1") if @flat_volumes == 'no'
60
71
  end
61
72
 
62
73
  def delete_wav
@@ -18,21 +18,19 @@ module Volume
18
18
  def optimize_volume
19
19
  case @flat_volumes
20
20
  when 'yes'
21
- if @common_volume > @max_volume
22
- @max_volume
23
- elsif @common_volume < @min_volume
24
- @min_volume
25
- else
26
- @common_volume
27
- end
21
+ optimize_common_volume
28
22
  else
29
- if @common_volume > @max_volume
30
- @max_volume
31
- elsif @common_volume < @min_volume
32
- @min_volume
33
- else
34
- 100
35
- end
23
+ 100
24
+ end
25
+ end
26
+
27
+ def optimize_common_volume
28
+ if @common_volume > @max_volume
29
+ @max_volume
30
+ elsif @common_volume < @min_volume
31
+ @min_volume
32
+ else
33
+ @common_volume
36
34
  end
37
35
  end
38
36
 
@@ -52,13 +52,7 @@ RSpec.describe Fest do
52
52
  expect(@fest.optimize_volume).to eq(@common_volume)
53
53
  end
54
54
  else
55
- if @common_volume > @max_volume
56
- expect(@fest.optimize_volume).to be < @common_volume
57
- elsif @common_volume < @min_volume
58
- expect(@fest.optimize_volume).to be > @common_volume
59
- else
60
- expect(@fest.optimize_volume).to eq(100)
61
- end
55
+ expect(@fest.optimize_volume).to eq(100)
62
56
  end
63
57
  end
64
58
 
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.4.14
4
+ version: 1.4.15
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-10-14 00:00:00.000000000 Z
11
+ date: 2015-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  requirements:
88
- - "*nix* or OS X (pgrep tools)"
88
+ - "*nix* or OS X (pgrep, amixer)"
89
89
  - Pulseaudio sound server
90
90
  - Festival speech engine
91
91
  rubyforge_project: