speech2text 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/speech2text +0 -0
- data/lib/speech/audio_inspector.rb +24 -5
- data/lib/speech/version.rb +1 -1
- metadata +1 -1
data/bin/speech2text
CHANGED
File without changes
|
@@ -19,7 +19,7 @@ module Speech
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def to_f
|
22
|
-
self.
|
22
|
+
(self.hours.to_i * 3600) + (self.minutes.to_i * 60) + self.seconds.to_f
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.from_seconds(seconds)
|
@@ -39,7 +39,8 @@ module Speech
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def +(b)
|
42
|
-
self.to_f + b.to_f
|
42
|
+
total = self.to_f + b.to_f
|
43
|
+
# puts "total: #{self.to_f} + #{b.to_f} = #{total.inspect}"
|
43
44
|
Duration.from_seconds(self.to_f + b.to_f)
|
44
45
|
end
|
45
46
|
|
@@ -61,17 +62,35 @@ if $0 == __FILE__
|
|
61
62
|
a = Speech::AudioInspector::Duration.new("00:00:12.12")
|
62
63
|
b = Speech::AudioInspector::Duration.new("00:00:02.00")
|
63
64
|
|
64
|
-
|
65
|
+
assert_equal "00:00:14:12", (a + b).to_s
|
65
66
|
|
66
67
|
a = Speech::AudioInspector::Duration.new("00:10:12.12")
|
67
68
|
b = Speech::AudioInspector::Duration.new("08:00:02.00")
|
68
69
|
|
69
|
-
|
70
|
+
assert_equal "08:10:14:12", (a + b).to_s
|
70
71
|
|
71
72
|
a = Speech::AudioInspector::Duration.new("02:10:12.12")
|
72
73
|
b = Speech::AudioInspector::Duration.new("08:55:02.10")
|
73
74
|
|
74
|
-
|
75
|
+
assert_equal "11:05:14:22", (a + b).to_s
|
76
|
+
|
77
|
+
a = Speech::AudioInspector::Duration.new("00:00:12.12")
|
78
|
+
b = Speech::AudioInspector::Duration.new("00:00:02.00")
|
79
|
+
|
80
|
+
a = a + b
|
81
|
+
assert_equal "00:00:14:12", a.to_s
|
82
|
+
puts a.inspect
|
83
|
+
|
84
|
+
a = a + b
|
85
|
+
puts a.inspect
|
86
|
+
|
87
|
+
assert_equal "00:00:16:12", a.to_s
|
88
|
+
|
89
|
+
a = a + b
|
90
|
+
puts a.to_s
|
91
|
+
assert_equal "00:00:18:12", a.to_s
|
92
|
+
puts a.to_s
|
75
93
|
end
|
94
|
+
|
76
95
|
end
|
77
96
|
end
|
data/lib/speech/version.rb
CHANGED