Results 1 to 6 of 6

Thread: How to extract info from a .wav file?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Dallas, TX
    Posts
    89
    Does anyone know how to extract data from a .wav file.
    I dl a trial version of a program to convert an mp3 to
    a wave file. But after the 30th time it adds some stuff
    to the file that I don't want. And I need to know how to
    get rid of it. Any suggestions would be appreciared.

    Thanks
    ande211

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Cool

    In the beginning of the file, there are 44 bytes, that tells you what length the file is, the frequency, bit sample rate, and channels. If the length doesn't match the files length, it will not work. The length is stored in two places, in &H100^x style so it's easy to retrieve them. The rest of the file doesn't matter what it contains, cuz it's 16bit or 8bit binary data which means all ascii are used.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Dallas, TX
    Posts
    89

    kedaman or anyone, help with .wav file???

    kedaman,

    I appreciate your response to my post. But could you show me how I can extract the data from a wave file. Get rid of what I don't need, and only keep what I do need.

    Thanks
    ande211

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Arrow

    Then you should open the wavfile in binary, get everything from the 45 byte into a string or byte array. Do you need code or something?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Dallas, TX
    Posts
    89
    Yes I do need some code, if you wouldn't mind.

    Thanks
    ande211

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Post

    Code:
        Open File$ For Binary As x#
            filebuffer$ = Space(LOF(x#) - 45)
            Get #x#, 45, filebuffer$
        Close #x
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

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



Click Here to Expand Forum to Full Width