docs.rs failed to build smtc-suite-2.6.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
smtc-suite
A Rust library for interacting with Windows System Media Transport Controls (SMTC) and system audio.
smtc-suite provides a safe and efficient API for listening to and controlling media playback on Windows, capturing system audio output, and managing individual application volumes.
Core Features
- Media Session Monitoring: Automatically discovers all SMTC-enabled media sources in the system (like Spotify, Groove Music, etc.) and retrieves currently playing track information (title, artist, album, thumbnail).
- Media Playback Control: Sends playback commands such as play, pause, skip, and seek to the currently active media session.
- System Audio Capture: Captures the system's currently playing audio stream in loopback mode and provides functionality to resample it to a unified format.
- Independent Volume Control: Finds the audio session for a specific application and independently gets or sets its volume.
- Asynchronous & Event-Driven: All background operations are handled in a separate, efficient asynchronous worker thread, communicating with the main application via channels without blocking your app's main thread.
Usage
The sole entry point for interacting with this library is the MediaManager::start() function.
- Calling
MediaManager::start()launches all necessary background services and returns a tuple:(MediaController, mpsc::Receiver<MediaUpdate>). - The
MediaControllerstruct is your handle for sending commands to the background service. It contains acommand_txfield for sendingMediaCommands. - The
mpsc::Receiver<MediaUpdate>is the channel through which you receive all status updates and events from the background. - You can loop on this
Receiverin a separate task to receive real-time updates. - When your application exits, be sure to call
MediaController::shutdown()or send aMediaCommand::Shutdownto gracefully shut down the background thread.
Example
use ;
use Duration;
async