Looping through the samples of CAF file

2019-09-04 07:30发布

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!

标签: c++ c ios audio caf
2条回答
太酷不给撩
2楼-- · 2019-09-04 08:03

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.

查看更多
劳资没心,怎么记你
3楼-- · 2019-09-04 08:05

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.

查看更多
登录 后发表回答