Results 1 to 4 of 4
- 10-06-2011, 11:37 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 2
- Rep Power
- 0
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!
- 10-06-2011, 11:44 PM #2
Senior Member
- Join Date
- Jul 2011
- Location
- Melbourne, Victoria, Australia
- Posts
- 155
- Rep Power
- 2
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.
- 10-07-2011, 12:07 AM #3
Member
- Join Date
- Oct 2011
- Posts
- 2
- Rep Power
- 0
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?
- 10-07-2011, 12:39 AM #4
Senior Member
- Join Date
- Jul 2011
- Location
- Melbourne, Victoria, Australia
- Posts
- 155
- Rep Power
- 2
Re: How to write a float array of audio samples to a wave file?
Read these:
This one has a massive FAQ: Java Sound Resources: FAQ: Audio Programming
And then these two:
computermusicblog.com » Blog Archive » Reading and Writing WAV Files in Java
Reading and Writing Samples from Audio Files in Java
Similar Threads
-
how to write the String Array into the own file
By nirasiva in forum New To JavaReplies: 2Last Post: 06-16-2011, 07:13 AM -
How to create wave file from the datainputstream
By rajan701v in forum Advanced JavaReplies: 15Last Post: 06-05-2011, 11:41 AM -
Getting error when trying to read file into float array
By tinaman in forum New To JavaReplies: 7Last Post: 04-26-2011, 03:27 PM -
Play wave file out of a jar file
By schliz in forum Advanced JavaReplies: 2Last Post: 12-03-2009, 01:37 PM -
How to write text file into Array
By venkat.ravala in forum New To JavaReplies: 13Last Post: 11-19-2009, 04:59 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks