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()); } }
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()); } }