[Numpy-discussion] casting in numarray

Thomas Grill gr at grrrr.org
Thu Mar 17 12:46:14 EST 2005

Hi Joachim,
this is what i do in my Python extension of the Pure Data realtime 
modular system. You have to create a Python buffer object pointing to 
your memory location and then create a numarray from that. It's quite easy.
See the code in
files pybuffer.h and pybuffer.cpp

best greetings,

Joachim Boomberschloss schrieb:

>I'm using numarray for an audio-related application as
>a buffer in an audio-processing pipeline. I would like
>to be able to allocate the buffer in advance and later
>regard it as a buffer of 8bit or 16bit samples as
>appropriate, but in numarray, casting always produces
>a new array, which I don't want. How difficult should
>it be to make it possible to create an array using an
>exsisting pre-allocated buffer to act as an interface
>to that buffer? Also, if others consider it useful, is
>there anyone willing to guide me through the code in
>doing so?
>Do you Yahoo!? 
>Yahoo! Small Business - Try our new resources site!
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now.
>Numpy-discussion mailing list
>Numpy-discussion at lists.sourceforge.net

Thomas Grill
gr at grrrr.org
+43 699 19715543

More information about the NumPy-Discussion mailing list