https://bugs.kde.org/show_bug.cgi?id=386105
--- Comment #11 from bl...@vivaldi.net --- So here's my code which converts float audio to 16bit (for WMA and AAC): > for(int sample=0; sample<nb_s; sample++) { > for(int ch=0; ch<nb_ch; ch++) { > float smpl = *(reinterpret_cast<float*>( > d->frame->extended_data[ch] + sample*4)) * 32767.0; > smpl = smpl > 32767.0 ? 32767.0 : smpl; > smpl = smpl < -32767.0 ? -32767.0 : smpl; > int16_t smpl2 = (((int16_t)(smpl + 32768.5)) - 32768); > ::memcpy(d->outputBufferPos + (sample * nb_ch + ch) * 2, > &smpl2, > 2); > } > } It works nicely: no noise or clipping. Made it just out of curiosity. But it's better to use libswresample. When it's done right it will cover all possible cases for the input audio. I'll get to that later. Stay tuned for patches. -- You are receiving this mail because: You are watching all bug changes.