Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Coverting WAV file to ASCII

 
Thread Tools Search this Thread
Old 04-07-2005, 04:57 PM   #1
Default Coverting WAV file to ASCII


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



jahaya@gmail.com
  Reply With Quote
Old 04-07-2005, 05:34 PM   #2
Jonathan Bromley
 
Posts: n/a
Default Re: Coverting WAV file to ASCII
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
  Reply With Quote
Old 04-07-2005, 08:53 PM   #3
Leon Heller
 
Posts: n/a
Default Re: Coverting WAV file to ASCII
<> wrote in message
news: oups.com...
> 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
  Reply With Quote
Old 04-08-2005, 06:27 AM   #4
Jim George
 
Posts: n/a
Default Re: Coverting WAV file to ASCII
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
  Reply With Quote
Old 04-08-2005, 09:16 AM   #5
Jonathan Bromley
 
Posts: n/a
Default Re: Coverting WAV file to ASCII
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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
SONY DVD RW DW-G120A SOMETIMES FAILS...... atlantic965 DVD Video 0 06-18-2006 10:36 PM
problems backing up dvds Lawrence Traub DVD Video 11 09-27-2005 07:34 PM
Re: Ripping DVDs. Please answer the attached question. - Question.txt Stan Brown DVD Video 19 02-09-2005 11:19 PM
Burn process failed - help! Log file posted for help troubleshooting Michael Mason DVD Video 1 08-16-2004 09:24 PM
Pioneer A05 Problems Bill Stock DVD Video 8 11-28-2003 05:03 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46