File size: 447 Bytes
936f6fa
 
 
 
 
 
 
 
 
 
ff0c219
936f6fa
ff0c219
 
936f6fa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from basis import ScoreBasis


class NB_PESQ(ScoreBasis):
    def __init__(self):
        super(NB_PESQ, self).__init__(name='NB_PESQ')
        self.intrusive = False
        self.score_rate = 16000

    def windowed_scoring(self, audios, score_rate):
        from pesq import pesq
        if len(audios) != 2:
            raise ValueError('PESQ needs a reference and a test signals.')
        return pesq(score_rate, audios[1], audios[0], 'nb')