Click here to Skip to main content
12,622,291 members (32,712 online)
Click here to Skip to main content
Add your own
alternative version


222 bookmarked

Sound visualizer in C#

, 15 Aug 2007 GPL3
Rate this:
Please Sign up or sign in to vote.
Simple sound sampler with visualization
Screenshot - SoundViewer.jpg


This project demonstrates the use of the Fast Fourier Transform and Windows GDI to produce near real-time visualizations of the time and frequency domains of sound.


While looking for information on signal processing for a robotics project, it became apparent that examples written in C# were hard to find. This led me to create some of my own classes, which I have provided here for this demonstration.

Using the Code

Audio input for this demonstration is provided by the Wave classes developed by Ianier Munoz. Wave samples are further processed using the AudioFrame class.

class AudioFrame
    private Bitmap _canvasTimeDomain;
    private Bitmap _canvasFrequencyDomain;
    private double[] _waveLeft;
    private double[] _waveRight;
    private double[] _fftLeft;
    private double[] _fftRight;
    private SignalGenerator _signalGenerator;
    private bool _isTest = false;
    public AudioFrame(bool isTest)
        _isTest = isTest;

    /// <span class="code-SummaryComment"><summary>


This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


About the Author

Jeff Morton
Systems / Hardware Administrator
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 1 Pin
Metafunken3-Mar-15 3:13
memberMetafunken3-Mar-15 3:13 
GeneralRe: My vote of 1 Pin
Member 1150355227-May-15 5:58
memberMember 1150355227-May-15 5:58 
GeneralRe: My vote of 1 Pin
Metafunken30-Jul-15 5:26
memberMetafunken30-Jul-15 5:26 
Questionis y axis desibel or amplitude ? Pin
Member 1041172813-Oct-14 2:37
memberMember 1041172813-Oct-14 2:37 
Questionhow to open an existing wav file Pin
Member 228177120-Nov-13 12:12
memberMember 228177120-Nov-13 12:12 
GeneralMy vote of 5 Pin
Gun Gun Febrianza28-Aug-13 13:35
member Gun Gun Febrianza28-Aug-13 13:35 
QuestionNullReferenceException occured Pin
MA_hosseini28-Feb-13 1:53
memberMA_hosseini28-Feb-13 1:53 
AnswerRe: NullReferenceException occured Pin
k0ennn28-Feb-13 23:51
memberk0ennn28-Feb-13 23:51 
AnswerRe: NullReferenceException occured Pin
James Melkon Smith2-Mar-13 8:34
memberJames Melkon Smith2-Mar-13 8:34 
GeneralRe: NullReferenceException occured Pin
Gettor900012-Apr-13 0:42
memberGettor900012-Apr-13 0:42 
GeneralMy vote of 5 Pin
sanosay9-Aug-12 4:09
membersanosay9-Aug-12 4:09 
QuestionProblems with Windows 7 Pin
valeriopini13-Mar-12 1:51
membervaleriopini13-Mar-12 1:51 
GeneralMy vote of 1 Pin
rrossenbg12-Jan-12 6:33
memberrrossenbg12-Jan-12 6:33 
GeneralRe: My vote of 1 Pin
sanosay9-Aug-12 4:08
membersanosay9-Aug-12 4:08 
Questionwhat are the values representing in arrays? [modified] Pin
D__I___O31-Aug-11 1:11
memberD__I___O31-Aug-11 1:11 
Questionis this code possible to save as Wav or MP3 File after recording process Pin
myatthu198618-Aug-11 0:37
membermyatthu198618-Aug-11 0:37 
GeneralMy vote of 5 Pin
AlexB4716-Jun-11 0:02
memberAlexB4716-Jun-11 0:02 
Generali want to convert it into WPF Pin
vishal_h19-May-11 0:21
membervishal_h19-May-11 0:21 
GeneralProb with the frequency domain Pin
joeblogg6-Jan-11 9:03
memberjoeblogg6-Jan-11 9:03 
GeneralRe: Prob with the frequency domain Pin
Piligrim200729-Jan-11 6:31
memberPiligrim200729-Jan-11 6:31 
QuestionHow to get the frequency in real-time? Pin
gmajkun22-Dec-10 20:54
groupgmajkun22-Dec-10 20:54 
AnswerRe: How to get the frequency in real-time? Pin
Piligrim200729-Jan-11 6:37
memberPiligrim200729-Jan-11 6:37 
GeneralMy vote of 5 Pin
Dennis Betten3-Nov-10 2:41
memberDennis Betten3-Nov-10 2:41 
GeneralError Pin
dreje20106-Oct-10 0:53
memberdreje20106-Oct-10 0:53 
QuestionDoes this analyse the code with in milisecond accurancy? Pin
Rahdu15-Sep-10 10:50
memberRahdu15-Sep-10 10:50 

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.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161128.1 | Last Updated 15 Aug 2007
Article Copyright 2007 by Jeff Morton
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid