I’ve been playing around around with a C library called aubio. It’s a library for analyzing audio (pitch, tempo and onset detection etc.) and modifying. I eventually want to build my own karaoke app in Zig. Based on the number of github stars, it seems like a high quality library, so I thought bindings to aubio could be useful for other users, too.
However, when attempting to write bindings, I stumbled upon the following construct:
Now I can of course mass replace the integer types and use c_int/c_char instead, and then use translate-c. However, this approach does not work for the floating point types.
Is there an idiomatic way to write bindings while making it possible to compile for different floating point sizes?