Convert .wav (sound) to Graphic (jpg etc.) using delphi: Wav to binary -> Interperate binary-> Number to points-> Join points and draw

fatihbarut
fatihbarut used Ask the Experts™
on
Hi,
Briefly I want to do what matlab do. Or what echolizers do using delphi
Is it possible to convert .wav files to graphic like I summirized in the header of this message...
Thank you

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Your description is a bit confusing, especially the conversion process. You want to graph the sample values from the WAV file, plotting sound waves basically?

Author

Commented:
Hi
I want to convert a short wav file to the jpg picture like  I attached
untitled.jpg

Commented:
Are these just plotted samples values in time domain? What are both axes mean?

If it is just samples, then it is simple. All you gotta do is read in wav file, which is relatively easy since it is not compressed. Then add them to a chart (TChart, comes with every Delphi I think). Do you need a hand with reading in the wav file?
Announcing the Winners!

The results are in for the 15th Annual Expert Awards! Congratulations to the winners, and thank you to everyone who participated in the nominations. We are so grateful for the valuable contributions experts make on a daily basis. Click to read more about this year’s recipients!

Author

Commented:
Dear den4b I really liked your approach

Could you explain little bit please, especially how can I do that with codes because I have never done that before thank you.

Not: Lets say our wav file is sample.wav

I need the codes below
1- Reading the wav file as binary
2- Adding binary datas into chart.
Thank you
Commented:
The code for adding points to a chart is simple. Just add TChart component, double-click it and add a new series. Lets imagine that you called an instance Chart1:TChart. Here is how you add a point to a chart:
Chart1.Series[0].AddY(SampleValue);


When it comes to reading WAV files, you might be underestimating the amount of work involved here. It is not hard, but it is more than couple lines of code. If your programming skills are better than average, just search for "WAVE file format" and you'll get loads of technical info about reading WAV files. Below are couple of links for you to get started:
https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
http://www.sonicspot.com/guide/wavefiles.html


If that's too much, than find some free components on the net which read WAV files, there is a good bunch of them. 
http://www.torry.net/pages.php?id=167


Author

Commented:
Quote
"you might be underestimating wav file reading"

Yes you are right therefore I changed my way to get professional components help. And get one which is called mmtools

Thank you...
I dont need this subject anymore and I dont want to make point distrubition

Commented:
Suit yourself.
I've put in enough effort that usually is worth the points.

Author

Commented:
I find another way to solve my problem and abondan this subject, and this subject was very easy and not worth 4x500 point therefore I give C grade

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial