Beispiel #1
0
 def test_fail_not_fvec(self):
     try:
         silence_detection("default", -70)
     except ValueError as e:
         pass
     else:
         self.fail('non-number input phase does not raise a TypeError')
Beispiel #2
0
 def test_fail_not_fvec(self):
     try:
         silence_detection("default", -70)
     except ValueError as e:
         pass
     else:
         self.fail('non-number input phase does not raise a TypeError')
 def __call__(self, block):
     if aubio.silence_detection(block, self.silence) == 1:
         if self.wassilence != 1:
             self.wassilence = 1
             return 2  # newly found silence
         return 1  # silence again
     else:
         if self.wassilence != 0:
             self.wassilence = 0
             return -1  # newly found noise
         return 0  # noise again
Beispiel #4
0
 def __call__(self, block):
     if aubio.silence_detection(block, self.silence) == 1:
         if self.wassilence != 1:
             self.wassilence = 1
             return 2   # newly found silence
         return 1       # silence again
     else:
         if self.wassilence != 0:
             self.wassilence = 0
             return -1  # newly found noise
         return 0       # noise again
 def test_fail_not_fvec(self):
     try:
         silence_detection("default", -70)
     except ValueError, e:
         pass
 def test_accept_fvec(self):
     silence_detection(fvec(1024), -70.)
Beispiel #7
0
 def process(self, frames, eod=False):
     self.silence.append(silence_detection(frames, self.threshold))
     return frames, eod
Beispiel #8
0
 def process(self, frames, eod=False):
     self.silence.append(silence_detection(frames, self.threshold))
     return frames, eod
Beispiel #9
0
 def test_fail_not_fvec(self):
     try:
         silence_detection("default", -70)
     except ValueError, e:
         pass
Beispiel #10
0
 def test_fail_not_fvec(self):
     with self.assertRaises(ValueError):
         silence_detection("default", -70)
Beispiel #11
0
 def test_minus_ones_is_zero(self):
     from numpy import ones
     assert silence_detection(ones(1024, dtype=float_type), -70) == 0
Beispiel #12
0
 def test_zeros_is_one(self):
     assert silence_detection(fvec(1024), -70) == 1
Beispiel #13
0
 def test_fail_not_fvec(self):
     with self.assertRaises(ValueError):
         silence_detection("default", -70)
Beispiel #14
0
 def test_accept_fvec(self):
     silence_detection(fvec(1024), -70.)
Beispiel #15
0
 def test_zeros_is_one(self):
     from math import isinf
     assert silence_detection(fvec(1024), -70) == 1
 def test_zeros_is_one(self):
     from math import isinf
     assert silence_detection(fvec(1024), -70) == 1
 def test_minus_ones_is_zero(self):
     from numpy import ones
     assert silence_detection(ones(1024, dtype="float32"), -70) == 0
Beispiel #18
0
 def test_zeros_is_one(self):
     assert silence_detection(fvec(1024), -70) == 1