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

14
LINES

< > BotCompany Repo | #1018815 // Audio_TwoWordAnalyzer1

JavaX fragment (include)

sclass Audio_TwoWordAnalyzer1 {
  static int baseSize = 1024;
  
  S word1, word2;
  Rect rect; // in baseSize*baseSize
  float threshold;
  
  S analyze(BWImage img) {
    Rect r = rescaleRect(rect, baseSize, baseSize, img.getWidth(), img.getHeight());
    double b = clipBWImage(img, r).averageBrightness();
    //print(r + " => " + b);
    ret b >= threshold ? word1 : word2;
  }
}

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: 378 / 928
Version history: 2 change(s)
Referenced in: #1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674)