Miniaudio
Open Source C API for Audio Playback & Capture
Free C Single file library that can be connected to multiple devices and provides support for playback, capture, full-duplex,& loopback on major desktop and mobile platforms
Miniaudio is a simple pure C single file audio playback and capture library that enables software apps to handle audio files in multiple ways. The great thing is that it is implemented as a single .H file; you just need to download it and be ready to go. The library fully supports low-level audio functionality and has no external dependencies.
The Miniaudio supports working on multiple platforms including Windows, macOS, Linux, iOS, Android, Web, etc. The library has included several important features such as playback, capturing audio files, full-duplex, connectivity to multiple devices, automatic data conversion, a set of useful filters, creation waveform, Noise generation, audio encoding, and decoding, support custom backend, channel conversion, and channel mapping, re-sampling support and many more.
Miniaudio is very flexible and provides ease of use for expert users as well as for beginners who are more interested in processing audio files. The library is open source and is available under the MIT license. The library is written in C but also can be compiled as C++, enabling it to work on almost all compilers.
Getting Started with Miniaudio
Please use the following command for a complete installation.
Install Miniaudio using GitHub
git clone https://github.com/mackron/miniaudio.git
Playback Sound via C API C
The open source library Miniaudio enables software developers to load and playback audio files inside their C applications. The library can be also used for recording purposes. When the apps send the request to the library to play the audio file, it uses the default playback device to playback the audio. The decoder is entirely decoupled from the device and can be used independently of it. The library also supports the playback of multiple files by simply loading multiple decoders and mixing them.
Audio Data Conversion via C
The Miniaudio library gives software apps the capability to convert audio data to sample formats, channel counts, and sample rates. The library provides simple functions that can be used to convert between two specific formats with ease. You can also easily set dithering to none, rectangle, and triangle using the ditherMode parameter. The library also included support for channel rearrangement and conversion from one channel to another.
Audio Data Capturing
The open source library Miniaudio has included support for capturing audio data from a microphone using the low-level API. The library starts to capture data from the default microphone until you press Enter button. Once complete the output can be saved to a file of your choice that can be specified on the command line. You can also specify the file format of your choice to store data.