source:
python/lib/aubio/__init__.py
@
0a2a8dd
Last change on this file since 0a2a8dd was 883b499, checked in by , 8 years ago | |
---|---|
|
|
File size: 600 bytes |
Rev | Line | |
---|---|---|
[229d050] | 1 | #! /usr/bin/env python |
2 | ||
[ccca7cb] | 3 | import numpy |
[883b499] | 4 | from ._aubio import __version__ as version |
[b96a7b8] | 5 | from ._aubio import float_type |
[883b499] | 6 | from ._aubio import * |
[4de5f35] | 7 | from .midiconv import * |
8 | from .slicing import * | |
[ccca7cb] | 9 | |
10 | class 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.