[Libav-user] Convert and resample 16-bit linear PCM (16k HZ) to 8-bit A-law (8k HZ)

Baumgarten, Julien julien.baumgarten at viadialog.com
Thu Aug 26 14:55:39 EEST 2021


Hi folks,

Currently, I am currently working on rewriting a python source code into
C++.
In python, the pydub library is awesome for manipulating audio streams.
However, in C++ it seems to be a bit harder.

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.

What is the best way to do the job? Decode, encode + resample? Or is there
something more simple?

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?

Yours sincerely,
Julien BAUMGARTEN


[image: avatar] [image: viadialog]
<https://www.viadialog.com/?utm_source=signature&utm_medium=email&utm_campaign=email_signature_logo>
Julien BAUMGARTEN

Chef de Projet Développement

01 77 45 30 94
<0177453094>

julien.baumgarten at viadialog.com

www.viadialog.com
<https://www.viadialog.com/?utm_source=signature&utm_medium=email&utm_campaign=email_signature_link>

152 Boulevard Pereire, 75017 Paris
[image: facebook] <https://www.facebook.com/viadialog>
[image: twitter] <https://twitter.com/viadialog>
[image: linkedin] <https://www.linkedin.com/company/viatelecom>
<https://www.viadialog.com/?utm_source=signature&utm_medium=email&utm_campaign=email_signature_banner>
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: https://www.viadialog.com/mentions-legales
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20210826/63e7c401/attachment.htm>


More information about the Libav-user mailing list