tests: fix audio recording test
To calculate frequency it needs to use samples per second (44100), not samples pre recording lenght. This caused shorter recordings to not fit into the margin.
Esse commit está contido em:
pai
3815e0b5cf
commit
1abf949faf
@ -458,7 +458,7 @@ class TC_00_AppVMMixin(object):
|
|||||||
(rec[:-1] < -threshold))[0]
|
(rec[:-1] < -threshold))[0]
|
||||||
np.seterr('raise')
|
np.seterr('raise')
|
||||||
# compare against sine wave frequency
|
# compare against sine wave frequency
|
||||||
rec_freq = rec_size/np.mean(np.diff(crossings))
|
rec_freq = 44100/np.mean(np.diff(crossings))
|
||||||
if not sfreq*0.8 < rec_freq < sfreq*1.2:
|
if not sfreq*0.8 < rec_freq < sfreq*1.2:
|
||||||
self.fail('frequency {} not in specified range'
|
self.fail('frequency {} not in specified range'
|
||||||
.format(rec_freq))
|
.format(rec_freq))
|
||||||
|
|||||||
Carregando…
Referência em uma nova issue
Block a user