From 59d32f60ad49206d132faa7744c648782e13729c Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Tue, 31 Mar 2020 18:07:25 +1100 Subject: [PATCH] core: use SAMPLE_FMT_FLT only There's no real reason not to use float for audio. It's light on system resources (compared to everything else we're doing at least) and the code becomes simpler when we can assume all audio will be -1 to 1 rather than 0 to 255 or -32768 to 32767. The only thing we might want to do one day is move up to SAMPLE_FMT_DBL, but this should only take some mild refactoring and all our assumptions (i.e. -1 to 1 range, etc.) can remain the same. --- app/audio/sampleformat.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/audio/sampleformat.cpp b/app/audio/sampleformat.cpp index df1437b67..6954c0a4a 100644 --- a/app/audio/sampleformat.cpp +++ b/app/audio/sampleformat.cpp @@ -25,9 +25,10 @@ QString SampleFormat::GetSampleFormatName(const SampleFormat::Format &f) return tr("Invalid"); } -SampleFormat::Format SampleFormat::GetConfiguredFormatForMode(RenderMode::Mode mode) +SampleFormat::Format SampleFormat::GetConfiguredFormatForMode(RenderMode::Mode /*mode*/) { - return static_cast(Core::GetPreferenceForRenderMode(mode, QStringLiteral("SampleFormat")).toInt()); + //return static_cast(Core::GetPreferenceForRenderMode(mode, QStringLiteral("SampleFormat")).toInt()); + return SAMPLE_FMT_FLT; } void SampleFormat::SetConfiguredFormatForMode(RenderMode::Mode mode, SampleFormat::Format format)