views:

528

answers:

2

Hello,

I am looking to be able to do life frequency detection in VB.net. I must say I don't really know where to begin here. I have looked into BASS.net, but that seems to only work with pre-recorded audio. I need to be able to detect the frequency of audio coming in over the line in or mic input in near real-time.

Thanks in advance.

+2  A: 

Perhaps NAudio, an open source .NET audio and MIDI library, can help. I would also check this CodeProject article for inspiration.

Dave Johnson
A: 

I have experience with BASS/C++ for live frequency detection. It basically goes like these in C++. I think you can easily find .NET equivalence:

Initialization:

    // initialize BASS recording (default device)
    if (!BASS_RecordInit(-1)) {
            LOG("Can't initialize device")
                    exit(-1);
    }

    // start recording (44100hz mono 16-bit)
    if (!(m_recChan = BASS_RecordStart(44100, 1, 0, &DuffRecording, 0))) {
            LOG("Can't start recording")

The timer is then set up to retrieve the frequency data for every 50ms. Here is the code used.

                    float fft[4096];
                    BASS_ChannelGetData(m_recChan, fft, BASS_DATA_FFT8192); // get the FFT data

Hope this helps.

m3rLinEz