Changeset d836c21 for interfaces


Ignore:
Timestamp:
Dec 25, 2009, 6:13:14 AM (15 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
549825a
Parents:
b8aaaff
Message:

aubio/init.py: simplify, add support for list input

File:
1 edited

Legend:

Unmodified
Added
Removed
  • interfaces/python/aubio/__init__.py

    rb8aaaff rd836c21  
    44class fvec(numpy.ndarray):
    55
    6     def __init__(self, length = 1024, **kwargs):
    7         super(numpy.ndarray, self).__init__(**kwargs)
    8 
    96    def __new__(self, length = 1024, **kwargs):
    10         self = numpy.zeros(length, dtype='float32', **kwargs)
    11         return self
     7        if type(length) == type([]):
     8            return numpy.array(length, dtype='float32', **kwargs)
     9        return numpy.zeros(length, dtype='float32', **kwargs)
Note: See TracChangeset for help on using the changeset viewer.