Announcement

Collapse
No announcement yet.

Convert Wav File to Numbers

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Convert Wav File to Numbers

    Group,

    Is there a method to convert the wav file to show the amplitude vs time data contained in the song ?

    I.E. to get the data of a wav file into Excel ?

    Marc
    Last edited by Craig Maier; 03-09-2019, 07:26 PM.

  • #2
    Hi,

    Isn't a .wav file per se really nothing but a string of numerical values and a file header?

    Craig
    "Who put orange juice in my orange juice?" - - - William Claude Dukenfield

    Comment


    • #3
      Craig/Group

      What then would be a tool to look at the actual values ?

      Marc

      Comment


      • #4
        I did put in a completely undocumented export feature to save the wave file as a csv or txt file.
        To do this
        1. Choose "File Save As"
        2. Then choose All Files (*.*) as the format option
        3. Then type in either .CSV or .TXT as the file name extension. (It will start out with a .*)



        This will save the wave file data (no header info) as text. Either one coulumn or two for stereo. Both txt and CSV produce the same format. Which looks like this
        0.0263398,-0.0325097
        -0.0325097,0.0335345
        0.0335345,0.0186791
        0.0186791,0.0293102

        The wave data is normalized to 1.0, so if you want the actual integer values you would need to multiply by the max bit weight (32767 for 16bit files)
        Rick

        Comment


        • #5
          Rick,

          "Are you sure you wanna do this ?"

          Thanks for the feature and the interesting comment for big files !

          Marc

          Comment


          • #6
            Rick,

            As a follow up, what is the easiest way to add in the time information ?

            Is it just the sample rate is say, 44.1 KHz so figure the time ?

            Marc

            Comment


            • #7
              Interesting stuff. thanks

              Dan
              Dan McDonald

              Comment


              • #8
                Group,

                So......I tried a 10 sec length of music at 44.1 KHz. When I imported the file into Excel, I saw 882014 rows.
                Shouldn't I have 441000 rows ?

                I tried 22 KHz sampling on a 10 sec song, and I got 440000 rows.

                I do not understand the factor of 2 that I'm seeing.

                Marc

                Comment


                • #9
                  Hi Group,

                  That is why I am personally against supporting this sort of stuff - - - it can get real ugly real fast. There are 10,000 questions that will pop up on this approach to using raw data. And, we do not have the resources to support the questions that will arise.

                  Suffice it to say that it is an undocumented feature which is not supported by Diamond Cut Productions, Inc.

                  Craig
                  Last edited by Craig Maier; 01-28-2013, 12:53 PM.
                  "Who put orange juice in my orange juice?" - - - William Claude Dukenfield

                  Comment


                  • #10
                    Craig,

                    Feel free to delete my question.

                    Marc

                    Comment


                    • #11
                      Marc
                      No problem, I took a quick look and there is a bug in the export function for stereo. It duplicates each stereo sample on the next channel.
                      Take a look a the short snippet of code i posted and you can see that it duplicates each values after the first one. Oh well, for now use mono files and that should work OK
                      Rick

                      Comment

                      Working...
                      X