简体   繁体   English

iOS中音频文件的幅度频谱

[英]Amplitude spectrum of Audio file in iOS

I am new in iOS development. 我是iOS开发的新手。 As the part of developing an iOS app i need to fetch complete amplitude values of an audio file and i need to process the data without playing the file (ie power per channel method is not enough) . 作为开发iOS应用程序的一部分,我需要获取音频文件的完整幅度值,并且需要在不播放文件的情况下处理数据(即,每声道功率不足)。 Also please guide me on the audio file datas that is available in iOS from audio file like duration, size ect.. 另外,请指导我有关iOS中音频文件数据的信息,例如持续时间,大小等。

If you need to process the file on a per-sample basis, using ExtAudioFileServices is the way to go. 如果您需要按样本处理文件,则可以使用ExtAudioFileServices。 Read the documentation for details. 阅读文档以获取详细信息。 You can build your code off of this sample code provided by Apple. 您可以从Apple提供的此示例代码构建代码。

The way to think about it in this case is - you are converting your input file to an output file, with the same sample rate, duration, format etc. and simply processing the samples as they are converted - in effect, you are only processing the file. 在这种情况下,考虑的方式是-您将输入文件转换为具有相同采样率,持续时间,格式等的文件,并仅在转换后处理样本-实际上,您仅在处理文件。 You can later delete the input file if it is not required. 如果不需要,您以后可以删除输入文件。

Some pointers from experience :- 经验中的一些建议:-

  1. check that the file formats you are using are supported (CoreAudio doesn't always give great error messages). 请检查您所使用的文件格式是否受支持(CoreAudio并非总是会给出错误的错误消息)。
  2. Make sure the files you are using are being copied to your App. 确保您正在使用的文件已复制到您的应用程序。 You can do this at MyTarget -> Build Phases -> Copy Bundle resources. 您可以在MyTarget->构建阶段->复制捆绑包资源中执行此操作。 You can also inspect files using software like iFunBox. 您也可以使用iFunBox等软件检查文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM