1 | static int similarityToClippedRecordings_h = 20; |
2 | |
3 | // audioFile must already be clipped |
4 | static Map<S, Float> similarityToClippedRecordings(File audioFile) { |
5 | BWImage img = audioFileToFrequencyImage(audioFile); |
6 | new Map<S, Float> map; |
7 | img = smoothResizeBWImage_heightOnly(img, similarityToClippedRecordings_h); |
8 | for (File f2 : clippedNamedRecordings()) { |
9 | if (sameFile(audioFile, f2)) continue; |
10 | BWImage img2 = audioFileToFrequencyImage(f2); |
11 | img2 = smoothResizeBWImage_heightOnly(img2, similarityToClippedRecordings_h); |
12 | float sim = bwImageSimilarityResized_ignoreRatioMismatch(img, img2, 0f); |
13 | print(formatDoubleX(sim*100, 2) + "%: " + f2.getName()); |
14 | map.put(f2.getName(), sim); |
15 | } |
16 | ret mapSortedByValuesDesc(map); |
17 | } |
Began life as a copy of #1018640
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1018641 |
Snippet name: | similarityToClippedRecordings (named recordings only) |
Eternal ID of this version: | #1018641/14 |
Text MD5: | 74929b5aac892a41112e6399bf534235 |
Author: | stefan |
Category: | javax / audio recognition |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-10-08 11:46:49 |
Source code size: | 758 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 344 / 418 |
Version history: | 13 change(s) |
Referenced in: | [show references] |