1 | import javax.sound.sampled.AudioFileFormat; |
2 | import javax.sound.sampled.AudioFormat; |
3 | import javax.sound.sampled.AudioInputStream; |
4 | import javax.sound.sampled.AudioSystem; |
5 | import javax.sound.sampled.UnsupportedAudioFileException; |
6 | import javazoom.spi.mpeg.sampled.file.MpegFileFormatType; |
7 | |
8 | static void audioCopyToMP3(File inputFile, File outputFile, AudioFormat outputFormat) ctex { |
9 | AudioInputStream sourceStream = AudioSystem.getAudioInputStream(inputFile); |
10 | AudioInputStream stream = AudioSystem.getAudioInputStream(outputFormat, sourceStream); |
11 | int nWrittenBytes = AudioSystem.write(stream, MpegFileFormatType.MP3, outputFile); |
12 | sourceStream.close(); |
13 | stream.close(); |
14 | } |
Began life as a copy of #1006990
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1007048 |
Snippet name: | audioCopyToMP3 - convert an audio file |
Eternal ID of this version: | #1007048/2 |
Text MD5: | f31132582aaeea0733c03e305b4ebec8 |
Author: | stefan |
Category: | javax / audio |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-02-26 14:28:53 |
Source code size: | 687 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 404 / 453 |
Version history: | 1 change(s) |
Referenced in: | [show references] |