Click here to Skip to main content
15,891,136 members
Articles / Desktop Programming / ATL

MMWaveEditX - Advanced Wave File Editor Control

Rate me:
Please Sign up or sign in to vote.
4.25/5 (20 votes)
20 Aug 20012 min read 290.6K   6.4K   91   78
A control for editing wave files which uses peak values for visual display

Sample Image

Introduction

I have loads of ActiveX controls laying around that I have written.  Some seem somewhat useful, others are wasted drive space.  I came across this one the other day and decided somebody out there might be able to use it.

Audio programming is somewhat of a black art, it took me a while to figure out that "Peak" files are used by waveform editing software to visualize the waveform.

What are peak files? Well essentially you comb through a wave file and take snapshots of averages at different intervals.

The benefit is obvious, by using a peak file we can visualize a .wav file using a much smaller dataset than the 'pcm' data contained in it.

Here is an example: a .wav file whose size is 41.6 megabytes can be visualized with peak data totaling just under 333k. That is how we are able to do really fast zooms and selections on what is in reality a huge amount of data.

I tested my peak file algorithms against SoundForge ( a well known audio editor) and they come pretty close to matching the speed at which
a peak file can be built.

This control is not finished, has bugs, and in general should be used as a starting point for creating your own editor (or just as a learning tool). I do not have time to fully document (or partially) the code, so you will have to dig through it to figure it out (sorry).  I wrote this code more than a year ago and just by looking at it I can see numerous places for optimization.

The control itself contains all the visualization/wave file parsing/peak creation routines.  I included a dialog based app to show how you can use it.

Being a black art it is notoriously hard to find out how the sound coding wizards do the things they do, hopefully my little control will help you in some way.

You are free to use the code as you wish, just drop me an email if you use it in something interesting, extended its usefulness, hate me for not documenting it, love me for giving it away, just want to say "hey!".


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: from normal wav to EBU format Pin
dswigger29-Nov-02 15:49
dswigger29-Nov-02 15:49 
GeneralRe: from normal wav to EBU format Pin
Trollslayer5-Apr-04 12:54
mentorTrollslayer5-Apr-04 12:54 
Generalfiles not in my include folder Pin
Anonymous17-Jul-02 16:21
Anonymous17-Jul-02 16:21 
Generalfiles not in my include folder Pin
Anonymous17-Jul-02 16:20
Anonymous17-Jul-02 16:20 
GeneralProgram doesn't start Pin
1-Feb-02 4:38
suss1-Feb-02 4:38 
GeneralRe: Program doesn't start Pin
8-Feb-02 21:07
suss8-Feb-02 21:07 
GeneralRe: Program doesn't start Pin
9-Feb-02 18:36
suss9-Feb-02 18:36 
GeneralWave form not visible Pin
cyberman_7721-Aug-01 7:27
cyberman_7721-Aug-01 7:27 
I built your application on Win 2000 Advanced server using VC++ 6.0 SP3. I am unable to see the wave form in wave view window.
GeneralRe: Wave form not visible Pin
dswigger21-Aug-01 9:01
dswigger21-Aug-01 9:01 
GeneralRe: Wave form not visible Pin
cyberman_7721-Aug-01 18:03
cyberman_7721-Aug-01 18:03 
GeneralRe: Wave form not visible Pin
Jim A. Johnson21-Aug-01 18:13
Jim A. Johnson21-Aug-01 18:13 
GeneralRe: Wave form not visible Pin
22-Aug-01 2:51
suss22-Aug-01 2:51 
GeneralRe: Wave form not visible Pin
Jim A. Johnson22-Aug-01 3:51
Jim A. Johnson22-Aug-01 3:51 
GeneralRe: Wave form not visible Pin
dswigger22-Aug-01 3:03
dswigger22-Aug-01 3:03 
GeneralRe: Wave form not visible Pin
elettrozero16-Apr-03 23:06
elettrozero16-Apr-03 23:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.