Changes in interfaces/python/aubioinput.py [228e8d8:1f8e522]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
interfaces/python/aubioinput.py
r228e8d8 r1f8e522 10 10 import numpy 11 11 samples = numpy.frombuffer(buffer.data, dtype=numpy.float32) 12 if chan == 1: 13 return samples.T 14 else: 15 samples.resize([len(samples)/chan, chan]) 16 return samples.T 12 samples.resize([len(samples)/chan, chan]) 13 return samples.T 17 14 18 15 class AubioSink(gst.BaseSink): … … 56 53 if self.process: 57 54 self.process(v, self.pos) 58 self.pos += 1 59 remaining = self.adapter.available() 60 if remaining < blocksize and remaining > 0: 61 block = self.adapter.take_buffer(remaining) 62 v = gst_buffer_to_numpy_array(block, chan) 63 if self.process: 64 self.process(v, self.pos) 65 self.pos += 1 55 self.pos += 1 66 56 return gst.FLOW_OK 67 57
Note: See TracChangeset
for help on using the changeset viewer.