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: | 629 / 1184 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |