Changeset 228e8d8 for interfaces
- Timestamp:
- Jan 9, 2010, 3:22:41 PM (15 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 3f16b61
- Parents:
- 493e6f7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
interfaces/python/aubioinput.py
r493e6f7 r228e8d8 10 10 import numpy 11 11 samples = numpy.frombuffer(buffer.data, dtype=numpy.float32) 12 samples.resize([len(samples)/chan, chan]) 13 return samples.T 12 if chan == 1: 13 return samples.T 14 else: 15 samples.resize([len(samples)/chan, chan]) 16 return samples.T 14 17 15 18 class AubioSink(gst.BaseSink): … … 53 56 if self.process: 54 57 self.process(v, self.pos) 55 self.pos += 1 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 56 66 return gst.FLOW_OK 57 67
Note: See TracChangeset
for help on using the changeset viewer.