Thanks Ian, I've cleaned up the code to remove the redundant DWORD(BASS_DATA_FFT_COMPLEX | BASS_DATA_FFT_INDIVIDUAL | BASS_DATA_FFT_REMOVEDC flags, as well as the redundant if (info.freq != channelInfo.freq){ // the rates don't match
BASS_Init(device, channelInfo.freq, DWORD(BASS_DEVICE_FREQ | BASS_DEVICE_REINIT), nil, nil)
}
Call.
I'm a bit confused though, when you say,
The BASS_Init "freq" parameter doesn't affect DSD decoding (or decoding in general
…
… I believed the decoding took place as a result of this line…
let stream = BASS_DSD_StreamCreateURL(theURL, 0, DWORD(BASS_SAMPLE_FLOAT | BASS_STREAM_DECODE), nil, nil, DWORD(freq))
… where the pcm freq I want the DSD to be decoded to is specified. I can just leave this at 0 and the freq specified in BASS_Config will be used as in…
BASS_SetConfig(
DWORD(BASS_CONFIG_DSD_FREQ),
DWORD(88200)
)
In fact I call this in the calling function, because I want to change the PCM frequency, depending on the sample rate of the original DSD. If it were a DSD128, I may prefer 176400 as the PCM rate, for example.
… or have I completely mis-understood the process?
I will try your BASS_Encode suggestion to write an encoded WAV file to disc from an original PCM.