Author Topic: Down sampling from 44.1khz to 8khz  (Read 166 times)

Steve

  • Posts: 18
Down sampling from 44.1khz to 8khz
« on: 6 Aug '18 - 22:05 »
Hi,

I'm trying to down sample a stream from 44.1khz to 8khz. I've just had a quick look a BASS mix and I assume this is the right direction to take. I just wanted to check here first that is indeed the case.

[Edit]
I've just tried to create a mix stream at 8000hz and plug in my other stream:

Code: [Select]
mixStreamID = BASS_Mixer_StreamCreate(8000, 1, BASS_STREAM_DECODE);
res = BASS_Mixer_StreamAddChannel(mixStreamID, musicStreamID, BASS_MIXER_DOWNMIX);

However, I get an error saying the stream is a decoding stream. Is there a way around that?
« Last Edit: 7 Aug '18 - 08:58 by Steve »

Ian @ un4seen

  • Administrator
  • Posts: 21208
Re: Down sampling from 44.1khz to 8khz
« Reply #1 on: 7 Aug '18 - 15:21 »
Check that the "musicStreamID" stream has the BASS_STREAM_DECODE flag set on it (needed on mixer sources). If you want to play the downsampled data (ie. call BASS_ChannelPlay on mixStreamID) then you should also remove the BASS_STREAM_DECODE flag from the BASS_Mixer_StreamCreate call.