Does the resampler have the option of you feeding it input data and then requesting output data, rather than both in the same call?
I believe it has to be both in the same call. So I need to use your second example.
I'm trying to relate your code to the Swift code I've already created in myRecordProc.
Assuming my
var output = [Float()]
float array is equivalent to your
float *output = new float[outlne];
; where I'm stuck is how to determine the length for the re-sampled data in the output buffer.
Where does the function
GetOutputAmountFromInputAmount
come from? I'm assuming I would have to create this?
Also there is no return value from wrapper.resample… it should replace the buffer received in the callback with the output buffer data. At least that's my (admittedly vague) understanding.
So BASS_StreamPutData would just be passed the output buffer for its second parameter.
I also don't understand where the pushStream handle comes from.
I have my handle from BASS_RecordStart, which I'm calling "rChannel" and the handle from BASS_Encode_FLAC_Start, which I'm calling "encoder".
If you can relate your examples as closely as possible to my code, it will help me piece it together more easily. At least that's what I hope.
My aim now is to turn this into a new feature of my app. So to use R8Brain for high quality up-sampling, whenever desired by the user.
Apologies for all my confusion.