NI Media is a library for reading from / writing to audio streams developed at Native Instruments.
The goal is to have a modern C++ library for dealing with audio streams in an idiomatic C++ style.
Modern:
- a clear separation of concerns (modular instead of fat classes)
- support for ranges and iterators
Idiomatic:
- based on std.streams.
- integrates well with STL algorithms and boost
The following example demonstrates how to stream an entire audio file into a vector:
#include <ni/media/audio/ifstream.h>
#include <vector>
int main()
{
auto stream = audio::ifstream("hello.wav");
auto samples = std::vector<float>(stream.info().num_samples());
stream >> samples;
// use samples
}
Currently the library consists of the following components:
- audiostream: the main library for reading from / writing to audio streams.
- pcm: a small library to convert pcm data from / to arithmetic types.