For all actions you want to apply to the sample buffer, you have to copy the sample to a new slot of which you set the desired target properties the sample should listen to. (amount of channels, bitdepth, frequency).
When done, you could use the copy function to copy the entire sample into its original slot that was the source and erase the target slot afterwards.
I’m doing very simple processing on the sample buffer in te Stereo_to_mono tool when you select mixed mode.
These routines are non-destructive (leave the original copy in place).
You could also analyse IT-Alien’s sample morpher, or wave generation tools, these are doing a lot more processing and are far more interesting for getting the idea.