Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
audio_doctor_artifacts.hpp File Reference

JSON curve artifacts for the offline Audio Doctor. More...

#include "audio_spectrum.hpp"
#include <filesystem>
#include <string>
#include <string_view>

Go to the source code of this file.

Namespaces

namespace  pulp
namespace  pulp::test
namespace  pulp::test::audio

Functions

std::string pulp::test::audio::response_curve_to_json (const ResponseCurve &curve, std::string_view scenario)
 Serialize a magnitude/response curve to a JSON string.
std::string pulp::test::audio::thd_to_json (const ThdResult &thd, std::string_view scenario)
 Serialize a THD result to a JSON string (including the harmonic breakdown).
std::string pulp::test::audio::phase_curve_to_json (const PhaseCurve &curve, std::string_view scenario)
 Serialize a phase/group-delay curve to a JSON string.
std::filesystem::path pulp::test::audio::write_response_artifact (const ResponseCurve &curve, std::string_view scenario)
 Write response_curve_to_json to <temp>/pulp-audio-doctor/<sanitized-scenario>.response.json and return the path (overwriting any previous run's artifact for the same scenario).
std::filesystem::path pulp::test::audio::write_thd_artifact (const ThdResult &thd, std::string_view scenario)
 Write thd_to_json to <temp>/pulp-audio-doctor/<sanitized-scenario>.thd.json and return path.
std::filesystem::path pulp::test::audio::write_phase_artifact (const PhaseCurve &curve, std::string_view scenario)
 Write phase_curve_to_json to <temp>/pulp-audio-doctor/<sanitized-scenario>.groupdelay.json and return the path.

Variables

constexpr std::int64_t pulp::test::audio::kDoctorCurveSchemaVersion = 1
 Current Doctor-curve schema version.

Detailed Description

JSON curve artifacts for the offline Audio Doctor.

The Doctor's response/THD curves are its reviewable outputs: a human, CI, or future AI tool can read a stable JSON document instead of re-running the analysis. Each artifact carries a schema_version, the analyzer name, the Analyzer Determinism Contract fields (window, length, stimulus, sample rate — so a reader can reproduce or judge the measurement), and the curve points. Serialized via choc::value + choc::json (CHOC-first policy), matching the audio_artifacts.cpp style.

Layering: this serializes the buffer-level analyzers' result structs, so it includes audio_spectrum.hpp (the FFT-bearing analysis core). It lives in the tool-only pulp-audio-analysis lib and must never be linked into a runtime/plugin build.