Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1032417 // AudioRecognizer Scratchpad

JavaX (incomplete)

File m4a = assertFileExistsVerbose(fileContainingIC(m4aFiles(musicDir()), "jazz funk"));
File wav = replaceFileExtension(m4a, ".wav");
//if (!fileExists(wav)) ffmpeg(m4a, wav);
var samples = extractMonoSamplesFromWAV(wav, 0.0, 1.0);
printVars(n := n2(l(samples)), min := shortMin(samples), max := shortMax(samples));
AudioRecognizer recognizer = new(samples, 1);
print(amplitude := recognizer.mainSample.maxAmplitude());
recognizer.normalize();
printVars(len := recognizer.mainSample.length(), amplitude := recognizer.mainSample.maxAmplitude());
recognizer.speedUp(10);
recognizer.normalize();
printVars(len := recognizer.mainSample.length(), amplitude := recognizer.mainSample.maxAmplitude(), sampleRate := recognizer.mainSample.sampleRate());
//ret recognizer.mainSample.graph();
ret recognizer.mainSample.render();
/*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: 147 / 155
Referenced in: [show references]