From bb089c9f1f08f73cfc3eb97304ab4d6864fa174c Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 1 Apr 2018 21:11:23 +0200 Subject: Add s16 file output format --- src/DabMod.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/DabMod.cpp') diff --git a/src/DabMod.cpp b/src/DabMod.cpp index 1266147..f384e78 100644 --- a/src/DabMod.cpp +++ b/src/DabMod.cpp @@ -187,6 +187,12 @@ static shared_ptr prepare_output( s.normalise = 1.0f / normalise_factor_file_var; output = make_shared(s.outputName, s.fileOutputShowMetadata); } + else if (s.fileOutputFormat == "s16") { + // We must normalise the samples to the interval [-32767.0; 32767.0] + s.normalise = 32767.0f / normalise_factor; + + output = make_shared(s.outputName, s.fileOutputShowMetadata); + } else if (s.fileOutputFormat == "s8" or s.fileOutputFormat == "u8") { // We must normalise the samples to the interval [-127.0; 127.0] @@ -278,7 +284,8 @@ int launch_modulator(int argc, char* argv[]) shared_ptr format_converter; if (mod_settings.useFileOutput and (mod_settings.fileOutputFormat == "s8" or - mod_settings.fileOutputFormat == "u8")) { + mod_settings.fileOutputFormat == "u8" or + mod_settings.fileOutputFormat == "s16")) { format_converter = make_shared(mod_settings.fileOutputFormat); } -- cgit v1.2.3