source: python/lib/aubio/__init__.py @ 8f0db97

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5sampleryinfft+
Last change on this file since 8f0db97 was 883b499, checked in by Paul Brossier <piem@piem.org>, 8 years ago

python/ext/aubiomodule.c: add aubio._aubio.version, import as aubio.version

  • Property mode set to 100644
File size: 600 bytes
RevLine 
[229d050]1#! /usr/bin/env python
2
[ccca7cb]3import numpy
[883b499]4from ._aubio import __version__ as version
[b96a7b8]5from ._aubio import float_type
[883b499]6from ._aubio import *
[4de5f35]7from .midiconv import *
8from .slicing import *
[ccca7cb]9
10class fvec(numpy.ndarray):
[143682b]11    """a numpy vector holding audio samples"""
[8bffcff]12
[143682b]13    def __new__(cls, input_arg=1024, **kwargs):
14        if isinstance(input_arg, int):
[b96a7b8]15            if input_arg == 0:
16                raise ValueError("vector length of 1 or more expected")
[143682b]17            return numpy.zeros(input_arg, dtype=float_type, **kwargs)
18        else:
19            return numpy.array(input_arg, dtype=float_type, **kwargs)
Note: See TracBrowser for help on using the repository browser.