Tabula Sonora 0.1.0
A native C++20 implementation of the Roland Sound Canvas VA synth voice
Loading...
Searching...
No Matches
ts::wav Namespace Reference

Writes 16-bit stereo PCM WAV files. More...

Functions

void write (const std::filesystem::path &path, std::span< const float > left, std::span< const float > right, int sample_rate=32000)
 Writes a stereo render to a RIFF/WAVE file at the given sample rate.

Detailed Description

Writes 16-bit stereo PCM WAV files.

The engine renders in float; this is the one place it is quantised, and it is deliberately the last thing that happens. Samples are clamped rather than allowed to wrap, because a wrapped sample is not a loud sample – it is a click at the opposite polarity.

Function Documentation

◆ write()

void ts::wav::write ( const std::filesystem::path & path,
std::span< const float > left,
std::span< const float > right,
int sample_rate = 32000 )

Writes a stereo render to a RIFF/WAVE file at the given sample rate.

Throws std::runtime_error if the file cannot be written or the channels differ in length.