source: java/aubio/main.java @ e3e9368

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since e3e9368 was 90a59c3, checked in by Paul Brossier <piem@piem.org>, 17 years ago

java/: added first draft for a java interface to aubio, includes simple test

  • Property mode set to 100644
File size: 461 bytes
Line 
1// main.java
2
3public class main {
4  static {
5    System.loadLibrary("aubiowrapper");
6  }
7
8  public static void main(String argv[]) {
9    float freq = (float)440.;
10    float midi = aubiowrapper.aubio_freqtomidi( (float)440.);
11    if (midi != (float) 69.0) {
12      throw new Error((String) "Error: aubio_freqtomidi(440.) != 69.", null);
13    }
14    System.out.print(freq);
15    System.out.print(" Hz corresponds to midi note ");
16    System.out.println(midi);
17  }
18}
19
Note: See TracBrowser for help on using the repository browser.