Pregunta

I am new in iOS development. 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) . Also please guide me on the audio file datas that is available in iOS from audio file like duration, size ect..

¿Fue útil?

Solución

If you need to process the file on a per-sample basis, using ExtAudioFileServices is the way to go. Read the documentation for details. You can build your code off of this sample code provided by 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).
  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. You can also inspect files using software like iFunBox.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top