JOCLoudness 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Loudness/IIRFilter/IIRFilter.rb +3 -4
- data/lib/Loudness/JOCLoud.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70c06a0cf74b5717a783f385af081385f7bf95ef
|
4
|
+
data.tar.gz: 26cb1be5891ff54a3f3445d6c0a5d2fe27cd668c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52d59b4628a720eb3b943b45f4c76b09d045bfddb650de0a1c7f029981e80909d041ff30ea75ba2650fd798e183ceea1abd44792229e293e4228edfb067acdc2
|
7
|
+
data.tar.gz: 7131eb87e6101ece6f4f60acd452ce954a4cdcbab4699f73d86f951f2e17a890941a062c23526959fc408d73123ac731dd11897262f878ec860a956078f5ee80
|
data/lib/Loudness/JOCLoud.rb
CHANGED
@@ -3,9 +3,10 @@ require_relative './RlbFilter/RLBFilter.rb'
|
|
3
3
|
require_relative './PreFilter/PREFilter.rb'
|
4
4
|
require_relative './Mean/MeanFast.rb'
|
5
5
|
|
6
|
+
#Loudness computation class (Based on ITU-R BS.1770)
|
6
7
|
class JOCLoud
|
7
8
|
|
8
|
-
#
|
9
|
+
# Constructor
|
9
10
|
def initialize
|
10
11
|
@logger = nil
|
11
12
|
|
@@ -24,11 +25,14 @@ class JOCLoud
|
|
24
25
|
@iscomputingLKFS = false
|
25
26
|
end
|
26
27
|
|
27
|
-
#Set logger
|
28
|
+
# Set logger (optional)
|
28
29
|
def Setlogger(logger)
|
29
30
|
@logger = logger
|
30
31
|
end
|
31
32
|
|
33
|
+
# Initialize class
|
34
|
+
# @param fs [int] the sampling frecuency of wav file. It's used to compute the properly filter coeficients.
|
35
|
+
# @param nchannels [int] the number of audio channels of wav file.
|
32
36
|
def ini(fs, nchannels)
|
33
37
|
|
34
38
|
@fs = fs
|
@@ -67,6 +71,8 @@ class JOCLoud
|
|
67
71
|
Log(Logger::DEBUG,"Endini")
|
68
72
|
end
|
69
73
|
|
74
|
+
# Set audio channels weights (optional). The default channel weights for loudness computation are [1.0, 1.0, 1.0, 1.41, 1.41, 0, 0, 0] (lineal)
|
75
|
+
# @param channelweights [Array]
|
70
76
|
def SetChannelWeigths(channelweights)
|
71
77
|
|
72
78
|
if (@iscomputingLKFS == true)
|
@@ -108,6 +114,8 @@ class JOCLoud
|
|
108
114
|
end
|
109
115
|
end
|
110
116
|
|
117
|
+
# Returns the loudness of the wav file
|
118
|
+
# @return [Float] the resulting loudness in LKFS
|
111
119
|
def GetLoudnessLKFS
|
112
120
|
meanvals = Array.new
|
113
121
|
nc = 0
|