Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

33
LINES

< > BotCompany Repo | #1009760 // Test musicg on some sounds

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 70K of libraries. Click here for Pure Java version (2430L/17K).

1  
!7
2  
3  
lib 1009752 // musicg
4  
5  
import com.musicg.wave.Wave;
6  
import com.musicg.fingerprint.FingerprintSimilarity;
7  
8  
static new L<S> names;
9  
static new L<Wave> waves;
10  
11  
p {
12  
  ZipFile zip = new ZipFile(loadLibrary(#1009759));
13  
  for (S name : names = fileNamesInZip(zip))
14  
    waves.add(new Wave(zipInputStream(zip, name)));
15  
    
16  
  names.add("computer-2.wav");
17  
  waves.add(new Wave(f2s(loadLibrary(#1009763))));
18  
  
19  
  printStruct("Comparing: ", names);
20  
  
21  
  for (int i = 0; i < l(waves); i++)
22  
    for (int j = 0; j < l(waves); j++) {
23  
      if (i == j) continue;
24  
      Wave w1 = waves.get(i), w2 = waves.get(j);
25  
      FingerprintSimilarity fps = w1.getFingerprintSimilarity(w2);
26  
      float score = fps.getScore();
27  
      float sim = fps.getSimilarity();
28  
      if (sim == 0) continue;
29  
      print(names.get(i) + "/" 
30  
        + names.get(j) + " score: " + score + (score == sim ? "" : " / " + sim));
31  
    }
32  
    
33  
}

Author comment

Began life as a copy of #1009756

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, hszllmzzlmie, imzmzdywqqli, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009760
Snippet name: Test musicg on some sounds
Eternal ID of this version: #1009760/5
Text MD5: 6dbc4b06877f0200b93084ae986eabe3
Transpilation MD5: 46ce2ace397e1fb6e234d5257bcd1915
Author: stefan
Category: javax / audio
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-16 03:22:06
Source code size: 928 bytes / 33 lines
Pitched / IR pitched: No / No
Views / Downloads: 431 / 960
Version history: 4 change(s)
Referenced in: [show references]