i've got the following problem: I want to create bindings for the bass library (http://www.un4seen.com/) in python and ran into the following problem: The library allows to create streams to files laying in memory. But the documentation just says that it requests a void *file pointer, nothing about the containing format, nothing. I tried several things, played around with ctypes, tried the following (using python 2.7 on a Windows 7 x64 machine):
import ctypes
data=open('my filename.wav').read()
pointer=ctypes.POINTER(data)
cdata=ctypes.c_char_p(data)
cpointer=ctypes.byref(cdata)
however, whatever I pass into my function, it causes a pythonic exception or bass returns an error because an illegal parameter type has been specified. You can find my programmed code at https://github.com/Timtam/Bass4Py That's where I want to pass a file into. Probably I want to make it as easy as possible, giving a string with the files content to the function and converting this string into a format I can give to bass so it will create the stream. But for now I stuck with the simple acceptance from bass and my pointer problem... It would be very nice if someone could read into my code and explain what to do, maybe someone has already used bass, maybe with python too? Of course I searched in here and tried search patterns like "passing string pointers with ctypes" and such things and tried everything I found, but I actually don't know what bass wants from me... Thank you in advance.