Coverting WAV file to ASCII

Discussion in 'VHDL' started by jahaya@gmail.com, Apr 7, 2005.

  1. Guest

    Hello All,

    I would like to know how can we convert the Audio file(.WAV) format to
    an ASCII file format. I wanted to use in audio processing using VHDL
    Implementation.

    Kindly suggest me a method for the same

    Regards,
    Ali
    , Apr 7, 2005
    #1
    1. Advertising

  2. On 7 Apr 2005 08:57:11 -0700, wrote:


    >I would like to know how can we convert the Audio file(.WAV) format to
    >an ASCII file format. I wanted to use in audio processing using VHDL
    >Implementation.


    Most VHDL simulators will allow you to read pure binary files
    by declaring them as FILE OF CHARACTER. Each character you
    read from the file can then be converted to its numeric (ASCII-code)
    equivalent using CHARACTER'POS(), and you can then process it any
    way you choose.

    Quick description of WAV file format (this took me about 30 sec
    to find with Google):

    http://www.ringthis.com/dev/wave_format.htm

    If you really want to convert .wav to ASCII text so you can read it
    as plain-text, which is quite a sensible thing to do, then I
    guess Tcl is probably your friend - its [binary scan] command
    is great for that kind of thing. If you are using ModelSim
    or another simulator that supports Tcl, you could do it
    from within the simulator itself.

    Alternatively Matlab has a .wav file reader; or you could
    write a bit of C to do it. I guess there must be a pile
    of freeware implementations of .wav readers out there, but
    I can't be bothered looking for them - it's probably quicker
    to write a Tcl script to do it.
    --
    Jonathan Bromley, Consultant

    DOULOS - Developing Design Know-how
    VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services

    Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
    Tel: +44 (0)1425 471223 mail:
    Fax: +44 (0)1425 471573 Web: http://www.doulos.com

    The contents of this message may contain personal views which
    are not the views of Doulos Ltd., unless specifically stated.
    Jonathan Bromley, Apr 7, 2005
    #2
    1. Advertising

  3. Leon Heller Guest

    <> wrote in message
    news:...
    > Hello All,
    >
    > I would like to know how can we convert the Audio file(.WAV) format to
    > an ASCII file format. I wanted to use in audio processing using VHDL
    > Implementation.
    >
    > Kindly suggest me a method for the same


    Get a copy of SOX (SOund eXchange). I think that can convert to ASCII. Or,
    convert to binary with it and write your own program to convert to ASCII.

    Leon
    Leon Heller, Apr 7, 2005
    #3
  4. Jim George Guest

    wrote:
    > Hello All,
    >
    > I would like to know how can we convert the Audio file(.WAV) format to
    > an ASCII file format. I wanted to use in audio processing using VHDL
    > Implementation.
    >
    > Kindly suggest me a method for the same
    >
    > Regards,
    > Ali
    >


    Use the binary read directly on the WAV file only if your design has no
    "state memory", ie, no recursive filters or something which can break
    with out-of-range data (the header can cause IIR filters to go crazy).

    If your design does maintain it's state, strip off the header (ignore,
    say, the first few hundred bytes).

    -Jim
    Jim George, Apr 8, 2005
    #4
  5. On Thu, 07 Apr 2005 23:27:47 -0600, Jim George
    <> wrote:

    >Use the binary read directly on the WAV file only if your design has no
    >"state memory", ie, no recursive filters or something which can break
    >with out-of-range data (the header can cause IIR filters to go crazy).
    >
    >If your design does maintain it's state, strip off the header (ignore,
    >say, the first few hundred bytes).


    That's a bit fragile - some WAV files contain multiple "chunks" with
    their own header information.

    The link I posted includes information on a program that will
    process "general" WAV files into the simpler format that works
    the way you suggest.
    --
    Jonathan Bromley, Consultant

    DOULOS - Developing Design Know-how
    VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services

    Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
    Tel: +44 (0)1425 471223 mail:
    Fax: +44 (0)1425 471573 Web: http://www.doulos.com

    The contents of this message may contain personal views which
    are not the views of Doulos Ltd., unless specifically stated.
    Jonathan Bromley, Apr 8, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JVSFugitive

    Coverting Ascii Hexidecimal Number

    JVSFugitive, Nov 3, 2004, in forum: Java
    Replies:
    3
    Views:
    3,355
    Thomas Weidenfeller
    Nov 3, 2004
  2. niels

    Coverting xml to PDF

    niels, Sep 12, 2003, in forum: XML
    Replies:
    1
    Views:
    377
  3. Narendra

    coverting EST to PST

    Narendra, Dec 21, 2005, in forum: Python
    Replies:
    0
    Views:
    353
    Narendra
    Dec 21, 2005
  4. MostafaSayed

    Help in coverting image formats

    MostafaSayed, Jun 25, 2007, in forum: .NET
    Replies:
    0
    Views:
    335
    MostafaSayed
    Jun 25, 2007
  5. '2+
    Replies:
    2
    Views:
    472
Loading...

Share This Page