thestk / rtaudio

A set of C++ classes that provide a common API for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound, ASIO, and WASAPI) operating systems.
Other
1.5k stars 319 forks source link

No C API like RtMidi has? #64

Closed 0joshuaolson1 closed 7 years ago

0joshuaolson1 commented 8 years ago

RtMidi mentions one, but RtAudio's release.txt doesn't.

radarsat1 commented 8 years ago

It's something someone contributed, there has been no similar contribution for RtMidi. Feel free to propose ;)

0joshuaolson1 commented 8 years ago

It's RtMidi that apparently has one, but I'll keep that in mind if libsoundio doesn't work out for me!

radarsat1 commented 8 years ago

Sorry, yeah meant to say RtAudio there !

zserge commented 7 years ago

I've started making a C wrapper as a part of my sweet dream to make C+Golang bindings for all three libraries (RtAudio, PortAudio, libsoundio) that would be easy to use. So I've made a C wrapper for RtAudio and amalgamated PortAudio and libsoundio.

Here are the RtAudio wrappers:

I would be thankful is someone could review it and give some feedback.

ghost commented 7 years ago

@zserge Looks great! Personally, I don't like typedef'ing the pointer and the usage of POSIX suffix _t in the type names. But that's just me. You should definitely submit a PR.

zserge commented 7 years ago

@tay10r I hear you, and I normally don't prefer it either, but this was primarily done for Go bindings, and it looks a bit cleaner for me to write C.rtaudio_device_info_t than C.struct_rtaudio_device_info, especially in a language where long line wrapping is not a norm.

ghost commented 7 years ago

@zserge Gotcha, that makes sense. Are you going to submit a PR for this?

zserge commented 7 years ago

@tay10r Yes, I'm right now working on naivesound/audio library and once I'm confident with my rtaudio/rtmidi bindings (there are a few mislooked points in that, too) - I will make PRs to both.

In fact, on a broader topic - is anyone interested in Go bindings for this? Technically, as the library is only 2 files + 2 C wrapper files, the Go bindings would add one more .go file to this and people would be able to use it in Go by adding just one import line. It's mostly straightforward and probably I would be happier to put my Go bindings into this official repo rather than keep a separate repo and copy RtAudio sources regularly into it.

Same applies to RtMidi.

zserge commented 7 years ago

@tay10r I've made a pull request #98 for C API wrappers. If you give me a green light - I can also make a pull request for Go API wrapper. That hopefully could make this nice little library a bit more popular among modern developers, comparing to the bloated portaudio. I see there are some Python bindings in the repo, so I hope adding Go wrapper should not be a problem for the maintainers.

ghost commented 7 years ago

@zserge I'm not one of the maintainers, but hopefully they'll get around to viewing the PR.

radarsat1 commented 7 years ago

Hi guys, don't have time atm but keep working, I'll take a look at the PR as soon as I get a chance. Mostly leaving the C API up to people who are motivated, so go for it, I'll merge without too much argument ;)

radarsat1 commented 7 years ago

Closed in #98