Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

tinyalsa/tinyalsa-cxx

Open more actions menu

Repository files navigation

tinyalsa-cxx

A paper-thin C++ library for interfacing with ALSA.

Examples

Reading information on a PCM:

tinyalsa::pcm pcm;

auto open_result = pcm.open_capture_device();
if (open_result.failed()) {
  std::cerr << open_result << std::endl;
  return;
}

std::cout << pcm.get_info();

Reading audio data from a PCM:

// This is a 16-bit integer stereo buffer.
unsigned short int frames[1024];
unsigned int frame_count = 2;

// Error checking omitted for brevity.
tinyalsa::interleaved_pcm_reader pcm_reader;
pcm_reader.open(); // Choose the device to open.
pcm_reader.setup(); // Apply hardware parameters
pcm_reader.prepare(); // Prepare the PCM to be started
pcm_reader.start(); // Begin recording
pcm_reader.read_unformatted(frames, frame_count); // Read recorded data

About

A pure C++14 ALSA library with no dependencies.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.