[Numpy-discussion] casting in numarray

Thomas Grill gr at grrrr.org
Thu Mar 17 12:46:14 CST 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
http://cvs.sourceforge.net/viewcvs.py/pure-data/externals/grill/py/source/
files pybuffer.h and pybuffer.cpp

best greetings,
Thomas

Joachim Boomberschloss schrieb:

>Hi,
>
>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?
>
>Thanks,
>
>Joe
>
>
>		
>__________________________________ 
>Do you Yahoo!? 
>Yahoo! Small Business - Try our new resources site!
>http://smallbusiness.yahoo.com/resources/ 
>
>
>-------------------------------------------------------
>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.
>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>_______________________________________________
>Numpy-discussion mailing list
>Numpy-discussion at lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>
>  
>

-- 
--->----->->----->--
Thomas Grill
gr at grrrr.org
+43 699 19715543





More information about the Numpy-discussion mailing list