Uses 1113K of libraries. Click here for Pure Java version (7294L/38K).
1 | !7 |
2 | |
3 | cm > DynImageSurface { |
4 | start-thread { |
5 | AudioRecognizer recognizer = new(1.0, new SineSoundSource(440), 1); |
6 | printVars(len := recognizer.mainSample.length(), amplitude := recognizer.mainSample.maxAmplitude()); |
7 | //ret recognizer.mainSample.render(); |
8 | |
9 | Var<Double> shift = new(0.0); |
10 | |
11 | repeatForNSeconds(10, r { |
12 | var tuned = recognizer.mainSample.sampleAt(439.5*2); |
13 | tuned = tuned.shift(shift!); |
14 | //print(tuned.firstPixels()); |
15 | setImage(tuned.render()); |
16 | //print(shift); |
17 | shift.set(shift! + 0.05); |
18 | }); |
19 | } |
20 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
Snippet ID: | #1032422 |
Snippet name: | Single-Frequency Audio Sampling With Shift Demo |
Eternal ID of this version: | #1032422/1 |
Text MD5: | efedfd182febd12d804b829348090c4f |
Transpilation MD5: | b1c087de31332559d0d1c4cb470819b9 |
Author: | stefan |
Category: | javax / audio recognition |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-09-03 05:02:57 |
Source code size: | 585 bytes / 20 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 167 / 311 |
Referenced in: | [show references] |