Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion AudioSwitcher.AudioApi.CoreAudio/CoreAudioDevice.Internal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ private void LoadAudioMeterInformation(IMultimediaDevice device)
}

if (ex != null)
ClearAudioMeterInformation();
{
Dispose();
}
}

private void LoadAudioEndpointVolume(IMultimediaDevice device)
Expand Down
35 changes: 24 additions & 11 deletions AudioSwitcher.AudioApi.CoreAudio/CoreAudioSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,24 +347,37 @@ public void Dispose()
if (_isDisposed)
return;

_deviceMutedSubscription.Dispose();
if (_deviceMutedSubscription != null)
_deviceMutedSubscription.Dispose();

if (_timerSubscription != null)
_timerSubscription.Dispose();

_stateChanged.Dispose();
_disconnected.Dispose();
_volumeChanged.Dispose();
_peakValueChanged.Dispose();
_muteChanged.Dispose();
if (_stateChanged != null)
_stateChanged.Dispose();

//Run this on the com thread to ensure it's diposed correctly
ComThread.BeginInvoke(() =>
if (_disconnected != null)
_disconnected.Dispose();

if (_volumeChanged != null)
_volumeChanged.Dispose();

if (_peakValueChanged != null)
_peakValueChanged.Dispose();

if (_muteChanged != null)
_muteChanged.Dispose();

if (_audioSessionControl != null)
{
_audioSessionControl.UnregisterAudioSessionNotification(this);
//Run this on the com thread to ensure it's diposed correctly
ComThread.BeginInvoke(() =>
{
_audioSessionControl.UnregisterAudioSessionNotification(this);

Marshal.FinalReleaseComObject(_audioSessionControl);
});
Marshal.FinalReleaseComObject(_audioSessionControl);
});
}

GC.SuppressFinalize(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ private void RefreshSessions()
{
IAudioSessionEnumerator enumerator;
_audioSessionManager.GetSessionEnumerator(out enumerator);

if (enumerator == null)
return;

int count;
enumerator.GetCount(out count);

Expand Down
6 changes: 3 additions & 3 deletions SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// associated with an assembly.

[assembly: AssemblyCompany("Forty One Limited")]
[assembly: AssemblyCopyright("Copyright � 2015")]
[assembly: AssemblyCopyright("Copyright � 2023")]

// Version information for an assembly consists of the following four values:
//
Expand All @@ -19,5 +19,5 @@
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("3.0.0.209")]
[assembly: AssemblyFileVersion("3.0.0.256")]
[assembly: AssemblyInformationalVersion("3.0.0.256")]
[assembly: AssemblyFileVersion("3.0.3.420")]
[assembly: AssemblyInformationalVersion("3.0.3.420")]
51 changes: 26 additions & 25 deletions packaging/nuget/AudioSwitcher.AudioApi.CoreAudio.nuspec
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>AudioSwitcher.AudioApi.CoreAudio</id>
<version>3.0.0-beta5</version>
<title>Audio Switcher Core Audio</title>
<authors>Sean Chapman</authors>
<owners>Sean Chapman</owners>
<licenseUrl>https://github.com/xenolightning/AudioSwitcher/blob/master/README.md</licenseUrl>
<projectUrl>https://github.com/xenolightning/AudioSwitcher</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>AudioSwitcher Core Audio Api.
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>AudioSwitcher.AudioApi.CoreAudio</id>
<version>3.0.3</version>
<title>Audio Switcher Core Audio</title>
<authors>Sean Chapman</authors>
<owners>Sean Chapman</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl>https://github.com/xenolightning/AudioSwitcher/blob/master/README.md</licenseUrl>
<projectUrl>https://github.com/xenolightning/AudioSwitcher</projectUrl>
<description>AudioSwitcher Core Audio Api.

This includes all controllers and devices to access Windows System Devices and manipulate them.

This library can be used on any PC running Windows Vista and above. Supports both x86/x64 runtimes.</description>
<summary>Windows WASAPI/Core Audio library extension of the Audio Switcher Audio API.</summary>
<releaseNotes>- Windows 10 support
<summary>Windows WASAPI/Core Audio library extension of the Audio Switcher Audio API.</summary>
<releaseNotes>- Windows 10 support
- Using api 3.0.0 as a base
- Standard events have been replaced with observables
- Audio Session support for Windows 7 and above.
- Session peak value observable
- SpeakerConfig support
- bit Depth/sample rate support</releaseNotes>
<copyright>Sean Chapman</copyright>
<language>en-US</language>
<tags>wasapi audioswitcher audio api</tags>
<dependencies>
<group targetFramework=".NETFramework4.0">
<dependency id="AudioSwitcher.AudioApi" version="3.0.0-beta5" />
</group>
</dependencies>
</metadata>
<files>
<file src="..\..\bin\Release\AudioSwitcher.AudioApi.CoreAudio.dll" target="lib\net40\AudioSwitcher.AudioApi.CoreAudio.dll" />
</files>
<copyright>Sean Chapman</copyright>
<language>en-US</language>
<tags>wasapi audioswitcher audio api</tags>
<dependencies>
<dependency id="AudioSwitcher.AudioApi" version="3.0.0" />
</dependencies>
</metadata>
<files>
<file src="..\..\bin\Release\AudioSwitcher.AudioApi.CoreAudio.dll" target="lib\net40\AudioSwitcher.AudioApi.CoreAudio.dll" />
<file src="..\..\bin\Release\AudioSwitcher.AudioApi.CoreAudio.dll" target="lib\net452\AudioSwitcher.AudioApi.CoreAudio.dll" />
<file src="..\..\bin\Release\AudioSwitcher.AudioApi.CoreAudio.dll" target="lib\net472\AudioSwitcher.AudioApi.CoreAudio.dll" />
<file src="..\..\bin\Release\AudioSwitcher.AudioApi.CoreAudio.dll" target="lib\net48\AudioSwitcher.AudioApi.CoreAudio.dll" />
</files>
</package>