Skip to content
All projects

PowerShell CLI Audio Streamer

A headless, CLI-based PowerShell wrapper for the `mpv` media engine, providing resource-efficient streaming of internet radio endpoints with zero GUI overhead.

Tech stack

Languages
Frameworks & libraries
Tools

Performance & metrics

  • Reduces memory footprint from typical web-player levels (~300MB) to the absolute bare minimum required by the mpv daemon and a dormant PS session
  • Eliminates graphics rendering overhead entirely by bypassing the Windows DWM (Desktop Window Manager) and enforcing hardware-level audio decoding

Why I built it

Modern browsers and Electron-based music players consume unjustifiable amounts of RAM and CPU cycles for simple audio streaming tasks. I engineered this utility to entirely bypass GUI bloat, directly piping audio streams through the highly optimized mpv daemon. It functions as a background audio process with a near-zero system footprint, ideal for constrained development environments.

Architecture & decisions

Structured as a synchronous REPL loop operating within the PowerShell host. Station metadata and stream endpoints are strictly defined in an in-memory array of hashtables. Subprocess routing is delegated to the mpv engine via the call operator (&), explicitly forcing audio-only execution (--no-video) to eliminate GPU rendering hooks. Graceful process teardown is achieved by catching PipelineStoppedException signals when the user interrupts the execution via SIGINT (Ctrl+C).

Key features

  1. 01Headless audio streaming via direct subprocess delegation to the mpv engine
  2. 02Strict type validation utilizing [int]::TryParse to prevent memory access violations during menu index selection
  3. 03Robust exception handling for SIGINT interruptions, ensuring clean subprocess termination without zombie processes