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:
[email protected]
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.