libsndfile is a widely used C library written by Erik de Castro Lopo for reading and writing audio files. It supports a wide variety of audio file formats and will convert automatically from one to another. It allows the programmer to ignore many details, such as endianness.