OpenAL/ALUT - Loading wav files - openal

I'm using the following function:
_alutLoadWAVMemory_((ALbyte *)myBuf,&format, &data, &size, &freq, &loop);
I have 2 questions:
I've read online that the function is deprecated, does anyone know why? More important - what should I use instead?
Is the variable format assigned with data regarding the format after I call _alutLoadWAVMemory_?
Thanks a lot!

There are a few candidates for functions to use instead, see the Alut documentation on loading. I think the closest equivalent to LoadWAVMemory would be 'alutCreateBufferFromFileImage'.

Related

Can't find implementation of gtk_menu_shell_get_type (gtk)

Can somebody tell me, how i can see implementation of gtk_menu_shell_get_type function and other common ..._get_type functions in gtk3? According to this documentation gtk+2.0-directfb i can see implementation of this, but there is no any info about it in gtk3. I've downloaded its one of the sources and only can see:
1. gtkmenushell.h:
define GTK_TYPE_MENU_SHELL (gtk_menu_shell_get_type ())
...
GDK_AVAILABLE_IN_ALL GType gtk_menu_shell_get_type (void) G_GNUC_CONST;
...
2. gtktypefuncs.c:
*tp++ = gtk_menu_shell_get_type();
I've spent a few days with this problem and can't understand, how can i get the implementation of this function, to see it realization clearly.
In other sources I've met there's no any "c" file with this function, only header. How can i see implementation of it and others like this ..._get_type function? Does anybody know this subtlety?
Thanks.
gtk_menu_shell_get_type function is defined in gtkmenushell.c. It's not declared directly. Instead, macro G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE is used to declare it.
See example for G_DEFINE_TYPE_EXTENDED.

where do I find reference for linalg.get_lapack_funcs('geqrf')

I looked up on scipy manual,
https://docs.scipy.org/doc/scipy/reference/genindex.html#G
but don't see this 'gearf' function anywhere.
Does any one recognize it and can provide documentation for it?
Perhaps it is not just geqrf but dgeqrf or sgeqrf or cgeqrf or zgeqrf?
Look at the Scipy examples here to see how they use get_lapack_funcs() without specifying the type.
If you want to access directly to the LAPACK routine then it is accesible via
scipy.linalg.lapack.sgeqtrf
scipy.linalg.lapack.dgeqtrf
scipy.linalg.lapack.cgeqtrf
scipy.linalg.lapack.zgeqtrf
or you can use what Antimony suggested.
But this is already wrapped via scipy.linalg.qr. If you set pivoting to True, ?geqr3 is used and otherwise ?geqrf is used in the background.

How to modify a AVAudioPCMBuffer in swift

does anybody know how to modify the buffer contents of
an AVAudioPCMBuffer object? I want to do the following:
load an audio file into an AVAudioPCMBuffer - this works.
modify the samples data of the AVAudioPCMBuffer. - here i stuck
write the AVAudioPCMBuffer to a file - this also works.
as in the documentation layed out, the AVAudioPCMBuffer.floatChannelData
is unfortunately read-only. Also the itAudio.audioBufferList.memory.mBuffers.mData seems to be read-only.
the compiler shows: cannot assign through subscript: subscript is get-only. currently i am using the audiotoolbox, which works fine for my
purposes. nevertheless i would like to ask if anybody knows the (best practice) way for doing this job?
thanks a lot for any help!!!

Using boost's socket.async_send_to()

I've been stuck on this for a while now. I am trying to send the following:
boost::shared_ptr<uint8_t[]> m_data
over the wire using:
_socket.async_send_to(boost::asio::buffer(m_data), m_remote_endpoint,
boost::bind(&UDPServer::handle_send, this, message,
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred));
I get the error "no instance of overloaded function boost::asio::buffer matches the argument list boost::shared_ptr<uint8_t[]>"
m_data is filled in another function.
I suspect this is because I actually have to use the key word new on m_data. But I can't quite figure out how to do it. I've tried a few different variations. Can anybody offer me some insight here? This is probably more a question of how to dereference a shared pointer then anything. Thanks in advance!
boost::asio::buffer has an impressive lists of consttructors, but neither of them takes shared_ptr<[]> (possibly an oversight form lib authors).
In your case, you simply need to derefence shared ptr, for example, by calling get on it.

How to use UIGetScreenImage

I would like to be able to do a real time analysis of the image taken by the camera.
I've seen that we are now allowed to use the undocumented UIGetScreenImage function.
However, I do not succeed to use it, I have the following warning:
implicit declaration of function 'UIGetScreenImage'
any idea to solve this?
Thanks in advance!
regards,
You need to put a prototype
CGImageRef UIGetScreenImage(void);
in your source code (or some common headers).
Note that you need to CGImageRelease the result of UIGetScreenImage even it is a "Get" function.