<div dir="ltr">hello<div><br></div><div> i try to trancode audio frames decoded from mp2 file into wav file.</div><div><br></div><div> so from what i understand </div><div> </div><div> my input buffer should be the: <b>uint8_t *data </b>field in the<b> AVFrame</b> structure</div>
<div> </div><div> my output buffer should be allocated using :</div><div><br></div><div> int<b> av_samples_alloc</b>(uint8_t **audio_data, int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align);</div>
<div><br></div><div> what size should i put in<b> nb_samples</b> parameter ?</div><div><br></div><div> then i understand i should call :</div><div><br></div><div> int <b>swr_convert</b>(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in , int in_count);</div>
<div><br></div><div> and pass<b> AVFrame data</b> filed as input buffer & the allocated samples buffer as the output buffer.</div><div><br></div><div> how do i calculate the<b> in_count & the out_count</b>. parameters.</div>
<div><br></div><div><br></div><div> any help will be appreciated . thanks rafi</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div><div><br></div>
</div>