Test program that plays whatever is fed from STDIN to the device specified in `argv[1]`: https://reviews.freebsd.org/P642
It can be very easily modified to support recording as well, by specifying the `AUDIO_REC` flag in `audio_open()`. Similarly, `AUDIO_NBIO` will enable non-blocking IO (but you also need to call poll(2) before calling `audio_read()`/`audio_write()`. And the same is for MIDI; call `midi_open()`, and then `midi_read()`/`midi_write()`.