ton
While preparing to make tools for recording and playing back audio samples, I wanted to have a simple way to read data from and write data to a disk. Inspired by farbfeld, I decided to make an analogous format for audio, with a library for reading and writing the resulting data. The result is ton. Ton files have a short header followed by the audio data, which is stored interleaved as 32 bit floats. In many cases, this allows for data to be directly copied into a buffer that is written to disk. In cases with multiple stacked buffers, data can be copied interleaved into a buffer which is then written to a ton file, or multiple ton files can be written. The code for reading and writing is less than 100 lines, making it a very small dependency.