title: TarsosDSP Pitch Analysis for Dummies
body: <p>I am woking on a progarm that analyze the pitch of a sound file. I came across a very good API called "TarsosDSP" which offers various pitch analysis. However I am experiencing a lot of trouble setting it up. Can someone show me some quick pointers on how to use this API (espically the PitchProcessor class) please? Some snippets of code would be extremely appreciated because I am really new at sound analysis. </p>
  
  <p>Thanks</p>
  
  <p>EDIT: I found some document at <a href="http://husk.eecs.berkeley.edu/courses/cs160-sp14/index.php/Sound_Programming" rel="noreferrer">http://husk.eecs.berkeley.edu/courses/cs160-sp14/index.php/Sound_Programming</a> where there are some example code that shows how to setup the PitchProcessor, …</p>
  
  <pre><code>int bufferReadResult = mRecorder.read(mBuffer, 0, mBufferSize);
  // (note: this is NOT android.media.AudioFormat)
  be.hogent.tarsos.dsp.AudioFormat mTarsosFormat = new be.hogent.tarsos.dsp.AudioFormat(SAMPLE_RATE, 16, 1, true, false);
  AudioEvent audioEvent = new AudioEvent(mTarsosFormat, bufferReadResult);
  audioEvent.setFloatBufferWithByteBuffer(mBuffer);
  pitchProcessor.process(audioEvent);
  </code></pre>
  
  <p>…I am quite lost, what exactly are mBuffer and mBufferSize? How do I find these values? And where do I input my audio files?</p>