WaveIn' type not found in NAudio.Core for console application

69 Views Asked by At

I'm building a console app using NAudio.Core to capture my mic. I've installed the package, but the 'WaveIn' type is missing, preventing me from using it. I'm using Visual Studio 2022, version 17.8.3, and my framework is 6.0.

I've tried reinstalling, cleaning, checking references, and target framework compatibility.

using System;
using System.Threading.Tasks;
// Using NAudio.Core for console apps, but WaveIn not found
// using NAudio.Core;

namespace PersonalAssistant
{
    class Program
    {
        static async Task Main(string[] args)
        {
            try
            {
                // Attempt to create a WaveIn instance (this line would cause the error)
                // WaveIn waveIn = new WaveIn();  // Error: The type or namespace name 'WaveIn' could not be found

                // Code to configure and start audio recording would go here

                Console.ReadLine();  // Keep the console app running
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: " + ex.Message);
            }
        }
    }
}
0

There are 0 best solutions below