Libraryless. Click here for Pure Java version (2229L/14K).
1 | // returns factor |
2 | static double normalizeShortArrays(L<short[]> l) { |
3 | int max = min(32767, absShortMax_multipleArrays(l)); |
4 | if (max == 0 || max == 32767) ret 1; |
5 | double factor = 32767.0/max; |
6 | for (short[] a : l) |
7 | for i over a: |
8 | a[i] = roundToShort(a[i]*factor); |
9 | ret factor; |
10 | } |
Began life as a copy of #1026911
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027010 |
Snippet name: | normalizeShortArrays (does it in place) |
Eternal ID of this version: | #1027010/5 |
Text MD5: | c661be28e8e5997b0a42d250eb18f724 |
Transpilation MD5: | 27cf990c059ec959581e5837bf08c326 |
Author: | stefan |
Category: | javax / audio recognition |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-02-07 00:03:05 |
Source code size: | 298 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 281 / 395 |
Version history: | 4 change(s) |
Referenced in: | [show references] |