1

my aim is to perform analysis (like DFT) on an audio file (mp3).
Then :

  • my input is a file
  • And my output is a treatment

I would like to use QTKit framework to perform this, but I am a bit disappointed:

  • QTMovie is able to open a file but I don't see own to access to decompressed audio buffer
  • QTSampleBuffer can be treat with QTCaptureDecompressedAudioOutput but I don't find how to open a file (the only input seems to be QTCaptureDeviceInput)

Is there a way to do what I want with QTKit or should I use Core Audio (or other) which will be more difficult (and I prefer Objective-C than C or C++) ?

(Actually I have no code, I am just trying to find the good way and it the first time I use sound...)

Benoît
  • 7,395
  • 2
  • 25
  • 30

1 Answers1

2

QTKit won't let you do that. You'll have to use Core Audio. You could always take a look at this code (which is written for the iPhone but most of the code works on Mac OS X) to understand everything a bit more. It detects frequency using FFT.

I also was afraid of using Core Audio, but in the end it all worked out pretty well.

Fatso
  • 1,278
  • 16
  • 46
  • Arg... my problem is not FFT but to open a file and get PCM data (to perform the FFT). Thank you for the link. I will study it. – Benoît Oct 07 '11 at 15:30
  • OK, it works ! WIth audio toolbox (ExtAudioFile to convert mp3 to lpcm, and audioQueue to play the lpcm buffer). Thx. – Benoît Oct 12 '11 at 20:50