This project has moved. For the latest updates, please go here.

Recording a Conversation in Communicator.

Feb 18, 2011 at 6:40 AM

Hi,

 

I am new to NAudio. I am trying to record a conversation in communicator. As per the microsoft documentation I think I have to do a LoopBack recording.

So in AudioClient I trind to Initialize using first two parameters as shared and loopback. 

 int hresult = audioClientInterface.Initialize(AudioClientShareMode.Shared, AudioClientStreamFlags.Loopback, bufferDuration, periodicity, waveFormat, ref audioSessionGuid);  

I am getting an exception like below. 

Exception from HRESULT: 0x88890003

my hresult value is -2004287485

 

Can anybody tell me the reason and how I can correct it??

 

Thanks,

Jorge

Coordinator
Feb 21, 2011 at 9:37 AM

You'll have to use google to get the exact meaning of that error code. What OS are you using? And what waveFormat are you trying to record in?

Mark

Feb 22, 2011 at 9:06 AM

My OS is Windows 7 Enterprise Edition, and I am recording in wav format.

Coordinator
Feb 22, 2011 at 10:19 AM

I mean what sample rate & bit depth etc (do a waveFormat.ToString())

Mark

Feb 25, 2011 at 3:24 AM

This is the wav format.

it's the devices mixformat and the device is a usb handset.

"32 bit PCM: 44kHz 1 channels wBitsPerSample:32 dwChannelMask:4 subFormat:00000003-0000-0010-8000-00aa00389b71 extraSize:22"

Coordinator
Feb 25, 2011 at 8:56 AM

can you open it in exclusive mode?

Feb 28, 2011 at 4:39 AM

No,

it also throws exception 

Exception from HRESULT: 0x88890003

 

Coordinator
Feb 28, 2011 at 12:46 PM

ok, I would suggest you find some forums where WASAPI is discussed and find out the meaning of those error codes

Mark

Mar 1, 2011 at 4:43 AM

Thanks Mark.

Jun 2, 2011 at 12:08 PM
Edited Jun 2, 2011 at 12:20 PM

For those still looking for HRESULT: 0x88890003 description and other exceptions see

http://hi.baidu.com/littlexizf/blog/item/c4675cf609c6d330bc3109c4.html

0x88890003 AUDCLNT_E_WRONG_ENDPOINT_TYPE

Description : The AUDCLNT_STREAMFLAGS_LOOPBACK flag is set but the endpoint device is a capture device, not a rendering device.

http://msdn.microsoft.com/en-us/library/dd370875(v=vs.85).aspx

Also, reason for failure to Initialize explained copied from msdn :

The AUDCLNT_STREAMFLAGS_LOOPBACK flag enables loopback recording. In loopback recording, the audio engine copies the audio stream that is being played by a rendering endpoint device into an audio endpoint buffer so that a WASAPI client can capture the stream. If this flag is set, the IAudioClient::Initialize method attempts to open a capture buffer on the rendering device. This flag is valid only for a rendering device and only if the Initialize call sets the ShareMode parameter to AUDCLNT_SHAREMODE_SHARED. Otherwise the Initialize call will fail. If the call succeeds, the client can call the IAudioClient::GetService method to obtain an IAudioCaptureClient interface on the rendering device. For more information, see Loopback Recording.