source:
python/lib/aubio/__init__.py
@
04fc360
Last change on this file since 04fc360 was b96a7b8, checked in by , 9 years ago | |
---|---|
|
|
File size: 557 bytes |
Rev | Line | |
---|---|---|
[229d050] | 1 | #! /usr/bin/env python |
2 | ||
[ccca7cb] | 3 | import numpy |
[4de5f35] | 4 | from ._aubio import * |
[b96a7b8] | 5 | from ._aubio import float_type |
[4de5f35] | 6 | from .midiconv import * |
7 | from .slicing import * | |
[ccca7cb] | 8 | |
9 | class fvec(numpy.ndarray): | |
[143682b] | 10 | """a numpy vector holding audio samples""" |
[8bffcff] | 11 | |
[143682b] | 12 | def __new__(cls, input_arg=1024, **kwargs): |
13 | if isinstance(input_arg, int): | |
[b96a7b8] | 14 | if input_arg == 0: |
15 | raise ValueError("vector length of 1 or more expected") | |
[143682b] | 16 | return numpy.zeros(input_arg, dtype=float_type, **kwargs) |
17 | else: | |
18 | return numpy.array(input_arg, dtype=float_type, **kwargs) |
Note: See TracBrowser
for help on using the repository browser.