- # TODO: This currently assumes U32 samples, and converts to S16.
- s = sample >> 16
- if s >= 0x8000:
- s -= 0x10000
- lo, hi = s & 0xff, (s >> 8) & 0xff
- return bytes([lo, hi])
-
- def decode(self, ss, es, data):
- if not self.samplerate:
- raise SamplerateError('Cannot decode without samplerate.')
- for self.samplenum, (sck, ws, sd) in data:
-
- # Ignore sample if the bit clock hasn't changed.
- if sck == self.oldsck:
- continue