做音频播放器,需要显示当前声音的变化曲线,也就是要实时显示波形,简单的波形曲线和柱状图都试过了,但是不够酷
哪位大侠有看起来酷的算法或者代码,有原理也行,最好要效率高的 

解决方案 »

  1.   

    Quote=引用 2 楼 lanhai 的回复:]
    就是屏保那个么 不怎么好看吧  就几个线来回走,而且这个示波器的显示区域比较小
    [/Quote]贝塞尔曲线是示波器上最常用的了 主要是比较平滑
     {   
            HDC                                 hdc;   
            PAINTSTRUCT                 ps;   
        
            //   Start   a   paint   session,   and   create   a   Graphics   object.   
            hdc   =   BeginPaint(hWnd,   &ps);   
            Graphics   graphics(hdc);   
        
            //   Set   up   the   pen   and   curve   points.   
            Pen   greenPen(Color::Green);   
            Point   startPoint(100,   100);   
            Point   controlPoint1(200,   10);   
            Point   controlPoint2(350,   50);   
            Point   endPoint(500,   100);   
        
            //Draw   the   curve.   
            graphics.DrawBezier(&greenPen,   startPoint,   controlPoint1,   controlPoint2,   endPoint);   
        
            //Draw   the   end   points   and   control   points.   
            graphics.FillEllipse(&SolidBrush(Color::Red),   100,   100,   10,   10);   
            graphics.FillEllipse(&SolidBrush(Color::Red),   500,   100,   10,   10);   
            graphics.FillEllipse(&SolidBrush(Color::Blue),   200,   10,   10,   10);   
            graphics.FillEllipse(&SolidBrush(Color::Blue),   350,   50,   10,   10);   
              
        
            //End   the   paint   session.   
            EndPaint(hWnd,   &ps);   
      } 
    [
      

  2.   

    看看这个开源工程吧?
    里面很多很多音频的知识
    Audacity
      

  3.   

    Audacity 一年前就看过 没啥好看的波形
      

  4.   

    ,顶!
    顺便说下,以前折腾 Delphi 的时候做个播放器,有个 bass.dll 可以达到 lz 想要的效果,
    不过是收费的。
    你可以网上找好看