Libraryless. Click here for Pure Java version (4000L/23K).
1 | static IQuerySound shortSamplesToQuerySound(int channels default 1, short[] samples) { |
2 | ret new IQuerySound { |
3 | public int channels() { ret channels; } |
4 | |
5 | // time is in samples |
6 | public double getSample(int channel, double time) { |
7 | int t = ifloor(time); |
8 | t /= channels; |
9 | ret t < 0 || t >= l(samples) ? 0 : samples[t]; |
10 | } |
11 | }; |
12 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033251 |
Snippet name: | shortSamplesToQuerySound |
Eternal ID of this version: | #1033251/2 |
Text MD5: | 594beb40e6e5c5689deaeeb233540d63 |
Transpilation MD5: | 9b296aaf04e6ad714ad2d9080a1cc535 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-17 21:08:54 |
Source code size: | 367 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 156 / 216 |
Version history: | 1 change(s) |
Referenced in: | [show references] |