1 | static double lengthOfWAVInSeconds(File wavFile) { |
2 | if (!fileExists(wavFile)) ret 0; |
3 | temp WAVDecoder decoder = new(fileInputStream(wavFile)); |
4 | short[] s = new short[1]; |
5 | int n = 0; |
6 | while (decoder.readMonoSamples(s) != 0) ++n; |
7 | ret n/decoder.sampleRate; |
8 | } |
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: | #1018661 |
Snippet name: | lengthOfWAVInSeconds (0 if file doesn't exist) |
Eternal ID of this version: | #1018661/3 |
Text MD5: | 71ddbdf2423ea2e1f8cf7470563fb3b9 |
Author: | stefan |
Category: | javax / audio |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-10-08 12:11:55 |
Source code size: | 269 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 396 / 422 |
Version history: | 2 change(s) |
Referenced in: | [show references] |