mackron / miniaudio

Audio playback and capture library written in C, in a single source file.
https://miniaud.io
Other
4.07k stars 361 forks source link

miniaudio just doesn't work #746

Closed 7ombie closed 1 year ago

7ombie commented 1 year ago

I copied the first example from the docs (Introduction - Low-Level API), and got the following error:

$ make
cc src/main.c -o demo
src/main.c:20:32: error: use of undeclared identifier 'pMyCustomData'
    config.pUserData         = pMyCustomData;   // Can be accessed from the device object (device.pUserData).
                               ^
1 error generated.
make: *** [demo] Error 1

I tried to report that issue, and was instructed to run the simple_playback_sine.c example first. I tried that. It compiles, but doesn't play anything:

Device Name: NULL Playback Device
Press Enter to quit...

This is after I gave up trying to use raylib's AudioStream, which also doesn't work, probably because it's based on miniaudio, and that's not working.

I'm on an ARM Mac, which I assume has something to do with it.

mackron commented 1 year ago

It's because miniaudio uses runtime linking which Apple doesn't like. It's failing to load the necessary shared objects which is then resulting in miniaudio falling back to the null backend. Use MA_NO_RUNTIME_LINKING. More info in section 2.2 of the documentation: https://miniaud.io/docs/manual/index.html#Building

7ombie commented 1 year ago

Thank you, @mackron. That was it.

Sorry for the attitude I took with this issue. I was just super frustrated before I even tried using miniaudio, and yeah. Anyway, sorry. All the best, and thanks again.