-1
SwrContext *swr_ctx = swr_alloc_set_opts(NULL,                          
                        AV_CH_LAYOUT_STEREO,
                        AV_SAMPLE_FMT_FLT,
                        sample_rate,
                        pCodecParameters->channel_layout,                                                                               
                  
                        pCodecParameters->format,
                        pCodecParameters->sample_rate,                          
                        0,
                        NULL);

what exactly AV_SAMPLE_FMT_FLT is ? i already read docs but i want to know that what is float layout means in the context of Audio. How actually binary data of audio will look in that format.

Golu
  • 350
  • 2
  • 14
  • [It's a bunch of C floats between -1 and +1](https://stackoverflow.com/q/29761331/14215102) . I'm pretty sure you could find plenty more detail on your own if you were to try. If you're stuck on some specific detail, please [edit] your question to narrow it down. –  Dec 18 '20 at 10:30

1 Answers1

0

It means every sample is in single buffer and per sample data is 32bit float. Buffer AFAIK structured like this:

[SAMPLE_CH0][SAMPLE_CH1]...[SAMPLE_CHn]
[SAMPLE_CH0][SAMPLE_CH1]...[SAMPLE_CHn]

So on so forth. This repeats the number of "samples" times.
I may be wrong though, you need to check it yourself.

the kamilz
  • 1,860
  • 1
  • 15
  • 19
  • I haven't seen any meaningful support for half precision (16-bit) floats in any current C compiler. Those would certainly be a pain to work with. I think those are 32-bit. –  Dec 18 '20 at 13:57
  • yes after some research i found its 32 bit not 16 bit – Golu Dec 18 '20 at 18:19
  • 32bit must be correct, my bad. Corrected on the answer. – the kamilz Dec 21 '20 at 02:19