It's working for live playback, but not when encoding!
I create stream (chan), then mixer (chanMix), then tempo (chanOut), and encode on chanOut. File is encoded but tempo is not getting applied! Why?
var chanMix = BassMix.CreateMixerStream(sampleRate, chanInfo.Channels, BassFlags.MixerEnd | BassFlags.Decode).Valid();
BassMix.MixerAddChannel(chanMix, chan, BassFlags.MixerChanNoRampin | BassFlags.AutoFree);
// Add tempo effects.
var chanOut = BassFx.TempoCreate(chanMix, BassFlags.Decode).Valid();
// Optimized pitch shifting for increased quality
var r = pitch;
if (settings.RoundPitch)
{
r = Fraction.RoundToFraction(r);
}
var t = r / settings.Speed;
// 1. Rate Shift (lossless)
Bass.ChannelSetAttribute(chanOut, ChannelAttribute.Frequency, sampleRate * r);
// 2. Resampling to output in _chanMix constructor
// 3. Tempo adjustment
Bass.ChannelSetAttribute(chanOut, ChannelAttribute.Tempo,
!settings.SkipTempo ? (1.0 / t - 1.0) * 100.0 : 0);
// ...
BassEnc.EncodeStart(chanOut, CommandLine: file.Destination, EncodeFlags.PCM | flags, null).Valid();
var buffer = new byte[32 * 1024];
while (Bass.ChannelGetData(chanOut, buffer, buffer.Length) > -1)
{
}