Looping through the samples of CAF file

倖福魔咒の 提交于 2019-12-12 05:59:07

问题


Could anyone give me a suggestion or an example of how I would loop through the samples of CAF (Core Audio Format) file? Like taking the first 1000 samples and changing them to 0?

Something like:

for(int i=0; i < numberOfSamples; i++)
{
    cafFile.sample[i] = methodThatUsesSampleValue(cafFile.sample[i]);
}

Keep in mind:

  1. I don't need to do this live. No buffers, etc. needed.
  2. I would like to do this in C, C++ or Objective-C.
  3. Would like to be able to use the code on the iOS platform.

Any help appreciated!


回答1:


Recently I stumbled over the amazing OpenFrameWorks library: http://www.openframeworks.cc/about And I know it compiles on MacOS and iPhone. Amongst many(!) other libs it come with an interface to rtAudio: http://www.music.mcgill.ca/~gary/rtaudio/index.html. You might want to consider also using that directly. Hope that helps.




回答2:


The libsndfile C++ library is well-known and provides -among lot of other functions - a function to read AIFF-files: http://www.mega-nerd.com/libsndfile/, the lib is distributed under the "Gnu Lesser General Public License". I don't know if that is an issue.



来源:https://stackoverflow.com/questions/4935203/looping-through-the-samples-of-caf-file

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