Ejemplo n.º 1
0
        public async void DemandPlayAudioImmediate(AudioRequest audioRequest)
        {
            try
            {
                using MMDevice targetDevice = GetAudioDevice();

                if (targetDevice is null)
                {
                    //Failed to get a device
                    return;
                }

                await audioRequest.PlayRequest(targetDevice);
            }
            catch (Exception e)
            {
                communication.SendErrorMessage(e.ToString());
            }
        }
Ejemplo n.º 2
0
        public async Task PlayAudioRequest(AudioRequest audioRequest)
        {
            try
            {
                using MMDevice targetDevice = GetAudioDevice();

                if (targetDevice is null)
                {
                    //Failed to get a device
                    return;
                }

                currentAudioRequest = audioRequest;
                await audioRequest.PlayRequest(targetDevice);

                currentAudioRequest = null;
            }
            catch (Exception e)
            {
                communication.SendErrorMessage(e.ToString());
            }
        }