Enable the "interpolate" resampling method. Results are not as good as I expected, however.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38066 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2010-08-12 17:12:00 +00:00
parent e70fa080b2
commit 77fa0021d9
2 changed files with 11 additions and 4 deletions

View File

@ -1818,12 +1818,12 @@ AudioMixer::UpdateParameterWeb()
dp = group->MakeDiscreteParameter(PARAM_ETC(70), B_MEDIA_RAW_AUDIO, "Resampling algorithm", B_INPUT_MUX);
dp->AddItem(0, "Drop/repeat samples");
dp->AddItem(2, "Linear interpolation");
// Note: The following code is outcommented on purpose
// and is about to be modified at a later point
/*
dp->AddItem(1, "Drop/repeat samples (template based)");
dp->AddItem(2, "Linear interpolation");
dp->AddItem(3, "17th order filtering");
*/
group->MakeDiscreteParameter(PARAM_ETC(80), B_MEDIA_RAW_AUDIO, "Refuse output format changes", B_ENABLE);

View File

@ -20,6 +20,7 @@
#include <TimeSource.h>
#include "AudioMixer.h"
#include "Interpolate.h"
#include "MixerInput.h"
#include "MixerOutput.h"
#include "MixerUtils.h"
@ -296,9 +297,15 @@ MixerCore::ApplyOutputFormat()
fResampler = new Resampler * [fMixBufferChannelCount];
for (int i = 0; i < fMixBufferChannelCount; i++) {
// TODO create Interpolate instead of Resampler if the settings say so
fResampler[i] = new Resampler(media_raw_audio_format::B_AUDIO_FLOAT,
format.format);
switch (Settings()->ResamplingAlgorithm()) {
case 2:
fResampler[i] = new Interpolate(
media_raw_audio_format::B_AUDIO_FLOAT, format.format);
break;
default:
fResampler[i] = new Resampler(
media_raw_audio_format::B_AUDIO_FLOAT, format.format);
}
}
TRACE("MixerCore::OutputFormatChanged:\n");