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

12
LINES

< > BotCompany Repo | #1018608 // multiShortArraysToWAVE

JavaX fragment (include)

import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.UnsupportedAudioFileException;

static void multiShortArraysToWAVE(L<short[]> chunks, File wavFile, O... params) ctex {
  AudioFormat format = optPar(params, format := javaSound_cdQuality());
  temp AudioInputStream sourceStream = new AudioInputStream(new MultiShortArrayInputStream(chunks), format, lengthLevel2_shortArrays(chunks)/format.getChannels());
  temp AudioInputStream stream = AudioSystem.getAudioInputStream(format, sourceStream);
  AudioSystem.write(stream, AudioFileFormat.Type.WAVE, mkdirsForFile(wavFile));
}

Author comment

Began life as a copy of #1007036

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: #1018608
Snippet name: multiShortArraysToWAVE
Eternal ID of this version: #1018608/6
Text MD5: 0ab378b29fa2387c943de5be11c05d08
Author: stefan
Category: javax / speech
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-17 21:30:54
Source code size: 734 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 311 / 377
Version history: 5 change(s)
Referenced in: [show references]