Waveform display

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am currently rewriting an application originally developped in VC++ that
plays a .wav file and displays a representation of the waveform as it is
played (with a marker indicating current position in the audio file); making
use of DirectX9.

So far I am able to load and play, stop and resume play of a sample .wav
file. I am making use of a previously developed user control that is capable
of displaying the waveform (statically), scrolling form right to left,
zooming in and out, etc.

The control currently displays a portion of the waveform (with the marker
and starting postion in the center of the control), and the scrolling
triggers a Refresh() which calls my draw method using Drawline(pen,
X1,Y1,X2,Y2). The control will also need to play and display at variable
speeds, rewind and fast forward. I need to be able to synchronize the play
position in the audio file and the relative marker position on the control.

My question is this: Am I missing the boat completely? Is there an easier
way to do this in C# or am I on the right track and just have a little more
work ahead of me? I would appreciate links, tips, source code samples,
anything at all.

Thanks in advance,
Aaron N.
 
Thanks for the reply,

I can play the wav file, control the volume and the balance etc. That's all
provided in the DirectX9 samples.

What I need to do now is build a visual component that displays the waveform
and can (as accurately as possible) indicate where I am in the file. I am
standing on the shoulders of another developer here that wrote a
"WaveControl" user control that statically displays the waveform and can do
things like scroll and zoom. I'm trying to build on it and synchronize it
with the playing of the audio to indicate relative position.

I guess what I'm trying to avoid is re-inventing the wheel... if it's been
done before, I'd really like to save time on this portion of the project.

Thanks for the input.
Aaron N.


Dan Bass said:
Been a while since I looked at wav and multimedia stuff... Have you googled
on this? I did and found quite a lot of stuff...

http://www.google.co.uk/search?sour...GGLD,GGLD:2004-35,GGLD:en&q=wav+files+play+c#
[beware of line breaks]



Aaron N. said:
I am currently rewriting an application originally developped in VC++ that
plays a .wav file and displays a representation of the waveform as it is
played (with a marker indicating current position in the audio file);
making
use of DirectX9.

So far I am able to load and play, stop and resume play of a sample .wav
file. I am making use of a previously developed user control that is
capable
of displaying the waveform (statically), scrolling form right to left,
zooming in and out, etc.

The control currently displays a portion of the waveform (with the marker
and starting postion in the center of the control), and the scrolling
triggers a Refresh() which calls my draw method using Drawline(pen,
X1,Y1,X2,Y2). The control will also need to play and display at variable
speeds, rewind and fast forward. I need to be able to synchronize the play
position in the audio file and the relative marker position on the
control.

My question is this: Am I missing the boat completely? Is there an easier
way to do this in C# or am I on the right track and just have a little
more
work ahead of me? I would appreciate links, tips, source code samples,
anything at all.

Thanks in advance,
Aaron N.
 
Back
Top