Audio frequency graph
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Audio frequency graph

  1. #1
    Join Date
    May 2012
    Posts
    3

    Audio frequency graph

    Hi masters in programming. I am a final year student in physics. I am trying to make an audio measurement program that will connect through a TMS320C542 DSKPLUS board from Texas Instrument by using C++ and i just started to do programming. I am so lost..

    I have this code with me that should show the graph of frequency when an audio is being recorded in real time. It cant really connect through a DSP yet because i still cant figure out how.

    This code i have should show the audio input's frequency through the PC soundcard. But then assertion failed error keep on coming out whenever i tried to build it. I am using Windows 98 OS pc and Visual Basic 6.0.

    This is the line that shows about assertion failed:

    }
    // Begin sampling
    m_bRecording = TRUE;
    m_hThread = CreateThread(NULL,NULL,RecorderThreadFunc,this,NULL,NULL);
    waveInStart(m_hWaveIn);
    ASSERT(m_hThread != NULL); (the line with assertion failed error)
    ;SetPriorityClass(m_hThread,REALTIME_PRIORITY_CLASS);
    SetThreadPriority(m_hThread,THREAD_PRIORITY_HIGHEST);
    }
    void Recorder::Stop()
    {
    if(!m_bDeviceOpen || !m_bRecording)
    return;
    if(waveInStop(m_hWaveIn) != MMSYSERR_NOERROR)
    return;
    else
    m_bRecording=FALSE;
    }

    And at the call stack view, there are these sentences that i cant understand:


    Recorder::Start() line 182 + 34 bytes
    CWaveInFFTDlg::OnInitDialog() line 212
    AfxDlgProc(HWND__ * 0x000009d8, unsigned int 272, unsigned int 2568, unsigned int 2568) line 35 + 14 bytes
    KERNEL32! bff7363b()
    KERNEL32! bff94407()

    And i would like to ask for suggestion on how to make it able to communicate with the target DSKPLUS board through a parallel port. The DSK board i been using is obsolete now so i cant get any help from the TI page..

    I've been googling for 3 months plus and still cant find the solution. Hope u all can help me

  2. #2
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,634

    Re: Audio frequency graph

    Since m_hThread is NULL the call to CreateThread failed. Call GetLastError to find out why.
    See http://msdn.microsoft.com/en-us/libr...53(VS.85).aspx
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    http://www.microsoft.com/visualstudio/eng/downloads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center