79438331

Date: 2025-02-14 03:56:54
Score: 2
Natty:
Report link

After several attempts, I finally fixed the problem. The noise was caused by two issues: first, the SwrContext should be reused for each packet; second, the return value from swr_convert (ret) indicates the actual number of samples generated after resampling. Therefore, I had to use ret to accurately determine the correct buffer size and then combine the actual buffer to generate valid PCM.

Reasons:
  • No code block (0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: Bruce Hu