5ea27408951c2116a0ee23eae49a96bcf6e2538f
Add MusicPlayer, a thread-safe lazy singleton that plays one audio file at a time through NAudio 3.3.0 (WaveOut and AudioFileReader). It offers Play, Pause, Resume, Stop, Position, Duration, Volume and IsPlaying, plus TrackFinished and PositionChanged events. The station needs one shared playback point that later schedule and UI code can drive. TrackFinished fires only when a track ends on its own. Stop and Play unsubscribe from the old output before releasing it, so they never raise it. Both events run on a thread-pool thread, so WPF callers must marshal to the dispatcher. Reader and output are disposed on stop, on replacement and on process exit. A missing file throws FileNotFoundException and an unreadable one InvalidDataException; in both cases the player stays stopped. Tests cover the singleton, error cases and events. Tests that need an audio device skip when none is present. Refs #6 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blockwoche 3.1: Radiosender
WPF desktop app that plans and plays a radio program: random music from a SQLite library, news at :00 and :30, and ad and moderator blocks.
Requirements
- Windows
- .NET SDK 10
Build and run
dotnet build Radiosender.slnx
dotnet run --project src/Radiosender
dotnet test Radiosender.slnx
The app creates its SQLite database on first start at %LOCALAPPDATA%\Radiosender\radiosender.db.
Structure
The app uses the MVC pattern and WPF UI for the interface.
src/Radiosender/Models: data and domain typessrc/Radiosender/Views: windows and pages (XAML)src/Radiosender/Controllers: logic that connects views and modelssrc/Radiosender/Services: database, audio player and API access
Description
📻 Program to stream radio specially to lautfm.
350 KiB
0 Stars
1 Watchers
0 Forks
Languages
C#
100%