Libraryless. Click here for Pure Java version (3577L/20K).
1 | // times are in seconds |
2 | static short[] extractMonoSamplesFromWAV(File/S wavFile, double startTime, double endTime) ctex { |
3 | if (wavFile == null) null; |
4 | temp WAVDecoder decoder = new(newFileInputStream(wavFile)); |
5 | long start = round(startTime*decoder.sampleRate); |
6 | long end = round(endTime*decoder.sampleRate); |
7 | decoder.skipSamples(start); |
8 | ret decodeWAVToMonoSamples(decoder, end-start); |
9 | } |
Began life as a copy of #1019662
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
Snippet ID: | #1032404 |
Snippet name: | extractMonoSamplesFromWAV |
Eternal ID of this version: | #1032404/7 |
Text MD5: | ec1fdf4902d1e7e23c176338bb581428 |
Transpilation MD5: | 30c7c6d8dd3957738b77cf29a7d65bfc |
Author: | stefan |
Category: | javax / sound |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-09-03 01:26:58 |
Source code size: | 402 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 158 / 237 |
Version history: | 6 change(s) |
Referenced in: | [show references] |