Java examples for javax.sound.sampled:Audio
save Audio Bytes To File
//package com.java2s; import javax.sound.sampled.*; import java.io.*; public class Main { public static void saveAudioBytesToFile(byte[] audio, AudioFormat audioFormat, AudioFileFormat.Type outputType, File outputFile) {// www . j a v a 2 s .c o m InputStream input = new ByteArrayInputStream(audio); AudioInputStream ais = new AudioInputStream(input, audioFormat, audio.length / audioFormat.getFrameSize()); try { AudioSystem.write(ais, outputType, outputFile); } catch (IOException ex) { ex.printStackTrace(); } } }