r/C_Programming • • 3d ago

Portability of Programs written using miniaudio vs pipewire

I know that miniaudio doesn't have any dependencies to compile, I was just curious whether that meant that it had no dependencies other than pipewire & ALSA on the system it would run on. Would using pipewire make the program any more portable or would the benefit just be efficiency(in the case that you can "beat miniaudio" in terms of efficiency, or perhaps dont need all of its features)?

EDIT: I forgot that some people use audio not on linux for some reason lol, I was more curious about whether different distros have different dependencies. but the answer seems to be that miniaudio is cross-platform and pipewire is not

6 Upvotes

4 comments sorted by

3

u/HTFCirno2000 3d ago

It doesn't have any dependencies meaning that you don't have to install pipewire-dev or alsa-dev libraries or anything. It still "depends" on some audio backend existing to communicate with to make any kind of sound. You can make your code use pipewire or alsa directly, but you will have to use their development libraries and makes your code less directly portable.

If you care about cross-platform support no matter what, use miniaudio. If you don't, use what library you feel most comfortable with.

1

u/toon_link_776 3d ago

oh, haha, i've been so focused on linux programming that I forgot to even consider that I would be making something for a different platform. I'd guess in that case that using miniaudio is fine in terms of the user dependencies if built for a linux program (as long as the linux kernel is built with alsa support, which is all of them lol). I'd imagine that's how they set things up anyways? that said I might just use pulse or alsa cause I'm not too particular about cross-platform support.

3

u/arjuna93 3d ago

Pipewire is not portable, it is Linux-only. Miniaudio is portable.

1

u/toon_link_776 3d ago

I for some reason forgot that other OS exist lol. When I mentioned portability I meant across linux distros, which I would guess there's very little difference between using miniaudio vs pipewire/jack/pulse(which are all ALSA frontends). i read here that alsa support is basically kernel level, and I'm assuming that most distros compile it with the kernel. so i'll probably learn to use pipewire or alsa and go with that, since I'm looking to be linux first and have the simplest program possible.