Add stream_block example for testing HTTP streaming with VLC

Creates a new example demonstrating StreamingFlacSink usage with pmoserver
for real-world HTTP streaming testing with media players like VLC.

Features:
- Uses pmoserver instead of raw Axum for realistic testing
- Streams a single Radio Paradise block over HTTP
- Supports both pure FLAC and ICY metadata modes
- Provides /test/stream endpoint for streaming
- Provides /test/metadata endpoint for JSON metadata queries
- Includes health check endpoint

Usage:
  cargo run --example stream_block --features full -- <channel_id>

Testing with VLC:
  # Pure FLAC mode
  vlc http://localhost:8080/test/stream

  # ICY metadata mode (Now Playing)
  vlc --http-continuous --icy-metadata http://localhost:8080/test/stream

Dependencies:
- Requires pmoserver for HTTP server
- Requires StreamingFlacSink from pmoaudio-ext (http-stream feature)
- Integrated with full feature set (pmoaudio + pmoaudio-ext + pmoserver)
This commit is contained in:
Claude
2025-11-11 19:33:25 +00:00
parent b25a4f9fb3
commit 4884fddf0e
2 changed files with 288 additions and 2 deletions

View File

@@ -52,7 +52,7 @@ symphonia = { version = "0.5", features = ["all"] }
claxon = "0.4"
# pmoaudio-ext with playlist support (optional for examples)
pmoaudio-ext = { path = "../pmoaudio-ext", optional = true, features = ["playlist"] }
pmoaudio-ext = { path = "../pmoaudio-ext", optional = true, features = ["playlist", "http-stream"] }
# Common music source traits
pmosource = { path = "../pmosource" }
@@ -91,7 +91,7 @@ cache = []
# Active le support pmoaudio node (RadioParadiseStreamSource)
pmoaudio = ["dep:pmoaudio", "dep:pmoflac", "dep:pmometadata", "dep:futures-util"]
# Active le support complet avec playlist (pour les exemples avancés)
full = ["pmoaudio", "dep:pmoaudio-ext", "pmoconfig"]
full = ["pmoaudio", "dep:pmoaudio-ext", "pmoconfig", "dep:pmoserver"]
[dev-dependencies]
# Tests
@@ -106,3 +106,8 @@ pmoaudiocache = { path = "../pmoaudiocache" }
[[example]]
name = "now_playing"
path = "examples/now_playing.rs"
[[example]]
name = "stream_block"
path = "examples/stream_block.rs"
required-features = ["full"]