BSNES includes a "Ruby" support library for offering common interfaces for audio, video, & input on different platforms.
For audio it supports PulseAudio (via either of its protocols), Open Sound System, OpenAL, Direct Sound, Wave Out, XAudio2, WASAPI, AO, ASIO, & ALSA.
For input it supports Carbon, Quartz, XLib, Windows, UDev, & SDL. Specifically for Joypads there's ports to SDL, XInput, UDev, I/OKit, & Direct Input. For keyboards there's Carbon, Quartz, raw input, & XLib.
1/2?