<div dir="ltr"><div>Hi folks,</div><div><br></div><div>Currently, I am currently working on rewriting a python source code into C++.</div><div>In python, the pydub library is awesome for manipulating audio streams. However, in C++ it seems to be a bit harder.</div><div><br></div><div>My program fetches some 16-bit linear PCM samples in 16k HZ from a socket and should convert and resample it to 8-bit A-law in 8k HZ. Both should be MONO channels.</div><div><br></div><div>What is the best way to do the job? Decode, encode + resample? Or is there something more simple?</div><div><br></div><div>At the resample step, the source sample format is AV_SAMPLE_FMT_S16 but what sample format should I use for my needs? AV_SAMPLE_FMT_U8 or AV_SAMPLE_FMT_U8P?</div><div><br></div><div>Yours sincerely,<br>Julien BAUMGARTEN</div><div><br></div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><table style="vertical-align:-webkit-baseline-middle;font-size:medium;font-family:Arial" cellspacing="0" cellpadding="0"><tbody><tr><td><table style="vertical-align:-webkit-baseline-middle;font-family:Arial" cellspacing="0" cellpadding="0"><tbody><tr><td style="vertical-align:middle" width="150"><img alt="avatar" src="https://viadialog-signature-assets.s3-eu-west-1.amazonaws.com/avatars/avatar-julien-baumgarten.jfif" style="max-width:130px;border-color:#5e86c3;border-radius:50% 50% 50% 50%;border-style:solid;border-width:4px" width="130"> <a rel="noopener noreferrer" href="https://www.viadialog.com/?utm_source=signature&utm_medium=email&utm_campaign=email_signature_logo" color="#000000" style="color:rgb(102,102,102);font-size:12px" target="_blank"><img alt="viadialog" src="https://viadialog-signature-assets.s3-eu-west-1.amazonaws.com/shared/viadialog-logo-color.png" style="margin-top:5px;max-width:130px" width="130"></a></td><td width="30"><div style="width:30px"></div></td><td color="#5e86c3" style="width:3px;background-color:#5e86c3;border-bottom:none;border-radius:1.5px" width="3"></td><td width="30"><div style="width:30px"></div></td><td style="vertical-align:bottom"><h3 color="#000000" style="margin:0;font-size:18px;color:#000">Julien BAUMGARTEN</h3><p color="#000000" style="margin:0;color:#eb651d;font-size:15px;line-height:22px;margin-bottom:15px">Chef de Projet Développement</p><a href="tel:0177453094" color="#000000" style="color:rgb(102,102,102);font-size:12px" target="_blank"><p color="#000000" style="margin:0px;font-size:14px;line-height:22px">01 77 45 30 94</p></a><a href="mailto:julien.baumgarten@viadialog.com" color="#000000" style="color:rgb(102,102,102);font-size:12px" target="_blank"><p color="#000000" style="margin:0px;font-size:14px;line-height:22px">julien.baumgarten@viadialog.com</p></a><a rel="noopener noreferrer" href="https://www.viadialog.com/?utm_source=signature&utm_medium=email&utm_campaign=email_signature_link" color="#000000" style="color:rgb(102,102,102);font-size:12px" target="_blank"><p color="#000000" style="margin:0px;font-size:14px;line-height:22px">www.viadialog.com</p></a><p color="#000000" style="margin:0px;color:rgb(102,102,102);font-size:14px;line-height:22px">152 Boulevard Pereire, 75017 Paris</p><table style="vertical-align:-webkit-baseline-middle;font-family:Arial;width:100%" cellspacing="0" cellpadding="0"><tbody><tr><td style="vertical-align:top"><table style="vertical-align:-webkit-baseline-middle;font-family:Arial;display:inline-block" cellspacing="0" cellpadding="0"><tbody><tr style="text-align:right"><td><a rel="noopener noreferrer" href="https://www.facebook.com/viadialog" style="display:inline-block;padding:0" target="_blank"><img src="https://viadialog-signature-assets.s3-eu-west-1.amazonaws.com/shared/facebook.png" alt="facebook" style="max-width:135px;display:block" height="24"></a></td><td width="5"><div></div></td><td><a rel="noopener noreferrer" href="https://twitter.com/viadialog" style="display:inline-block;padding:0" target="_blank"><img src="https://viadialog-signature-assets.s3-eu-west-1.amazonaws.com/shared/twitter.png" alt="twitter" style="max-width:135px;display:block" height="24"></a></td><td width="5"><div></div></td><td><a rel="noopener noreferrer" href="https://www.linkedin.com/company/viatelecom" style="display:inline-block;padding:0" target="_blank"><img src="https://viadialog-signature-assets.s3-eu-west-1.amazonaws.com/shared/linkedin.png" alt="linkedin" style="max-width:135px;display:block" height="24"></a></td><td width="5"><div></div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td height="20"></td></tr><tr><td><span style="display:block"><a rel="noopener noreferrer" href="https://www.viadialog.com/?utm_source=signature&utm_medium=email&utm_campaign=email_signature_banner" style="border-width:initial;border-style:none;border-color:initial;display:inline-block;background-color:transparent;color:rgb(255,255,255);font-weight:700;text-align:center;line-height:1;font-size:12px;border-radius:3px" target="_blank"><img src="https://viadialog-signature-assets.s3-eu-west-1.amazonaws.com/shared/banner-viadialog.png" style="max-width:728px"></a></span></td></tr><tr><td height="20"></td></tr><tr><td><span style="display:block;font-size:8px;color:rgb(136,136,136);padding-top:5px">This
email message (including its attachments) is confidential and may
contain privileged information and is intended solely for the use of the
individual and/or entity to whom it is addressed. If you are not the
intended recipient of this e-mail you may not share, distribute or copy
this e-mail (including its attachments), or any part thereof. If this
e-mail is received in error, please notify the sender immediately by
return e-mail and make sure that this e-mail (including its
attachments), and all copies thereof, are immediately deleted from your
system. Please further note that when you communicate with us via email
or visit our website we process your personal data. See our privacy
policy for more information about how we process it:
<a href="https://www.viadialog.com/mentions-legales" target="_blank">https://www.viadialog.com/mentions-legales</a></span></td></tr></tbody></table>
</div>
</div></div></div></div>