Uses 11463K of libraries. Click here for Pure Java version (2575L/16K).
1 | !include once #1017982 // JAVE/ffmpeg |
2 | |
3 | svoid wavToMP3_128k(File wav, File mp3) ctex { |
4 | new AudioAttributes audio; |
5 | audio.setCodec("libmp3lame"); |
6 | audio.setBitRate(128000); |
7 | audio.setChannels(2); |
8 | audio.setSamplingRate(44100); |
9 | new EncodingAttributes attrs; |
10 | attrs.setFormat("mp3"); |
11 | attrs.setAudioAttributes(audio); |
12 | print("Converting " + f2s(wav) + " to " + f2s(mp3)); |
13 | new Encoder().encode(wav, mp3, attrs); |
14 | print(" [done]"); |
15 | } |
16 | |
17 | static File wavToMP3_128k(File wav) { |
18 | File out = replaceExtension(wav, "wav", "mp3"); |
19 | wavToMP3_128k(wav, out); |
20 | ret out; |
21 | } |
Began life as a copy of #1013799
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1013801 |
Snippet name: | wavToMP3_128k |
Eternal ID of this version: | #1013801/8 |
Text MD5: | f5b367772732fead685b190070b75a6d |
Transpilation MD5: | dc27eb6848039adf64d6044e405ae043 |
Author: | stefan |
Category: | javax / audio |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-09-27 17:31:35 |
Source code size: | 591 bytes / 21 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 405 / 502 |
Version history: | 7 change(s) |
Referenced in: | [show references] |