From 9b774f0845ceafa757e6ec79d6c9a4a7d0d6d166 Mon Sep 17 00:00:00 2001 From: Mike Walters Date: Sun, 27 Mar 2016 16:46:34 +0100 Subject: [PATCH] input: Default to cf32 file type if extension is unknown --- README.md | 1 + inputsource.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b86b318..ad38ccf 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ inspectrum supports the following file types: * `*.cf32`, `*.cfile` - Complex 32-bit floating point samples (GNURadio, osmocom_fft) * `*.cs32` - Complex 8-bit signed integer samples (HackRF) * `*.cu32` - Complex 8-bit unsigned integer samples (RTL-SDR) +If an unknown file extension is loaded, inspectrum will default to `*.cf32`. ## Features * Spectrogram with zoom/pan diff --git a/inputsource.cpp b/inputsource.cpp index adda711..af9f49a 100644 --- a/inputsource.cpp +++ b/inputsource.cpp @@ -134,7 +134,7 @@ void InputSource::openFile(const char *filename) sampleAdapter = std::unique_ptr(new ComplexU8SampleAdapter()); } else { - throw std::runtime_error("Invalid file extension"); + sampleAdapter = std::unique_ptr(new ComplexF32SampleAdapter()); } FILE *file = fopen(filename, "rb");