Uses 343K of libraries. Click here for Pure Java version (3430L/19K).
1 | !include once #1018630 // Spectro Edit |
2 | |
3 | import javax.sound.sampled.*; |
4 | |
5 | // I guess the ranges are in spectro-edit frames (44.1/1024Khz by default) |
6 | svoid spectro_intRangesToWAV(Clip clip, L<IntRange> parts, File wavFile) ctex {
|
7 | new L<InputStream> l; |
8 | int frames = 0; |
9 | for (IntRange r : parts) {
|
10 | if (nempty(l)) {
|
11 | int n = 44100/2; // half a second |
12 | l.add(ZerosInputStream(n*2)); |
13 | frames += n; |
14 | } |
15 | int n = r.length()*clip.getFrameTimeSamples(); |
16 | l.add(clip.getAudio(r.start*clip.getFrameTimeSamples(), n)); |
17 | frames += n; |
18 | } |
19 | writeInputStreamsToWAV(l, frames, wavFile); |
20 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1018636 |
| Snippet name: | spectro_intRangesToWAV |
| Eternal ID of this version: | #1018636/14 |
| Text MD5: | e839939aa4d746710b1d49729d325101 |
| Transpilation MD5: | aee140ef1ddd55fa148225af46d299b2 |
| Author: | stefan |
| Category: | javax / audio recognition |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-09-05 03:22:32 |
| Source code size: | 622 bytes / 20 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 660 / 795 |
| Version history: | 13 change(s) |
| Referenced in: | [show references] |