Changeset f264b17 for python/lib/aubio/__init__.py
- Timestamp:
- Jun 22, 2016, 1:00:10 PM (8 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:
- 4b9443c4
- Parents:
- 60fc05b (diff), 6769586 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/lib/aubio/__init__.py
r60fc05b rf264b17 2 2 3 3 import numpy 4 from _aubio import * 5 from midiconv import * 6 from slicing import * 4 from ._aubio import * 5 from ._aubio import float_type 6 from .midiconv import * 7 from .slicing import * 7 8 8 9 class fvec(numpy.ndarray): 9 " a simple numpy array holding a vector of float32 " 10 def __new__(self, length = 1024, **kwargs): 11 self.length = length 12 if type(length) == type([]): 13 return numpy.array(length, dtype='float32', **kwargs) 14 return numpy.zeros(length, dtype='float32', **kwargs) 10 """a numpy vector holding audio samples""" 11 12 def __new__(cls, input_arg=1024, **kwargs): 13 if isinstance(input_arg, int): 14 if input_arg == 0: 15 raise ValueError("vector length of 1 or more expected") 16 return numpy.zeros(input_arg, dtype=float_type, **kwargs) 17 else: 18 return numpy.array(input_arg, dtype=float_type, **kwargs)
Note: See TracChangeset
for help on using the changeset viewer.