summaryrefslogtreecommitdiffstats
path: root/src/DabMod.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-04-01 21:11:23 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-04-01 21:11:23 +0200
commitbb089c9f1f08f73cfc3eb97304ab4d6864fa174c (patch)
treef3b90854a80193c8cd35e805041724beb9a10faf /src/DabMod.cpp
parent8ebf45362cc8c2b550753d5f681f885f205b5f9d (diff)
downloaddabmod-bb089c9f1f08f73cfc3eb97304ab4d6864fa174c.tar.gz
dabmod-bb089c9f1f08f73cfc3eb97304ab4d6864fa174c.tar.bz2
dabmod-bb089c9f1f08f73cfc3eb97304ab4d6864fa174c.zip
Add s16 file output format
Diffstat (limited to 'src/DabMod.cpp')
-rw-r--r--src/DabMod.cpp9
1 files changed, 8 insertions, 1 deletions
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<ModOutput> prepare_output(
s.normalise = 1.0f / normalise_factor_file_var;
output = make_shared<OutputFile>(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<OutputFile>(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<FormatConverter> 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<FormatConverter>(mod_settings.fileOutputFormat);
}