I have a sound source fed into a GStreamer pipeline for conversion into a more suitable format. The sources are varied but at the end of the pipeline I must have Signed 16-bit PCM (Mono) at 48Khz.
The audio source at the begining of the pipeline is 32bit floating point samples at whatever rate the source sees fit (a result of using the playbin element) with 1 or more channels (usually stereo but could be more) so the pipeline as of now does the following in this order:
- Downmix to mono (fp 32)
- Resample (fp 32; [anything] -> 48Khz)
- Conversion (fp32 -> s16)
Doing the conversion first saves me some significant CPU load since all the remaining conversions are done mostly in integers but I am unsure if there would be any noticeable artifacts under some circumstances.