plectrum

Plectrum: instrument tuner for Android
Log | Files | Refs | README | LICENSE

PitchDetector.java (1595B)


      1 /*
      2 *      _______                       _____   _____ _____  
      3 *     |__   __|                     |  __ \ / ____|  __ \ 
      4 *        | | __ _ _ __ ___  ___  ___| |  | | (___ | |__) |
      5 *        | |/ _` | '__/ __|/ _ \/ __| |  | |\___ \|  ___/ 
      6 *        | | (_| | |  \__ \ (_) \__ \ |__| |____) | |     
      7 *        |_|\__,_|_|  |___/\___/|___/_____/|_____/|_|     
      8 *                                                         
      9 * -------------------------------------------------------------
     10 *
     11 * TarsosDSP is developed by Joren Six at IPEM, University Ghent
     12 *  
     13 * -------------------------------------------------------------
     14 *
     15 *  Info: http://0110.be/tag/TarsosDSP
     16 *  Github: https://github.com/JorenSix/TarsosDSP
     17 *  Releases: http://0110.be/releases/TarsosDSP/
     18 *  
     19 *  TarsosDSP includes modified source code by various authors,
     20 *  for credits and info, see README.
     21 * 
     22 */
     23 
     24 
     25 package be.tarsos.dsp.pitch;
     26 
     27 /**
     28  * A pitch detector is capable of analyzing a buffer with audio information
     29  * and return a pitch estimation in Hz.
     30  * 
     31  * @author Joren Six
     32  */
     33 public interface PitchDetector {
     34 	/**
     35 	 * Analyzes a buffer with audio information and estimates a pitch in Hz.
     36 	 * Currently this interface only allows one pitch per buffer.
     37 	 * 
     38 	 * @param audioBuffer
     39 	 *            The buffer with audio information. The information in the
     40 	 *            buffer is not modified so it can be (re)used for e.g. FFT
     41 	 *            analysis.
     42 	 * @return An estimation of the pitch in Hz or -1 if no pitch is detected or
     43 	 *         present in the buffer.
     44 	 */
     45 	PitchDetectionResult getPitch(final float[] audioBuffer);
     46 }