Implement parity for audio between C and Lua APIs

Per this thread, there are some discrepancies in features between the Lua and C APIs as it pertains to the audio subsystem.

There may be other cases where differences exist, but the user is particularly interested in these:

Ideally, the C version of the callback functions would be changed to accept a void *context argument like playdate->sound->addSource(), although this comes with the caveat in that it would cause existing programs to fail to compile. This approach will keep the API from getting bloated with afterthoughts.

The bloated-afterthought alternatives include either making a setFoobarCallbackEx() variant of each function that does accept a userdata argument, or implementing setUserData(SoundSource *) and getUserData(SoundSource *) functions within playdate->sound.

3 Likes