1 | File m4a = assertFileExistsVerbose(fileContainingIC(m4aFiles(musicDir()), "jazz funk")); |
2 | File wav = replaceFileExtension(m4a, ".wav"); |
3 | //if (!fileExists(wav)) ffmpeg(m4a, wav); |
4 | var samples = extractMonoSamplesFromWAV(wav, 0.0, 1.0); |
5 | printVars(n := n2(l(samples)), min := shortMin(samples), max := shortMax(samples)); |
6 | AudioRecognizer recognizer = new(samples, 1); |
7 | print(amplitude := recognizer.mainSample.maxAmplitude()); |
8 | recognizer.normalize(); |
9 | printVars(len := recognizer.mainSample.length(), amplitude := recognizer.mainSample.maxAmplitude()); |
10 | recognizer.speedUp(10); |
11 | recognizer.normalize(); |
12 | printVars(len := recognizer.mainSample.length(), amplitude := recognizer.mainSample.maxAmplitude(), sampleRate := recognizer.mainSample.sampleRate()); |
13 | //ret recognizer.mainSample.graph(); |
14 | ret recognizer.mainSample.render(); |
15 | /*dm_showImage(simpleGraph(500, 100, x -> recognizer.mainSample.sampleSum(0, x, x+1), -32768, 32767));*/ |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
Snippet ID: | #1032417 |
Snippet name: | AudioRecognizer Scratchpad |
Eternal ID of this version: | #1032417/1 |
Text MD5: | e1ac55a231d33781cbcd50a6186fc360 |
Author: | stefan |
Category: | javax / audio recognition |
Type: | JavaX (incomplete) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-09-03 03:14:15 |
Source code size: | 938 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 149 / 157 |
Referenced in: | [show references] |