Audio data from array to .wav
807606Apr 2 2007 — edited Apr 2 2007Hello!
I am trying to make a .wav file that will contain audio data from a byte array
I have used the following code (the array is called newBuffer)
The .wav file is created, but it's not 'filled' with data (actually, the size of it is stuck at 9.8 KB :P). When I try to open it from an audio player it opens without error messages (but obviously I can't hear anything..)
Any ideas? Merci :)
ByteArrayInputStream bis=new ByteArrayInputStream(newBuffer);
AudioInputStream ais=new AudioInputStream(bis,audioFormat,newBuffer.length/audioFormat.getFrameSize());
AudioSystem.write(ais,AudioFileFormat.Type.WAVE,new File("16bitThres.wav"));
Message was edited by:
miss_elec