Пример #1
0
class _Codec:
    """Base class for codecs"""
    implements(IAudioCodec)

    def __init__(self, samplesize):
        self.samplesize = samplesize
        self.b = b''

    def buffer_and_encode(self, payload):
        self.b += payload
        res = []
        while len(self.b) >= self.samplesize:
            sample, self.b = self.b[:self.samplesize], self.b[self.samplesize:]
            res.append(self._encode(sample))
        return res
Пример #2
0
 class Stringlike(object):
     implements(IString)
Пример #3
0
 class Bar(object):
     implements(IBar)
     def __init__(self, original=None):
         pass
Пример #4
0
 class Foo(object):
     implements(IFoo)