LibSMTC 1.1.0
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Framework 4.7.2
This package targets .NET Framework 4.7.2. The package is compatible with this framework or higher.
dotnet add package LibSMTC --version 1.1.0
NuGet\Install-Package LibSMTC -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LibSMTC" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LibSMTC" Version="1.1.0" />
<PackageReference Include="LibSMTC" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LibSMTC --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LibSMTC, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LibSMTC@1.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LibSMTC&version=1.1.0
#tool nuget:?package=LibSMTC&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
LibSMTC
LibSMTC is a standalone Windows System Media Transport Controls (SMTC) library for .NET desktop apps.
It helps you do two things:
- Player → OS: publish playback state, metadata, timeline, and album art.
- OS → Player: receive media key requests (Play, Pause, Next, Previous, Seek, Shuffle, Repeat).
Why LibSMTC
- Clean, event-based API.
- Works great as a bridge layer for your own audio/video engine.
- Includes a runnable sample app.
Repository Structure
- LibSMTC: reusable class library.
- LibSMTC.Sample: console sample showing end-to-end integration.
- LibSMTC.sln: Visual Studio 2022 solution.
Requirements
- Windows 10/11
- .NET SDK 8.0+
- Visual Studio 2022 (optional, recommended)
Build
Run from the repository root:
dotnet build LibSMTC.sln
Run the Sample
dotnet run --project LibSMTC.Sample
Optional: pass an album art image path:
dotnet run --project LibSMTC.Sample -- D:/path/to/cover.jpg
Sample controls:
- Space: toggle play/pause
- N: switch to next mock track metadata
- C: clear metadata and thumbnail
- R: toggle repeat mode
- S: toggle shuffle
- Left/Right: seek -/+ 10 seconds
- Q or Esc: quit
Quick Start (Library)
using LibSMTC;
using var smtc = new LibSmtcController();
// OS -> Player
smtc.PlayRequested += (_, _) =>
{
// Start playback in your player.
smtc.Play();
};
smtc.PauseRequested += (_, _) =>
{
// Pause playback in your player.
smtc.Pause();
};
// Player -> OS
smtc.SetMusicMetadata(
title: "Song Title",
artist: "Artist",
albumTitle: "Album"
);
smtc.SetTimeline(TimeSpan.FromSeconds(30), TimeSpan.FromMinutes(3));
smtc.Play();
API Highlights
- Playback state: Play, Pause, Stop, Close, PlaybackStatus.
- Metadata: SetMetadata, SetMusicMetadata.
- Artwork: SetThumbnailFromFileAsync, SetThumbnailFromUri, SetThumbnailFromBytesAsync, SetThumbnailFromStreamAsync, ClearThumbnail.
- Timeline: SetTimeline.
- Button control: SetButtons.
- OS requests: PlayRequested, PauseRequested, StopRequested, NextRequested, PreviousRequested, FastForwardRequested, RewindRequested, SeekRequested, ShuffleChangeRequested, RepeatModeChangeRequested.
Development Notes
- XML documentation is enabled for the LibSMTC library project.
- Build outputs (bin/obj) are intentionally not tracked.
License
See the repository license file.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows10.0.19041 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
| .NET Framework | net472 is compatible. net48 is compatible. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.7.2
- Microsoft.Windows.SDK.Contracts (>= 10.0.22000.194)
-
.NETFramework 4.8
- Microsoft.Windows.SDK.Contracts (>= 10.0.22000.194)
-
net8.0-windows10.0.19041
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.