locked
can we convert .wav file to text file

    Question

  • Hello dear 
    Can any one provide me code to convert wav file to Text data and how can i change the languageID from 1033 to 291. thanks in advance.

    With Regard
    Munish Bhargav 

    Wednesday, December 31, 2008 12:16 PM

Answers

  • SJ is correct - you do not want to convert the wav file to a text file - that would be meaningless.

    What you want to do is read or modify a specific portion of a wav file header - and that you can certainly do.  But you're going to have to know all about the wav format encoding so that you can decode it and change the appropriate values.

    I think you'll want to start here:  http://www.sonicspot.com/guide/wavefiles.html

    You'll want to start by reading the entire wav file into a byte array (System.IO.File.ReadAllBytes).  Then you will begin to read appropriate header values to determine where the chunk you want is located within the array.

    I think you're looking for the "Labeled Text Chunk".  You'll need to follow the specification to find this chunk within a given file, and then use the offset in the chart to write the appropriate 2-byte value back to the byte array.

    Once finished you can use File.WriteAllBytes to replace the original file with your modifications.
    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"
    • Marked as answer by Xingwei Hu Wednesday, January 07, 2009 5:35 AM
    Sunday, January 04, 2009 11:35 PM
    Moderator

All replies

  • What is a wave file converted to text? What do you expect the text to look like? What 'languageid' are you referring to?
    Stephen J Whiteley
    Wednesday, December 31, 2008 1:19 PM
    Moderator
  • Hi Munish,

    I think you maybe thinking of what is known as SPEECH RECOGNITION software so that when somebody says a word like "one" then the letters that spell the word are inserted into a TextBox or similar.


    Regards,

    John

    For links to VB.Net tutorials see here.>> http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/29f2179b-997b-4115-a96d-a0834853b835

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Get something FREE for your computer.
    The
    PROMOTIONAL code might still work so grab it now!!

    Click >>here<< for details. Do not forget to enter the
    PROMO code. J
    Happy New Year!!

     

    Saturday, January 03, 2009 4:32 PM
  • SJ is correct - you do not want to convert the wav file to a text file - that would be meaningless.

    What you want to do is read or modify a specific portion of a wav file header - and that you can certainly do.  But you're going to have to know all about the wav format encoding so that you can decode it and change the appropriate values.

    I think you'll want to start here:  http://www.sonicspot.com/guide/wavefiles.html

    You'll want to start by reading the entire wav file into a byte array (System.IO.File.ReadAllBytes).  Then you will begin to read appropriate header values to determine where the chunk you want is located within the array.

    I think you're looking for the "Labeled Text Chunk".  You'll need to follow the specification to find this chunk within a given file, and then use the offset in the chart to write the appropriate 2-byte value back to the byte array.

    Once finished you can use File.WriteAllBytes to replace the original file with your modifications.
    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"
    • Marked as answer by Xingwei Hu Wednesday, January 07, 2009 5:35 AM
    Sunday, January 04, 2009 11:35 PM
    Moderator