Wave View Control


Click here for larger image

Introduction

This small control will help you if you want to draw wave file in your applications. This control can open ,play and draw any wave file saved in wave format but saved without any compression ( PCM Format ).

Usage

Note that this is not an ActiveX control. It is an MFC class. You can add it in your project and use it as you use any MFC class at runtime mode. You can use it with any type of projects like SDI and MDI or dialog based applications with this article a demo project that will help u to use this control. Also don't forgot to mail me if u faced any problem with control or to send your suggestion to me.

Thanks For Using My Code!!

Downloads

Download source - 7 Kb
Download demo project - 36 Kb


Comments

  • should change a little

    Posted by vinhie47 on 03/22/2007 03:11pm

    This code is so interesting. It's the code I need. But I think the code should change a little by replacing [b]lpvFile=::MapViewOfFile(m_hMap,FILE_MAP_READ,0,0,0);[/b] instead of [b]LPVOID lpvFile=::MapViewOfFile(m_hMap,FILE_MAP_READ,0,0,0);[/b] This will avoid some error when someone open a large file (certain hundred of MB) two times. Regards,

    Reply
  • Some Help.

    Posted by Legacy on 06/10/2003 12:00am

    Originally posted by: Lee

    I am interested in using your project but would like to know the functions of the .cpp

    CWaveFile.cpp
    DSound.cpp
    DSoundDoc.cpp
    DSoundView.cpp

    I am a beginner in MFC & would appreciate some help.
    I am trying to understand the code but is experiencing some hair splitting moments. Please help me.

    Reply
  • about time ruler

    Posted by Legacy on 02/25/2003 12:00am

    Originally posted by: BrianBin

    Hi
    I marked the DrawTimeRuler() at the OnPaint(),
    Why does it still draws the ruler?
    and the stack arround the variable a is not
    corrupted.....lucky~

    Reply
  • one run-time erro ....

    Posted by Legacy on 02/17/2003 12:00am

    Originally posted by: Brian Bin

    when I finished building the project(demo)
    
    and executed indebug level.
    I tried to import a file of speech (*.wav)
    before it comes out anything, it appears
    " stack arround variable a was corrupted "
    at the function:
    void CWaveViewCtrl::DrawTimeRuler(CPaintDC* PaintDC)
    in line 299 ....
    Can you help me about this?

    Reply
  • Whats wrong with DBSCAPS_CTRLDEFAULT

    Posted by Legacy on 02/16/2003 12:00am

    Originally posted by: Brian Bin

    I have downloaded the demo project source...
    and I tried to compile it under visual studio .net
    It showed some error messages like this:

    d:\Doc\Visual Studio Projects\DSound\WaveFile\CWaveFile.CPP(346): error C2065: 'DSBCAPS_CTRLDEFAULT' : Undeclared Identifier!

    someone would please tell me what's going on?
    and how to do? Thank you very much.

    • DBSCAPS_CTRLDEFAULT was removed from DirectX

      Posted by kberson on 11/29/2006 02:58pm

      DBSCAPS_CTRLDEFAULT was defined in dsound.h and was removed from the newer releases.
      
      Just replace it with 
      
      DSBCAPS_CTRLFREQUENCY | DSBCAPS_CTRLPAN | DSBCAPS_CTRLVOLUME

      Reply
    Reply
  • What is username and password for Sourcesafe...?

    Posted by Legacy on 01/10/2003 12:00am

    Originally posted by: Oceana

    i can`t open your source. Please teach me your username and password for Sourcesafe...
    

    Reply
  • Good Job !!

    Posted by Legacy on 06/28/2002 12:00am

    Originally posted by: Chris

    Your article and source codes are of great help for me. Thank you !

    Reply
  • Good Work :)

    Posted by Legacy on 06/22/2002 12:00am

    Originally posted by: Hasan Yasar Kazmi

    Ur artice was really useful, i am thankful to u for such a good article and code

    Reply
  • write back a wave file to the harddisk after changing it

    Posted by Legacy on 05/22/2002 12:00am

    Originally posted by: bin bin

    Dear Mohammed:
    I'm grateful for your providing a good example for us.
    I want to know how to write back the wave file to the harddisk after changing some samples of it.Would you please
    tell me how to realize it?
    Thank you
    bin bin


    Reply
  • How to Store 16 Bit PCM Wave

    Posted by Legacy on 05/06/2002 12:00am

    Originally posted by: Maria Jothi

    Hello Sir,

    My Query is Regarding PCM wave of 16 bits.

    After Recording , lpData of WAVEHDR contains the data.

    I had copied the lpData to char *buffer.

    Now , I need to store the data in a file.
    After writing Header information , I stored the data in the file as char (bytes by bytes).

    This works fine for 8 bit (both mono & stereo).

    I followed the same method for 16 bit .When I play the stored file ,noise also comes along with the recorded data .

    I read from some articles related to WAVE and came to know that 16 bit should be stored as short..
    If so , How can i store it ???

    Else , If you have someother idea,Please throw light on it.

    Thanks
    Maria

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Packaged application development teams frequently operate with limited testing environments due to time and labor constraints. By virtualizing the entire application stack, packaged application development teams can deliver business results faster, at higher quality, and with lower risk.

  • Live Event Date: September 17, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Another day, another end-of-support deadline. You've heard enough about the hazards of not migrating to Windows Server 2008 or 2012. What you may not know is that there's plenty in it for you and your business, like increased automation and performance, time-saving technical features, and a lower total cost of ownership. Check out this upcoming eSeminar and join Rich Holmes, Pomeroy's practice director of virtualization, as he discusses the …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds