Clicks while using LAME to encode from PCM to MP3 in iOS

大兔子大兔子 提交于 2019-12-05 23:24:11

I previously called lame_init() each time I encoded a buffer.

Once I moved that setup code out to be called only once the issue was fixed.

I guess what is happening is that mp3 must encode at least 1152 frames at a time, and the lame_t encoder keeps track of data that was not encoded at the last call. So lame_encode_buffer can start where we left off.

lame_encode_flush should only be used at the very end of a file (or the last few frames would get chopped off, unless the number of frames was an exact multiple of 1152--unlikely).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!