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

14
LINES

< > BotCompany Repo | #1018815 // Audio_TwoWordAnalyzer1

JavaX fragment (include)

1  
sclass Audio_TwoWordAnalyzer1 {
2  
  static int baseSize = 1024;
3  
  
4  
  S word1, word2;
5  
  Rect rect; // in baseSize*baseSize
6  
  float threshold;
7  
  
8  
  S analyze(BWImage img) {
9  
    Rect r = rescaleRect(rect, baseSize, baseSize, img.getWidth(), img.getHeight());
10  
    double b = clipBWImage(img, r).averageBrightness();
11  
    //print(r + " => " + b);
12  
    ret b >= threshold ? word1 : word2;
13  
  }
14  
}

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: #1018815
Snippet name: Audio_TwoWordAnalyzer1
Eternal ID of this version: #1018815/3
Text MD5: 72ffb2fe13d3566e31c6575c67cb7fd4
Author: stefan
Category: javax / audio
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-13 22:40:42
Source code size: 397 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 377 / 927
Version history: 2 change(s)
Referenced in: [show references]