Add forced 24-bit output (int24) for the delivered samples
build / windows (push) Has been cancelled
build / release (push) Has been cancelled

This commit is contained in:
TheM14 committed 2026-10-14 17:34:29 +08:00
1 parent ce3de51f8f
commit 5c3083b11c
12 files changed
+299 -57

No files matched your search

+64 -13
View File
@@ -354,14 +354,22 @@ public:
channels = layout_channels != 0 ? layout_channels : 6;
render = "speaker " + settings.speaker_layout;
}
// The custom field and the log line state the delivery format, because it
// is the one thing about the output that a listener cannot hear.
if (settings.force_int24) render += ", 24-bit delivery";
info.info_set("codec", "E-AC-3 JOC");
info.info_set("codec_long", "E-AC-3 JOC (Dolby Atmos)");
info.info_set("encoding", "lossy");
info.info_set_int("samplerate", kSampleRate);
info.info_set_int("channels", channels);
info.info_set_int("bitspersample", 32);
info.info_set("bitspersample_extra", "floating-point");
// What the component hands over, which is what the host keeps if it writes a
// file from this stream: float32 by default, int24 when forced. This is also
// what foobar2000's own lossless-conversion warning reads
// (SDK file_info.cpp:is_encoding_float), so it has to use the SDK's convention:
// 32 bits with "floating-point", or a bit depth that is fixed-point by
// definition (anything but 32/64, with no extra field at all).
info.info_set_bitspersample(settings.force_int24 ? 24u : 32u, !settings.force_int24);
info.set_length(duration);
m_length = duration;
// The renderer keeps its room tail, but the stream this component hands over
@@ -455,8 +463,15 @@ public:
m_frames_delivered = 0;
m_reported = false;
m_delivery_mismatches = 0;
joc_log::line("decoder: engine ready, %u output channel(s), %u frames per read",
m_channels, static_cast<unsigned>(kRunFrames));
// The clip total belongs to the file rather than to one run of it, so a seek
// does not clear it: the log line at the end of the stream is a statement
// about everything this component handed over.
m_clipped_samples = 0;
m_clip_reported = false;
joc_log::line("decoder: engine ready, %u output channel(s), %u frames per read, "
"delivery=%s",
m_channels, static_cast<unsigned>(kRunFrames),
m_settings.force_int24 ? "int24" : "float32");
}
bool decode_run(audio_chunk& chunk, abort_callback& abort) {
@@ -472,6 +487,10 @@ public:
static_cast<unsigned long long>(m_frames_delivered),
m_delivery_mismatches == 0 ? ""
: " (the delivery changed samples)");
if (m_clipped_samples != 0) {
joc_log::line("decoder: forced int24 truncated %llu sample(s) in total",
static_cast<unsigned long long>(m_clipped_samples));
}
return false;
}
@@ -479,30 +498,58 @@ public:
// 32-bit builds and double on 64-bit ones (SDK audio_math.h): the samples are
// converted, not copied. set_data_32() is the SDK's conversion for a float32
// source, and it sets the channel count, the sample rate and the sample count.
chunk.set_data_32(m_buffer.data(), frames, m_channels, kSampleRate);
//
// A forced int24 delivery goes the other way: the samples are packed to the
// core's int24 bytes and the host converts them back, so the audio the rest of
// the pipeline sees is the 24-bit grid rather than the renderer's float -- which
// is the whole point of the option. The quantisation happens here and nowhere
// else, so a sample is rounded once.
double expected_delivered_peak = 0.0;
if (m_settings.force_int24) {
m_int24.resize(frames * m_channels * 3);
const joc_decode::Int24Block block = joc_decode::pack_int24(
m_buffer.data(), frames * m_channels, m_int24.data());
m_clipped_samples += block.clipped;
if (block.clipped != 0 && !m_clip_reported) {
m_clip_reported = true;
joc_log::line("decoder: forced int24: %llu sample(s) outside [-1,1] in this "
"block are truncated to the edge (the core's clip policy; "
"attenuate with the gain setting to avoid it)",
static_cast<unsigned long long>(block.clipped));
}
chunk.set_data_fixedpoint_signed(m_int24.data(), m_int24.size(), kSampleRate,
m_channels, 24,
audio_chunk::g_guess_channel_config(m_channels));
expected_delivered_peak =
static_cast<double>(block.peak) / joc_decode::kInt24ImportScale;
} else {
chunk.set_data_32(m_buffer.data(), frames, m_channels, kSampleRate);
expected_delivered_peak = peak_of(m_buffer.data(), frames * m_channels);
}
m_frames_delivered += frames;
// A delivery that mangled the samples would be heard as noise rather than reported
// as a failure, so every chunk is checked: the conversion is exact, and the peak of
// what the chunk holds has to equal the peak of what the renderer produced.
const double produced = peak_of(m_buffer.data(), frames * m_channels);
// what the chunk holds has to equal the peak of what the renderer produced -- or,
// for int24, the peak the packing step actually wrote.
const double delivered =
peak_of(chunk.get_data(), chunk.get_sample_count() * chunk.get_channels());
if (delivered > produced + 1e-6 + produced * 1e-6 ||
delivered < produced - 1e-6 - produced * 1e-6) {
if (delivered > expected_delivered_peak + 1e-6 + expected_delivered_peak * 1e-6 ||
delivered < expected_delivered_peak - 1e-6 - expected_delivered_peak * 1e-6) {
++m_delivery_mismatches;
if (m_delivery_mismatches == 1) {
joc_log::line("decoder: delivery changed the samples: peak %.9f produced, "
"%.9f delivered",
produced, delivered);
expected_delivered_peak, delivered);
}
}
if (!m_reported) {
m_reported = true;
joc_log::line("decoder: first %llu frames delivered (%u ch), peak %.6f, "
joc_log::line("decoder: first %llu frames delivered (%u ch, %s), peak %.6f, "
"delivered peak %.6f",
static_cast<unsigned long long>(frames), m_channels, produced,
delivered);
static_cast<unsigned long long>(frames), m_channels,
m_settings.force_int24 ? "int24" : "float32",
peak_of(m_buffer.data(), frames * m_channels), delivered);
}
return true;
}
@@ -605,6 +652,10 @@ private:
unsigned m_audio_index = 0;
joc_container::Result m_container;
std::vector<float> m_buffer;
// int24 delivery: the packed bytes handed to the host, and what the clip caught.
std::vector<std::uint8_t> m_int24;
std::uint64_t m_clipped_samples = 0;
bool m_clip_reported = false;
unsigned m_channels = 2;
std::uint64_t m_frames_delivered = 0;
bool m_reported = false;
+40
View File
@@ -6,6 +6,7 @@
#include <cstdio>
#include <cstring>
#include <cwchar>
#include <limits>
#include <vector>
// The kernel copy that is compiled into this component; see kernel/.
@@ -309,6 +310,45 @@ unsigned speaker_channels(const std::string& layout) {
return 0;
}
namespace {
// The core's conversion, reproduced: kernel/src/io/wav_writer.cpp:to_int32.
// (min)() is written that way because the test tools compile this file without
// NOMINMAX, and windows.h's min macro would otherwise swallow the call.
std::int32_t to_int32(const float value) {
if (!std::isfinite(value)) {
return (std::numeric_limits<std::int32_t>::min)();
}
return static_cast<std::int32_t>(value);
}
} // namespace
Int24Block pack_int24(const float* interleaved, std::size_t count, std::uint8_t* out) {
Int24Block block;
for (std::size_t i = 0; i < count; ++i) {
float value = interleaved[i];
if (value > 1.0f) {
value = 1.0f;
++block.clipped;
} else if (value < -1.0f) {
value = -1.0f;
++block.clipped;
}
const std::int32_t scaled = to_int32(value * 8388607.0f);
const std::uint32_t bits = static_cast<std::uint32_t>(scaled);
out[i * 3 + 0] = static_cast<std::uint8_t>(bits & 0xFFu);
out[i * 3 + 1] = static_cast<std::uint8_t>((bits >> 8) & 0xFFu);
out[i * 3 + 2] = static_cast<std::uint8_t>((bits >> 16) & 0xFFu);
// What the host will read back is the sign-extended low 24 bits.
std::int32_t written = static_cast<std::int32_t>(bits & 0xFFFFFFu);
if ((written & 0x800000) != 0) written -= 0x1000000;
const std::int32_t magnitude = (written < 0) ? -written : written;
if (magnitude > block.peak) block.peak = magnitude;
}
return block;
}
std::string component_directory() {
HMODULE self = nullptr;
if (GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
+31
View File
@@ -96,6 +96,15 @@ struct Settings {
// is what the reference CLI's --duration does. Zero means "the whole file".
// Only the comparison harness sets it; playback leaves it at zero.
std::uint64_t input_frame_limit = 0;
// Deliver 24-bit fixed-point PCM instead of float32. The renderer itself is
// always float32 and this does not change it: the flag says how the *caller*
// hands the samples on, and the quantisation happens once, where the format is
// decided (see pack_int24 below). It exists because the streaming interface
// has no int24 output -- the core's int24 rule lives in its file-writing path
// (kernel/src/io/wav_writer.cpp), which the component cannot reach, so the
// rule is reproduced here instead. Out-of-range samples follow the core's
// JOC_CLIP_CONTINUE policy: truncated to the edge, and reported.
bool force_int24 = false;
};
// Channel count of a named layout, or 0 when the layout is not one of the
@@ -139,6 +148,28 @@ FileProbe probe_file(const std::string& path, std::size_t max_scan_bytes = 0,
bool probe_container_joc(const std::string& ffmpeg_path, const std::string& path,
unsigned audio_index, bool* joc, std::string* detail);
// ---- forced int24 delivery ------------------------------------------------
//
// The core's own int24 rule, reproduced byte for byte from
// kernel/src/io/wav_writer.cpp: clip to [-1, 1], multiply by 8388607, truncate
// toward zero (the core's comment: the int32 conversion is "identical to NumPy's
// float32 -> int32 cast after clipping"), write the low three bytes, little
// endian; a non-finite sample becomes 0, exactly as the core writes it.
//
// Sample values that have been through this are what foobar2000's int24 import
// gives back, i.e. n / 2^23 (SDK/pfc audio_math.cpp:_import24). That is the scale
// a caller should use when it wants to check what the host received.
constexpr double kInt24ImportScale = 8388608.0;
struct Int24Block {
std::size_t clipped = 0; // samples that were outside [-1, 1]
std::int32_t peak = 0; // largest magnitude actually written
};
// Packs `count` interleaved float32 samples into `out`, which must hold
// count * 3 bytes, and reports what the clip caught.
Int24Block pack_int24(const float* interleaved, std::size_t count, std::uint8_t* out);
class Engine {
public:
Engine();
+18 -1
View File
@@ -214,7 +214,7 @@ private:
notify();
return TRUE;
}
if (id == IDC_CHECK_GAIN) {
if (id == IDC_CHECK_GAIN || id == IDC_CHECK_INT24) {
update_enabled_state();
notify();
return TRUE;
@@ -301,6 +301,8 @@ private:
SendMessageW(GetDlgItem(m_hwnd, IDC_CHECK_GAIN), BM_SETCHECK,
values.gain_enabled ? BST_CHECKED : BST_UNCHECKED, 0);
SendMessageW(GetDlgItem(m_hwnd, IDC_CHECK_INT24), BM_SETCHECK,
values.force_int24 ? BST_CHECKED : BST_UNCHECKED, 0);
update_enabled_state();
}
@@ -328,6 +330,8 @@ private:
values.gain_db = std::atof(get_text(GetDlgItem(m_hwnd, IDC_EDIT_GAIN)).c_str());
values.gain_enabled =
IsDlgButtonChecked(m_hwnd, IDC_CHECK_GAIN) == BST_CHECKED;
values.force_int24 =
IsDlgButtonChecked(m_hwnd, IDC_CHECK_INT24) == BST_CHECKED;
// Advanced values are not on this page; keep whatever is stored.
const joc_settings::Values stored = joc_settings::read();
values.object_delay_samples = stored.object_delay_samples;
@@ -354,6 +358,18 @@ private:
}
set_text(GetDlgItem(m_hwnd, IDC_LABEL_OUTPUT_STATUS), output_status);
// The hint says what the switch does and what the other state means: the
// renderer is float32 either way, so "24bit" is about the delivery, and
// that is not something a checkbox label can carry on its own. The second
// half matters because this switch changes what the component *reports*
// about a file, and foobar2000 caches that per file: an item whose
// information was read before the switch was flipped keeps the old format
// until it is reloaded.
set_text(GetDlgItem(m_hwnd, IDC_LABEL_INT24_HINT),
values.force_int24
? "开启:量化到 int24,超出 ±1 截断;切换后需刷新文件信息"
: "关闭:按 32 位浮点交付(默认)");
joc_decode::Settings effective = joc_settings::current();
effective.hrtf_source =
static_cast<joc_decode::HrtfSource>(values.hrtf_source);
@@ -383,6 +399,7 @@ private:
if (now.hrtf_file != m_initial.hrtf_file) return true;
if (now.binaural_mode != m_initial.binaural_mode) return true;
if (now.gain_enabled != m_initial.gain_enabled) return true;
if (now.force_int24 != m_initial.force_int24) return true;
if (now.gain_db != m_initial.gain_db) return true;
if (now.tail_seconds != m_initial.tail_seconds) return true;
if (now.ffmpeg_path != m_initial.ffmpeg_path) return true;
+23 -20
View File
@@ -7,11 +7,11 @@
// sample page uses (SDK\foobar2000\foo_sample\foo_sample.rc). A CAPTION statement
// implies WS_CAPTION, which would draw a second frame inside the host's and shift
// every control down by the caption height -- visible but not clickable.
IDD_JOC_PREFS DIALOGEX 0, 0, 330, 273
IDD_JOC_PREFS DIALOGEX 0, 0, 330, 299
STYLE DS_SETFONT | WS_CHILD
FONT 8, "Microsoft Sans Serif", 400, 0, 0x0
BEGIN
GROUPBOX "输出", IDC_GROUP_OUTPUT, 7, 5, 316, 61
GROUPBOX "输出", IDC_GROUP_OUTPUT, 7, 5, 316, 86
CONTROL "双耳(HRTF)", IDC_RADIO_BINAURAL, "Button",
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 16, 20, 72, 10
CONTROL "扬声器布局", IDC_RADIO_SPEAKER, "Button",
@@ -25,30 +25,33 @@ BEGIN
LTEXT "房间尾音(秒)", IDC_LABEL_TAIL, 172, 41, 62, 10
EDITTEXT IDC_EDIT_TAIL, 238, 38, 40, 13, ES_AUTOHSCROLL
LTEXT "", IDC_LABEL_OUTPUT_STATUS, 16, 52, 300, 10
CONTROL "强制 24bit 输出(int24)", IDC_CHECK_INT24, "Button",
BS_AUTOCHECKBOX | WS_TABSTOP, 16, 64, 116, 10
LTEXT "", IDC_LABEL_INT24_HINT, 16, 76, 300, 10
GROUPBOX "HRTF", IDC_GROUP_HRTF, 7, 71, 316, 100
GROUPBOX "HRTF", IDC_GROUP_HRTF, 7, 97, 316, 100
CONTROL "SOFA 文件", IDC_RADIO_HRTF_SOFA, "Button",
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 16, 86, 56, 10
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP, 16, 112, 56, 10
CONTROL "Rosella 个性化模型", IDC_RADIO_HRTF_ROSELLA, "Button",
BS_AUTORADIOBUTTON | WS_TABSTOP, 78, 86, 78, 10
LTEXT "HRTF 文件(留空=默认位置)", IDC_LABEL_HRTF, 16, 105, 106, 10
EDITTEXT IDC_EDIT_HRTF, 126, 102, 148, 13, ES_AUTOHSCROLL
PUSHBUTTON "浏览…", IDC_BROWSE_HRTF, 279, 102, 38, 13
BS_AUTORADIOBUTTON | WS_TABSTOP, 78, 112, 78, 10
LTEXT "HRTF 文件(留空=默认位置)", IDC_LABEL_HRTF, 16, 131, 106, 10
EDITTEXT IDC_EDIT_HRTF, 126, 128, 148, 13, ES_AUTOHSCROLL
PUSHBUTTON "浏览…", IDC_BROWSE_HRTF, 279, 128, 38, 13
LTEXT "留空时读组件目录下 HRTF\\binaural.sofa 或 binaural.personalized_headphone;SOFA 由渲染器内部编译,滤波组表已编入库中。",
IDC_LABEL_HRTF_HINT, 16, 121, 300, 20
LTEXT "", IDC_LABEL_STATUS, 16, 145, 300, 20
IDC_LABEL_HRTF_HINT, 16, 147, 300, 20
LTEXT "", IDC_LABEL_STATUS, 16, 171, 300, 20
GROUPBOX "增益", IDC_GROUP_GAIN, 7, 176, 316, 48
GROUPBOX "增益", IDC_GROUP_GAIN, 7, 202, 316, 48
CONTROL "应用增益", IDC_CHECK_GAIN, "Button",
BS_AUTOCHECKBOX | WS_TABSTOP, 16, 192, 58, 10
LTEXT "dB", IDC_LABEL_GAIN, 80, 192, 12, 10
EDITTEXT IDC_EDIT_GAIN, 96, 189, 40, 13, ES_AUTOHSCROLL
LTEXT "", IDC_LABEL_GAIN_STATUS, 145, 192, 171, 10
BS_AUTOCHECKBOX | WS_TABSTOP, 16, 218, 58, 10
LTEXT "dB", IDC_LABEL_GAIN, 80, 218, 12, 10
EDITTEXT IDC_EDIT_GAIN, 96, 215, 40, 13, ES_AUTOHSCROLL
LTEXT "", IDC_LABEL_GAIN_STATUS, 145, 218, 171, 10
LTEXT "双耳渲染后可能超过 0 dBFS,可用负值衰减。",
IDC_LABEL_GAIN_HINT, 16, 208, 300, 10
IDC_LABEL_GAIN_HINT, 16, 234, 300, 10
GROUPBOX "其它", IDC_GROUP_MISC, 7, 229, 316, 38
LTEXT "ffmpeg.exe", IDC_LABEL_FFMPEG, 16, 245, 44, 10
EDITTEXT IDC_EDIT_FFMPEG, 64, 242, 210, 13, ES_AUTOHSCROLL
PUSHBUTTON "浏览…", IDC_BROWSE_FFMPEG, 279, 242, 38, 13
GROUPBOX "其它", IDC_GROUP_MISC, 7, 255, 316, 38
LTEXT "ffmpeg.exe", IDC_LABEL_FFMPEG, 16, 271, 44, 10
EDITTEXT IDC_EDIT_FFMPEG, 64, 268, 210, 13, ES_AUTOHSCROLL
PUSHBUTTON "浏览…", IDC_BROWSE_FFMPEG, 279, 268, 38, 13
END
+3
View File
@@ -13,6 +13,9 @@
#define IDC_LABEL_TAIL 2017
#define IDC_EDIT_TAIL 2018
#define IDC_LABEL_OUTPUT_STATUS 2019
// Delivery format, in the same group: what the decoder hands to foobar2000.
#define IDC_CHECK_INT24 2050
#define IDC_LABEL_INT24_HINT 2051
#define IDC_GROUP_HRTF 2020
#define IDC_RADIO_HRTF_SOFA 2021
+23
View File
@@ -6,6 +6,7 @@
#include <windows.h>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
@@ -27,6 +28,7 @@ constexpr GUID kGuidBinauralMode = {0x1a57c9e4, 0x83b6, 0x42f1, {0x9c, 0x50, 0x2
constexpr GUID kGuidGainEnabled = {0x74b1e5c8, 0x2a39, 0x4d16, {0x8f, 0x62, 0x0d, 0x51, 0xb7, 0x3c, 0x9a, 0x28}};
constexpr GUID kGuidGain = {0x6c04d8b2, 0xe75f, 0x4a39, {0x8d, 0x26, 0x51, 0xb3, 0xc8, 0x40, 0x9e, 0x27}};
constexpr GUID kGuidTail = {0x38f1b6a7, 0x0d24, 0x4e88, {0xb7, 0x95, 0x2c, 0x61, 0x4f, 0xd2, 0x08, 0xa3}};
constexpr GUID kGuidForceInt24 = {0xd2c67f41, 0x8b53, 0x4a2e, {0x97, 0x61, 0x0f, 0xc8, 0x35, 0xba, 0x64, 0x12}};
constexpr GUID kGuidObjectDelay = {0x5b2e9c18, 0xa640, 0x4d7b, {0x92, 0x0e, 0x37, 0xc5, 0x81, 0x6b, 0x2a, 0x54}};
constexpr GUID kGuidThreads = {0xcb7a4015, 0x3f98, 0x4c62, {0xa0, 0x8d, 0x1b, 0x74, 0x29, 0xe6, 0x53, 0x0f}};
constexpr GUID kGuidFfmpeg = {0x0e9d37c2, 0x5a18, 0x4b40, {0xb6, 0x3f, 0x88, 0x2d, 0x9a, 0x70, 0x1c, 0x65}};
@@ -42,10 +44,23 @@ cfg_bool g_gain_enabled(kGuidGainEnabled, true);
cfg_int g_gain_mdb(kGuidGain, 0);
// milli-seconds
cfg_uint g_tail_ms(kGuidTail, 5000);
// Deliver int24 instead of float32.
cfg_bool g_force_int24(kGuidForceInt24, false);
cfg_uint g_object_delay(kGuidObjectDelay, 1473);
cfg_uint g_threads(kGuidThreads, 0);
cfg_string g_ffmpeg(kGuidFfmpeg, "ffmpeg");
// Appends an optional trailing field to one of the fixed describe() buffers, so a
// setting that is off leaves the line exactly as it was.
template <std::size_t N>
void append_to(char (&buffer)[N], const char* text) {
if (text == nullptr || *text == '\0') return;
const std::size_t used = std::strlen(buffer);
const std::size_t extra = std::strlen(text);
if (used + extra + 1u > N) return;
std::memcpy(buffer + used, text, extra + 1u);
}
std::string environment(const char* name) {
char buffer[4096] = {};
const DWORD length = GetEnvironmentVariableA(name, buffer, sizeof(buffer));
@@ -108,6 +123,7 @@ Values read() {
values.gain_enabled = static_cast<bool>(g_gain_enabled);
values.gain_db = static_cast<double>(static_cast<long long>(g_gain_mdb)) / 1000.0;
values.tail_seconds = static_cast<double>(static_cast<unsigned>(g_tail_ms)) / 1000.0;
values.force_int24 = static_cast<bool>(g_force_int24);
values.object_delay_samples = static_cast<unsigned>(g_object_delay);
values.native_threads = static_cast<unsigned>(g_threads);
values.ffmpeg_path = g_ffmpeg.get_ptr();
@@ -124,6 +140,7 @@ void write(const Values& values) {
g_gain_enabled = values.gain_enabled;
g_gain_mdb = static_cast<long long>(values.gain_db * 1000.0 + (values.gain_db >= 0 ? 0.5 : -0.5));
g_tail_ms = static_cast<unsigned>(values.tail_seconds * 1000.0 + 0.5);
g_force_int24 = values.force_int24;
g_object_delay = values.object_delay_samples;
g_threads = values.native_threads;
g_ffmpeg = values.ffmpeg_path.c_str();
@@ -146,6 +163,7 @@ joc_decode::Settings current() {
(void)env_double("JOC_GAIN_DB", &values.gain_db);
if (env_string("JOC_GAIN_ENABLED", &text)) values.gain_enabled = (text != "0");
(void)env_double("JOC_TAIL_SECONDS", &values.tail_seconds);
if (env_string("JOC_FORCE_INT24", &text)) values.force_int24 = (text != "0");
(void)env_uint("JOC_OBJECT_DELAY", &values.object_delay_samples);
(void)env_uint("JOC_THREADS", &values.native_threads);
@@ -161,6 +179,7 @@ joc_decode::Settings current() {
// attenuation has to be visible and switchable.
settings.gain_db = values.gain_enabled ? values.gain_db : 0.0;
settings.tail_seconds = values.tail_seconds;
settings.force_int24 = values.force_int24;
settings.object_delay_samples = values.object_delay_samples;
settings.native_threads = values.native_threads;
settings.ffmpeg_path = values.ffmpeg_path.empty() ? "ffmpeg" : values.ffmpeg_path;
@@ -187,6 +206,9 @@ std::string describe(const joc_decode::Settings& settings) {
settings.object_delay_samples, settings.native_threads,
settings.ffmpeg_path.c_str());
}
// Stated only when it is not the default, so a default log line reads as it
// always did.
append_to(text, settings.force_int24 ? ", int24=forced" : "");
return text;
}
@@ -200,6 +222,7 @@ std::string describe(const Values& values) {
values.binaural_mode, values.gain_enabled ? "" : "(off) ", values.gain_db,
values.tail_seconds, values.object_delay_samples, values.native_threads,
values.ffmpeg_path.c_str());
append_to(text, values.force_int24 ? " int24=forced" : "");
return text;
}
+2
View File
@@ -40,6 +40,8 @@ struct Values {
bool gain_enabled = true;
double gain_db = 0.0;
double tail_seconds = 5.0;
// Deliver int24 instead of float32; see joc_decode::Settings::force_int24.
bool force_int24 = false;
unsigned object_delay_samples = 1473;
unsigned native_threads = 0;
std::string ffmpeg_path = "ffmpeg";