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:
@@ -1818,12 +1818,12 @@ AudioMixer::UpdateParameterWeb()
|
|||||||
|
|
||||||
dp = group->MakeDiscreteParameter(PARAM_ETC(70), B_MEDIA_RAW_AUDIO, "Resampling algorithm", B_INPUT_MUX);
|
dp = group->MakeDiscreteParameter(PARAM_ETC(70), B_MEDIA_RAW_AUDIO, "Resampling algorithm", B_INPUT_MUX);
|
||||||
dp->AddItem(0, "Drop/repeat samples");
|
dp->AddItem(0, "Drop/repeat samples");
|
||||||
|
dp->AddItem(2, "Linear interpolation");
|
||||||
|
|
||||||
// Note: The following code is outcommented on purpose
|
// Note: The following code is outcommented on purpose
|
||||||
// and is about to be modified at a later point
|
// and is about to be modified at a later point
|
||||||
/*
|
/*
|
||||||
dp->AddItem(1, "Drop/repeat samples (template based)");
|
dp->AddItem(1, "Drop/repeat samples (template based)");
|
||||||
dp->AddItem(2, "Linear interpolation");
|
|
||||||
dp->AddItem(3, "17th order filtering");
|
dp->AddItem(3, "17th order filtering");
|
||||||
*/
|
*/
|
||||||
group->MakeDiscreteParameter(PARAM_ETC(80), B_MEDIA_RAW_AUDIO, "Refuse output format changes", B_ENABLE);
|
group->MakeDiscreteParameter(PARAM_ETC(80), B_MEDIA_RAW_AUDIO, "Refuse output format changes", B_ENABLE);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include <TimeSource.h>
|
#include <TimeSource.h>
|
||||||
|
|
||||||
#include "AudioMixer.h"
|
#include "AudioMixer.h"
|
||||||
|
#include "Interpolate.h"
|
||||||
#include "MixerInput.h"
|
#include "MixerInput.h"
|
||||||
#include "MixerOutput.h"
|
#include "MixerOutput.h"
|
||||||
#include "MixerUtils.h"
|
#include "MixerUtils.h"
|
||||||
@@ -296,9 +297,15 @@ MixerCore::ApplyOutputFormat()
|
|||||||
|
|
||||||
fResampler = new Resampler * [fMixBufferChannelCount];
|
fResampler = new Resampler * [fMixBufferChannelCount];
|
||||||
for (int i = 0; i < fMixBufferChannelCount; i++) {
|
for (int i = 0; i < fMixBufferChannelCount; i++) {
|
||||||
// TODO create Interpolate instead of Resampler if the settings say so
|
switch (Settings()->ResamplingAlgorithm()) {
|
||||||
fResampler[i] = new Resampler(media_raw_audio_format::B_AUDIO_FLOAT,
|
case 2:
|
||||||
format.format);
|
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");
|
TRACE("MixerCore::OutputFormatChanged:\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user