KFR 7 has been released

14 November 2025

KFR 7 is out with a new audio module for reading and writing WAV, AIFF, FLAC, MP3 and ALAC files, universal binaries for macOS, RISC-V support, a modernized C++20 codebase and a number of breaking changes that are worth checking before you upgrade.

Audio module

KFR 7 introduces the audio module. The audio_data class gives one interface for both interleaved and planar audio. It can either own its memory or wrap user-supplied pointers without copying (zero-copy).

Files are handled by audio_encoder and audio_decoder, which support:

  • Wave, AIFF, FLAC and MP3 (via minimp3)
  • Apple ALAC and CAF containers
  • RF64/BW64 containers. Wave files switch to RF64 automatically once they exceed 4 GB
  • Format detection from the file header or the file extension
  • Media Foundation decoding on Windows

For most cases encode_audio_file and decode_audio_file are all you need. The older audio_reader and audio_writer are deprecated.

Platforms

  • macOS universal binaries available
  • RISC-V support, including prebuilt binaries and a toolchain for riscv64-linux-gnu

Math and expressions

  • elliptic designs elliptic filters from ripple parameters, following SciPy semantics
  • filtfilt performs zero-phase forward-backward IIR filtering
  • scoped_flush_denormals enables flush-to-zero on x86 and ARM for the duration of a scope
  • strided_channel lets expressions read and write strided data
  • The reverse expression is now writable

Build system

CMake 3.16 is now the minimum version. The configuration was refactored into separate targets with clear public and private dependencies, and C++20 is handled through the cxx_std_20 feature. KFR_USE_BOOST_MATH is on by default for elliptic filters, and KFR_USE_BOOST lets you use an existing Boost installation instead.

Upgrading from KFR 6

KFR 7 contains breaking changes. Most of them are renames, so a search and replace covers the bulk of the work:

  • CMT_ and TESTO_ macros are now KFR_
  • The cometa namespace is merged into kfr. cometa.hpp becomes meta.hpp, and kfr/cometa/* becomes kfr/meta/*
  • kfr/testo/*.hpp becomes kfr/test/*.hpp
  • intrinsics namespace is renamed to intr
  • Speaker becomes speaker_type and SpeakerArrangement becomes speaker_arrangement
  • convert_endianess becomes convert_endianness
  • Several classes and functions no longer take a template parameter and default to double, for example zpk, bessel and butterworth
  • KFR_ACCEPT_EXPRESSIONS is removed. Use the expression_argument and expression_arguments concepts instead
  • identity is removed. Use std::type_identity_t
  • 8-bit sample support is removed
  • CMT_NOEXCEPT is removed. Use noexcept
  • from_lambda is required when constructing a vec from a lambda generator

See the changelog for the complete list.

KFR 7.0.1

The first patch release adds variance and stddev functions. The audio, IO and DSP modules can now be disabled at build time with KFR_ENABLE_AUDIO, KFR_ENABLE_IO and KFR_ENABLE_DSP, all on by default. It also includes C++23 compatibility fixes and a fix for extend(vec) with compound vectors. The documentation moved to mkdocs with cxxdox 2.

See the documentation for the updated guides and examples.