This project has moved and is read-only. For the latest updates, please go here.

Is Recording = true?

Aug 15, 2013 at 2:47 PM
Is there a way to know if it´s already recording?
Cause i would like to have it in a function, as currently i have to do quite a way around the issue.

But if i can just do something like

If (isrecording)
stoprecording

it would make it much easier.

It should be possible, as i can get an error if it´s already recording, which means, it can sense if it is recording.
Aug 15, 2013 at 5:14 PM
You can check if DataAvailable event is triggered or not.

For example ,

you can write this in

void wi_DataAvailable(object sender, WaveInEventArgs e)
    {
        isRecording = true; //Declare this property 
        bwp.AddSamples(e.Buffer, 0, e.BytesRecorded);

    }
And in StopRecording()
{
isRecording = false;
}

Hope that helps
Aug 15, 2013 at 5:17 PM
Ah true. But is that really a good idea?
Meaning as much as that loop goes on and on, it seems quite, unoptimal so to say.

Meaning why say you are in the air all the time till you land, when you just can say it once, and then stop when you have landed.
Aug 15, 2013 at 5:30 PM
Ya I agree this isn't the best way.

But i wont say it will hamper performance, its just one assignment.

BTW , Do you knw how to access individual mic from a mic array ?
Aug 15, 2013 at 5:33 PM
True, but still. Hmm, well hopefully Mark will look into it:)

Maybe, depends.

I can do something like this.

Have a combobox, put alla available recording devices in it. Change recording device as i choose it in the combobox.

It´s how i do it in my chat application.
Aug 15, 2013 at 5:35 PM
But if the device is mic array (Consisting of two microphones ) Then how do you access individual microphone from the mic array.
Aug 15, 2013 at 5:38 PM
Edited Aug 15, 2013 at 5:39 PM
I pretty much suck at programming, so not really sure what you mean with mic array.

Shouldn´t 1 recording device be 1 mic (if it´s a mic)?
not 1 device = 2 mics?

Here is how i do it for recording devices a least.
 private void GetAudioDevices()
        {
            for (waveInDevice = 0; waveInDevice < NAudio.Wave.WaveIn.DeviceCount; waveInDevice++)
            {
                deviceInfo = WaveIn.GetCapabilities(waveInDevice);
                AudioDevices.Items.Add(deviceInfo.ProductName);
            }
            //Select first combobox item
            if (AudioDevices.Items.Count > 0)
            {
                AudioDevices.SelectedIndex = 0;
            }
            AudioDevices.Items.Add("Wasapi Loopback");
            ListenAudioAgain = false;
            AudioDevice = AudioDevices.SelectedItem.ToString();
        }
Wasapi Loopback is, well wasapi loopback, and as it´s not audio device, i add it last, so it can be ignored.
Aug 15, 2013 at 5:42 PM
Nah I knw that.

The Thing is when I enumerate devices I get the list as ,
Mic array (2 channels)

Now this Mic array has 2 mics inside it. It processes data from both the microphones determines sound direction and stuff. So I get access to Mic array
but not to the individual micrphones inside it. And I want to access them for some reason

Anyways thanks for the help
Aug 15, 2013 at 5:44 PM
Ah good, hmm, i get the picture.
Sadly i don´t know how to help you.

If it is 2 objects in the array, it should be easy to choose 1 object i guess, sadly i don´t have anything like that, so can´t test.

Sorry
Aug 15, 2013 at 5:46 PM
Its not that easy thats the problem. I guess If nobody answers here then I will have to write my custom audio effect implementation in c++.
I wish NAudio could help.
Aug 15, 2013 at 5:49 PM
Well seems so. Hmm, i think Mark probably could understand this.
NAudio is an excellent library so it can probably be solved.

You can try adding it to the Issue tracker?

Mark is a busy man i think, so he isn´t that active in the forums, but will probably check the issue and have a good look at it.