How to convert the WAV/OGG file to FLAC file in Android?

家住魔仙堡 提交于 2019-11-27 12:54:11

Temple, Thanks for the post and the response with the attached code for FLAC conversion. It works as you described with one minor issue.

The FLACFileOutputStream (fout) and the FileInputStream (sin) are not closed at the end of the function. Please update your post/code so others can benefit as well.

finally {
     try {
          if (sin != null) sin.close();
          if (fout != null) fout.close();
     } catch (IOException e) {}
}

PS: FLACFileOutputStream fout will need to be promoted to a class variable for this to work.

uv001

Change the following line in your code

unencodedSamples -= flac.t_encodeSamples(unencodedSamples, true);

to

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