using System;

namespace Lesson05.Services
{
    class AudioService
    {
        private bool isListening;
        private string deviceName;

        public AudioService()
        {
            this.deviceName = "默认麦克风";
            this.isListening = false;
        }

        public void StartListening()
        {
            if (!isListening)
            {
                isListening = true;
                Console.WriteLine($"[{deviceName}] 开始监听...");
            }
        }

        public void StopListening()
        {
            if (isListening)
            {
                isListening = false;
                Console.WriteLine($"[{deviceName}] 停止监听");
            }
        }

        public bool IsListening()
        {
            return isListening;
        }
    }
}
