Skip to content

Cannot record with the built-in microphone in laptop #894

@McTopaz

Description

@McTopaz

My company use NAudio V1.10.0 in one of our applications.
We have a problem that we cannot record while using headphones.

Setup
On my laptop there is a built in microphone.
There is also a standard input (3.5mm?) jack to connect a headphone with combined ear speakers and microphone.
I have connected such a headphone to the input jack on my laptop.

Problem
But it seems that NAudio cannot distinguish between the headphone's mic and the built in microphone.
As if they share the same the same resource(s) internally.

Some testing
I have made a test application as a Console Application with NAudio 2.1 to check if that version works better. But unfortunately not.
Here is the source of my test application at this Gist.

List of microphone
Here is the list of microphone detects by NAudio when running the application.

 === WaveIn / WaveInCapabilities ===
ProductName:    Microphone Array (Realtek(R) Au
ProductGuid:    e36dc311-6d9a-11d1-a21a-00a0c9223196

ProductName:    External Mic (Realtek(R) Audio)
ProductGuid:    e36dc311-6d9a-11d1-a21a-00a0c9223196


 === MMDeviceEnumerator / MMDevice ===
FriendlyName:   External Mic (Realtek(R) Audio)
ID:             {0.0.1.00000000}.{1ba4ea63-6306-4ac6-a192-6c84193111da}

FriendlyName:   Microphone Array (Realtek(R) Audio)
ID:             {0.0.1.00000000}.{aeb09118-c6c5-4d17-b9e3-4ed5b8313316}

Microphones

  • External Mic (Realtek(R) Audio) is the headphone.
  • Microphone Array (Realtek(R) Audio) is the built-in microphone.

Notice the WaveIn / WaveinCapabilities detects the two microphones, but:

  • The full name of the Microphone Array (Realtek(R) Audio) is not printed. Minor bug?
  • Both microphones share the same ProductGuid. Why?

Compare two the MMDeviceEnumerator / MMDevice listing which clearly distinguish the microphones.

Further problem when recording
In my code, at Gist, I have also shown the bareback code how we test a microphone with NAudio.
I cannot get the audio I record to playback, so just ignore the playback stuff there.

In our application we can hear what we record if we use the Devicde Id = 0.
Device Id = 0 seems to be the built-in microphone.
If we try to use the headphone, which has device Id = 1, it doesn't work :(

What is going on here?
Is there a solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions