PortAudio is MIT-licensed[0] and seems like a decent example of the primitives you need for audio.
Broadly low-level audio APIs are divided into 2 categories:
1. Callback-based - every time the underlying system has a new block of audio available and/or needs to be supplied with a new block, it calls your callback, which reads input data, does whatever processing you want, and writes output data
2. Stream-based - Inputs and Outputs are represented by streams. You can read from the input stream to record and write to the output stream to play back.
Both types of API can be used for low-latency audio, but you generally introduce a buffer of latency when you need to convert between them.
Portaudio lets applications choose which API they want to use.
[0]http://www.portaudio.com/license.html