Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

8
LINES

< > BotCompany Repo | #1026968 // wavToMP3UsingStreamingEncoder

JavaX fragment (include) [tags: use-pretranspiled]

Uses 348K of libraries. Click here for Pure Java version (3404L/22K).

1  
svoid wavToMP3UsingStreamingEncoder(File wav, File mp3) ctex {
2  
  temp WAVDecoder decoder = new(newFileInputStream(wav));
3  
  time "Decode WAV" {
4  
    short[] samples = decodeWAVToMonoSamples(decoder, wav);
5  
  }
6  
  temp StreamingMP3Encoder encoder = new(mp3, decoder.sampleRate);
7  
  encoder.addData(samples);
8  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026968
Snippet name: wavToMP3UsingStreamingEncoder
Eternal ID of this version: #1026968/3
Text MD5: 4ec961c2ca2c69d6197397deb7272076
Transpilation MD5: caa73f8f5cb5b8d77f1dae88d346017d
Author: stefan
Category: javax / audio
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-05 00:11:16
Source code size: 310 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 222 / 312
Version history: 2 change(s)
Referenced in: [show references]