gmf
gmf copied to clipboard
Extract audio and resample example
Hi,
Can you provide an example of how to use the resampler to downsample an audio stream and get access to the raw pcm audio data?
Hi, @expd. It's pretty easy, I'll writre it ASPA. The main thing is pretty the same you can find in trancode.go:
- Open input context
- Select AUDIO streams
- Open output codecs (e.g. pcm_s16le)
- Initialize
Swrcontext - Do converrtion
- Write output
Just wait a bit, and I'll write it.
I think some of the conversion functionality is missing ffmpeg docs show that there's a different calculation for the number of samples required. I'm trying to convert 48/stereo to 16/mono.