All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.musicg.demo.PitchDemo Maven / Gradle / Ivy

Go to download

Musicg is a lightweight audio analysis library, written in Java, with the purpose of extracting both high level and low level audio features.

There is a newer version: 1.4.2.2
Show newest version
package com.musicg.demo;

import com.musicg.processor.TopManyPointsProcessorChain;
import com.musicg.wave.Wave;
import com.musicg.wave.extension.Spectrogram;

public class PitchDemo{
	
	public static void main(String[] args){
		
		String filename = DemoHelper.getDemoDirectory() + "/cock_a_1.wav";

		// create a wave object
		Wave wave = new Wave(filename);
		Spectrogram spectrogram = new Spectrogram(wave);
		
		TopManyPointsProcessorChain processorChain=new TopManyPointsProcessorChain(spectrogram.getNormalizedSpectrogramData(),1);
		double[][] processedIntensities=processorChain.getIntensities();
		
		for (int i=0; i0){
					System.out.println(i+": "+processedIntensities[i][j]);
				}
			}
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy