Correct estimated capture time in C8 format (#1330)

* Correct capture time remaining for C8 format

* Removed unsupported RawS32 type

* Clang
This commit is contained in:
Mark Thompson 2023-07-31 10:02:11 -05:00 committed by GitHub
parent 91c6e3fc30
commit a24b3ad3de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -269,7 +269,12 @@ void RecordView::update_status_display() {
if (sampling_rate) {
const auto space_info = std::filesystem::space(u"");
const uint32_t bytes_per_second = file_type == FileType::WAV ? (sampling_rate * 2) : (sampling_rate / 8 * 4); // TODO: Why 8/4??
const uint32_t bytes_per_second =
// - Audio is 1 int16_t per sample or '2' bytes per sample.
// - C8 captures 2 (I,Q) int8_t per sample or '2' bytes per sample.
// - C16 captures 2 (I,Q) int16_t per sample or '4' bytes per sample.
// Dividing to get actual sample rate because of decimation in proc_capture.
file_type == FileType::WAV ? (sampling_rate * 2) : (sampling_rate * ((file_type == FileType::RawS8) ? 2 : 4) / 8);
const uint32_t available_seconds = space_info.free / bytes_per_second;
const uint32_t seconds = available_seconds % 60;
const uint32_t available_minutes = available_seconds / 60;

View File

@ -42,8 +42,7 @@ class RecordView : public View {
enum FileType {
RawS8 = 1,
RawS16 = 2,
RawS32 = 3,
WAV = 4,
WAV = 3,
};
RecordView(