diff --git a/core/src/dsp/processing.h b/core/src/dsp/processing.h index 90df1488..6fd9564a 100644 --- a/core/src/dsp/processing.h +++ b/core/src/dsp/processing.h @@ -288,6 +288,7 @@ namespace dsp { void init(stream* in, float volume) { _in = in; _volume = volume; + level = powf(_volume, 2); generic_block>::registerInput(_in); generic_block>::registerOutput(&out); generic_block>::_block_init = true; diff --git a/misc_modules/recorder/src/main.cpp b/misc_modules/recorder/src/main.cpp index 04927883..ba0762ac 100644 --- a/misc_modules/recorder/src/main.cpp +++ b/misc_modules/recorder/src/main.cpp @@ -60,16 +60,22 @@ public: config.conf[name]["mode"] = RECORDER_MODE_AUDIO; config.conf[name]["recPath"] = "%ROOT%/recordings"; config.conf[name]["audioStream"] = "Radio"; + config.conf[name]["audioVolume"] = 1.0; created = true; } + if (!config.conf[name].contains("audioVolume")) { + config.conf[name]["audioVolume"] = 1.0; + } + recMode = config.conf[name]["mode"]; folderSelect.setPath(config.conf[name]["recPath"]); selectedStreamName = config.conf[name]["audioStream"]; + audioVolume = config.conf[name]["audioVolume"]; config.release(created); // Init audio path - vol.init(&dummyStream, 1.0f); + vol.init(&dummyStream, audioVolume); audioSplit.init(&vol.out); audioSplit.bindStream(&meterStream); meter.init(&meterStream); @@ -278,6 +284,9 @@ private: if (ImGui::SliderFloat(CONCAT("##_recorder_vol_", name), &audioVolume, 0, 1, "")) { vol.setVolume(audioVolume); + config.acquire(); + config.conf[name]["audioVolume"] = audioVolume; + config.release(true); } ImGui::PopItemWidth();