3

Hi in How to provide both audio data and video data to MediaMux it says that in order to sync audio and video you have to "calculate the number of audio samples that should play for each frame of video", how would be the formula? could you give me some examples? What if I read audio data from AudioRecord on video drainEncoder function? thanks

Community
  • 1
  • 1
Gabriel Bursztyn
  • 656
  • 8
  • 24

1 Answers1

4

I have found the answer.

It depends on the sample rate and the frame rate:

at 24fps and 48000Hz every frame is long (48000hz/24fps)= 2000 sample

at 25 fps and 48000Hz: (48000hz/25fps)= 1920 sample

hope it helps.

Gabriel Bursztyn
  • 656
  • 8
  • 24