Tools & Utilities
Open Source

PowerShell CLI Audio Streamer

PowerShellWindows Consolempv

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

PowerShellWindows Consolempv

System 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 Did I Build This?

"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

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