views:

32

answers:

2

I'm writing a small audio recorder component in Silverlight 4. It works fine, but I've noticed that when I'm recording audio, the light on my webcam turns on indicating that the camera is active.

While I know that I'm not doing anything insidious with the webcam, my users would have every right to be suspicious. Is it possible to tell Silverlight that I'm only interested in microphone access and not activate the webcam?

FWIW here's how I'm accessing the mic:

private CaptureSource _source = new CaptureSource();
private MemoryAudioSink _sink;  // Inherits from AudioSink. Doesn't do much more 
                                // than store PCM audio stream in memory

private void Record_Click(object sender, RoutedEventArgs e)
{
    if (( CaptureDeviceConfiguration.AllowedDeviceAccess || 
          CaptureDeviceConfiguration.RequestDeviceAccess() ) && 
        _source.State == CaptureState.Stopped)
    {
        _sink = new MemoryAudioSink();
        _sink.CaptureSource = _source;
        _source.Start();
    }
}
A: 

This would depend on the webcam driver - Silverlight would have no control over this.

AdamC
When I record audio with Sound Recorder, the light does not illuminate. So I fear there's an oversimplification going on in Silverlight instead.
roufamatic
Are you sure you're recording from the webcam in Sound Recorder?
AdamC
I'm not trying to record audio from the webcam, I'm trying to record it from the default sound device. My webcam is integrated and doesn't have a microphone, anyway.
roufamatic
A: 

I'm guessing its related to your use of CaptureSource. Microsoft's web site claims that:

Silverlight 4 APIs only use CaptureSource in a video scenario where audio may not be relevant.

Is there a way to get audio without creating your own CaptureSource?

interfect