How to write a float array of audio samples to a wave file?
Hello!
Is it possible to write an array of floats, say exactly 8192 floats, to an audio wav file?
I tried to figure this out using some official tutorials on the java websites, and tried to "convert" my float array to an AudioInputStream - however this failed, as I am new to Java and don't yet understand how streams work.
So the functionality I try to implement is the following:
I have a while loop, and with each while loop, the float array of audio samples is filled with new audio samples. I want to "append" these samples to a wave file, and eventually close that file after exiting the while loop.
I am thankful for any help you could offer!
Re: How to write a float array of audio samples to a wave file?
Streams are probably your best bet. And using output streams, your going to have to learn it all at somestage anyway.
Re: How to write a float array of audio samples to a wave file?
Thank you for your answer...
But how do I know how a wav file is organized? How do I specify in which way the data is written to the file?
Re: How to write a float array of audio samples to a wave file?