Results 1 to 4 of 4
  1. #1
    Nox997 is offline Member
    Join Date
    Oct 2011
    Posts
    2
    Rep Power
    0

    Default 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!

  2. #2
    jammas615 is offline Senior Member
    Join Date
    Jul 2011
    Location
    Melbourne, Victoria, Australia
    Posts
    155
    Rep Power
    4

    Default 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.

  3. #3
    Nox997 is offline Member
    Join Date
    Oct 2011
    Posts
    2
    Rep Power
    0

    Default 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?

  4. #4
    jammas615 is offline Senior Member
    Join Date
    Jul 2011
    Location
    Melbourne, Victoria, Australia
    Posts
    155
    Rep Power
    4

Similar Threads

  1. how to write the String Array into the own file
    By nirasiva in forum New To Java
    Replies: 2
    Last Post: 06-16-2011, 08:13 AM
  2. How to create wave file from the datainputstream
    By rajan701v in forum Advanced Java
    Replies: 15
    Last Post: 06-05-2011, 12:41 PM
  3. Replies: 7
    Last Post: 04-26-2011, 04:27 PM
  4. Play wave file out of a jar file
    By schliz in forum Advanced Java
    Replies: 2
    Last Post: 12-03-2009, 02:37 PM
  5. How to write text file into Array
    By venkat.ravala in forum New To Java
    Replies: 13
    Last Post: 11-19-2009, 05:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •