示例#1
0
 private void EnsurePolicyConfig()
 {
     if (_sharedPolicyConfig == null)
     {
         _sharedPolicyConfig = AudioPolicyConfigFactory.Create();
     }
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AppAudioService"/> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 public AppAudioService(ILogger <AppAudioService> logger)
 {
     try
     {
         this.AudioPolicyConfig = AudioPolicyConfigFactory.Create();
     }
     catch (Exception ex)
     {
         logger.LogWarning(ex, "Failed to instantiate audio policy config factory.");
         throw;
     }
 }